Skip to content

Commit e5222d0

Browse files
committed
581a dry colors - histogram2d, histogram2dcontour
1 parent 99abf13 commit e5222d0

File tree

2 files changed

+37
-44
lines changed

2 files changed

+37
-44
lines changed

src/traces/histogram2d/attributes.js

+32-34
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,40 @@
1010

1111
var histogramAttrs = require('../histogram/attributes');
1212
var heatmapAttrs = require('../heatmap/attributes');
13+
var colorscaleAttrs = require('../../components/colorscale/attributes');
1314

14-
module.exports = {
15-
x: histogramAttrs.x,
16-
y: histogramAttrs.y,
15+
var extendFlat = require('../../lib/extend').extendFlat;
1716

18-
z: {
19-
valType: 'data_array',
20-
description: 'Sets the aggregation data.'
21-
},
22-
marker: {
23-
color: {
17+
module.exports = extendFlat({},
18+
colorscaleAttrs,
19+
{autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})},
20+
{
21+
x: histogramAttrs.x,
22+
y: histogramAttrs.y,
23+
24+
z: {
2425
valType: 'data_array',
2526
description: 'Sets the aggregation data.'
27+
},
28+
marker: {
29+
color: {
30+
valType: 'data_array',
31+
description: 'Sets the aggregation data.'
32+
}
33+
},
34+
35+
histnorm: histogramAttrs.histnorm,
36+
histfunc: histogramAttrs.histfunc,
37+
autobinx: histogramAttrs.autobinx,
38+
nbinsx: histogramAttrs.nbinsx,
39+
xbins: histogramAttrs.xbins,
40+
autobiny: histogramAttrs.autobiny,
41+
nbinsy: histogramAttrs.nbinsy,
42+
ybins: histogramAttrs.ybins,
43+
44+
zsmooth: heatmapAttrs.zsmooth,
45+
46+
_nestedModules: {
47+
'colorbar': 'Colorbar'
2648
}
27-
},
28-
29-
histnorm: histogramAttrs.histnorm,
30-
histfunc: histogramAttrs.histfunc,
31-
autobinx: histogramAttrs.autobinx,
32-
nbinsx: histogramAttrs.nbinsx,
33-
xbins: histogramAttrs.xbins,
34-
autobiny: histogramAttrs.autobiny,
35-
nbinsy: histogramAttrs.nbinsy,
36-
ybins: histogramAttrs.ybins,
37-
38-
zauto: heatmapAttrs.zauto,
39-
zmin: heatmapAttrs.zmin,
40-
zmax: heatmapAttrs.zmax,
41-
colorscale: heatmapAttrs.colorscale,
42-
autocolorscale: heatmapAttrs.autocolorscale,
43-
reversescale: heatmapAttrs.reversescale,
44-
showscale: heatmapAttrs.showscale,
45-
46-
zsmooth: heatmapAttrs.zsmooth,
47-
48-
_nestedModules: {
49-
'colorbar': 'Colorbar'
50-
}
51-
};
49+
});

src/traces/histogram2dcontour/attributes.js

+5-10
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010

1111
var histogram2dAttrs = require('../histogram2d/attributes');
1212
var contourAttrs = require('../contour/attributes');
13+
var colorscaleAttrs = require('../../components/colorscale/attributes');
1314

14-
module.exports = {
15+
var extendFlat = require('../../lib/extend').extendFlat;
16+
17+
module.exports = extendFlat({}, colorscaleAttrs, {
1518
x: histogram2dAttrs.x,
1619
y: histogram2dAttrs.y,
1720
z: histogram2dAttrs.z,
@@ -26,14 +29,6 @@ module.exports = {
2629
nbinsy: histogram2dAttrs.nbinsy,
2730
ybins: histogram2dAttrs.ybins,
2831

29-
zauto: contourAttrs.zauto,
30-
zmin: contourAttrs.zmin,
31-
zmax: contourAttrs.zmax,
32-
colorscale: contourAttrs.colorscale,
33-
autocolorscale: contourAttrs.autocolorscale,
34-
reversescale: contourAttrs.reversescale,
35-
showscale: contourAttrs.showscale,
36-
3732
autocontour: contourAttrs.autocontour,
3833
ncontours: contourAttrs.ncontours,
3934
contours: contourAttrs.contours,
@@ -42,4 +37,4 @@ module.exports = {
4237
_nestedModules: {
4338
'colorbar': 'Colorbar'
4439
}
45-
};
40+
});

0 commit comments

Comments
 (0)