Skip to content

Commit 7e7a6db

Browse files
committed
581a dry colors - scatter3d
1 parent d226c7a commit 7e7a6db

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

src/traces/scatter3d/attributes.js

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
'use strict';
1111

1212
var scatterAttrs = require('../scatter/attributes');
13+
var colorAttributes = require('../../components/colorscale/color_attributes');
14+
1315
var MARKER_SYMBOLS = require('../../constants/gl_markers');
1416
var extendFlat = require('../../lib/extend').extendFlat;
17+
var extendDeep = require('../../lib/extend').extendDeep;
1518

1619
var scatterLineAttrs = scatterAttrs.line,
1720
scatterMarkerAttrs = scatterAttrs.marker,
@@ -101,8 +104,10 @@ module.exports = {
101104
width: scatterLineAttrs.width,
102105
dash: scatterLineAttrs.dash
103106
},
104-
marker: { // Parity with scatter.js?
105-
color: scatterMarkerAttrs.color,
107+
// Currently, `marker` etc. contain mixed attributes (colorAttributes
108+
// and a bunch of others); maybe a future API change could wrap parts
109+
// that belong together, under a `colorspec` or similar attribute name.
110+
marker: extendDeep({}, colorAttributes('marker'), { // Parity with scatter.js?
106111
symbol: {
107112
valType: 'enumerated',
108113
values: Object.keys(MARKER_SYMBOLS),
@@ -126,24 +131,11 @@ module.exports = {
126131
'to an rgba color and use its alpha channel.'
127132
].join(' ')
128133
}),
129-
colorscale: scatterMarkerAttrs.colorscale,
130-
cauto: scatterMarkerAttrs.cauto,
131-
cmax: scatterMarkerAttrs.cmax,
132-
cmin: scatterMarkerAttrs.cmin,
133-
autocolorscale: scatterMarkerAttrs.autocolorscale,
134-
reversescale: scatterMarkerAttrs.reversescale,
135134
showscale: scatterMarkerAttrs.showscale,
136-
line: {
137-
color: scatterMarkerLineAttrs.color,
138-
width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false}),
139-
colorscale: scatterMarkerLineAttrs.colorscale,
140-
cauto: scatterMarkerLineAttrs.cauto,
141-
cmax: scatterMarkerLineAttrs.cmax,
142-
cmin: scatterMarkerLineAttrs.cmin,
143-
autocolorscale: scatterMarkerLineAttrs.autocolorscale,
144-
reversescale: scatterMarkerLineAttrs.reversescale
145-
}
146-
},
135+
line: extendDeep({}, colorAttributes('marker.line'), {
136+
width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
137+
})
138+
}),
147139
textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
148140
textfont: scatterAttrs.textfont,
149141
_nestedModules: {

0 commit comments

Comments
 (0)