Skip to content

Commit 731b294

Browse files
committed
write own heatmapgl attributes
- instead of simply copying attribute from 'heatmap' - attribute like 'zsmooth', 'xgap' and 'connectgaps' aren't available in 'heatmapgl'
1 parent 879bb7e commit 731b294

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/traces/heatmapgl/attributes.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,31 @@
1010

1111

1212
var heatmapAttrs = require('../scatter/attributes');
13+
var colorscaleAttrs = require('../../components/colorscale/attributes');
14+
var colorbarAttrs = require('../../components/colorbar/attributes');
1315

14-
module.exports = heatmapAttrs;
16+
var extendFlat = require('../../lib/extend').extendFlat;
17+
18+
var commonList = [
19+
'z',
20+
'x', 'x0', 'dx',
21+
'y', 'y0', 'dy',
22+
'text', 'transpose',
23+
'xtype', 'ytype'
24+
];
25+
26+
var attrs = {};
27+
28+
for(var i = 0; i < commonList.length; i++) {
29+
var k = commonList[i];
30+
attrs[k] = heatmapAttrs[k];
31+
}
32+
33+
extendFlat(
34+
attrs,
35+
colorscaleAttrs,
36+
{ autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false}) },
37+
{ colorbar: colorbarAttrs }
38+
);
39+
40+
module.exports = attrs;

0 commit comments

Comments
 (0)