10
10
'use strict' ;
11
11
12
12
var scatterAttrs = require ( '../scatter/attributes' ) ;
13
+ var colorAttributes = require ( '../../components/colorscale/color_attributes' ) ;
14
+
13
15
var MARKER_SYMBOLS = require ( '../../constants/gl_markers' ) ;
14
16
var extendFlat = require ( '../../lib/extend' ) . extendFlat ;
17
+ var extendDeep = require ( '../../lib/extend' ) . extendDeep ;
15
18
16
19
var scatterLineAttrs = scatterAttrs . line ,
17
20
scatterMarkerAttrs = scatterAttrs . marker ,
@@ -101,8 +104,10 @@ module.exports = {
101
104
width : scatterLineAttrs . width ,
102
105
dash : scatterLineAttrs . dash
103
106
} ,
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?
106
111
symbol : {
107
112
valType : 'enumerated' ,
108
113
values : Object . keys ( MARKER_SYMBOLS ) ,
@@ -126,24 +131,11 @@ module.exports = {
126
131
'to an rgba color and use its alpha channel.'
127
132
] . join ( ' ' )
128
133
} ) ,
129
- colorscale : scatterMarkerAttrs . colorscale ,
130
- cauto : scatterMarkerAttrs . cauto ,
131
- cmax : scatterMarkerAttrs . cmax ,
132
- cmin : scatterMarkerAttrs . cmin ,
133
- autocolorscale : scatterMarkerAttrs . autocolorscale ,
134
- reversescale : scatterMarkerAttrs . reversescale ,
135
134
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
+ } ) ,
147
139
textposition : extendFlat ( { } , scatterAttrs . textposition , { dflt : 'top center' } ) ,
148
140
textfont : scatterAttrs . textfont ,
149
141
_nestedModules : {
0 commit comments