8
8
9
9
'use strict' ;
10
10
11
+ var colorAttributes = require ( '../../components/colorscale/color_attributes' ) ;
12
+
11
13
var Drawing = require ( '../../components/drawing' ) ;
12
14
13
15
var constants = require ( './constants' ) ;
14
16
17
+ var extendDeep = require ( '../../lib/extend' ) . extendDeep ;
18
+
15
19
16
20
module . exports = {
17
21
x : {
@@ -181,7 +185,7 @@ module.exports = {
181
185
'marker color, or marker line color, whichever is available.'
182
186
] . join ( ' ' )
183
187
} ,
184
- marker : {
188
+ marker : extendDeep ( { } , colorAttributes ( 'marker' ) , {
185
189
symbol : {
186
190
valType : 'enumerated' ,
187
191
values : Drawing . symbolList ,
@@ -212,17 +216,6 @@ module.exports = {
212
216
role : 'style' ,
213
217
description : 'Sets the marker size (in px).'
214
218
} ,
215
- color : {
216
- valType : 'color' ,
217
- arrayOk : true ,
218
- role : 'style' ,
219
- description : [
220
- 'Sets the marker color. It accepts either a specific color' ,
221
- 'or an array of values that are mapped to the colorscale' ,
222
- 'relative to the max and min values of the array or relative to' ,
223
- '`cmin` and `cmax` if set.'
224
- ] . join ( ' ' )
225
- } ,
226
219
maxdisplayed : {
227
220
valType : 'number' ,
228
221
min : 0 ,
@@ -264,73 +257,6 @@ module.exports = {
264
257
'to pixels.'
265
258
] . join ( ' ' )
266
259
} ,
267
- colorscale : {
268
- valType : 'colorscale' ,
269
- role : 'style' ,
270
- description : [
271
- 'Sets the colorscale and only has an effect' ,
272
- 'if `marker.color` is set to a numerical array.' ,
273
- 'The colorscale must be an array containing' ,
274
- 'arrays mapping a normalized value to an' ,
275
- 'rgb, rgba, hex, hsl, hsv, or named color string.' ,
276
- 'At minimum, a mapping for the lowest (0) and highest (1)' ,
277
- 'values are required. For example,' ,
278
- '`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.' ,
279
- 'To control the bounds of the colorscale in color space,' ,
280
- 'use `marker.cmin` and `marker.cmax`.'
281
- ] . join ( ' ' )
282
- } ,
283
- cauto : {
284
- valType : 'boolean' ,
285
- dflt : true ,
286
- role : 'style' ,
287
- description : [
288
- 'Has an effect only if `marker.color` is set to a numerical array.' ,
289
- 'Determines the whether or not the color domain is computed' ,
290
- 'automatically.'
291
- ] . join ( ' ' )
292
- } ,
293
- cmax : {
294
- valType : 'number' ,
295
- dflt : null ,
296
- role : 'info' ,
297
- description : [
298
- 'Has an effect only if `marker.color` is set to a numerical array.' ,
299
- 'Sets the upper bound of the color domain.' ,
300
- 'Value should be associated to the `marker.color` array index,' ,
301
- 'and if set, `marker.cmin` must be set as well.'
302
- ] . join ( ' ' )
303
- } ,
304
- cmin : {
305
- valType : 'number' ,
306
- dflt : null ,
307
- role : 'info' ,
308
- description : [
309
- 'Has an effect only if `marker.color` is set to a numerical array.' ,
310
- 'Sets the lower bound of the color domain.' ,
311
- 'Value should be associated to the `marker.color` array index,' ,
312
- 'and if set, `marker.cmax` must be set as well.'
313
- ] . join ( ' ' )
314
- } ,
315
- autocolorscale : {
316
- valType : 'boolean' ,
317
- dflt : true ,
318
- role : 'style' ,
319
- description : [
320
- 'Has an effect only if `marker.color` is set to a numerical array.' ,
321
- 'Determines whether or not the colorscale is picked using' ,
322
- 'values inside `marker.color`.'
323
- ] . join ( ' ' )
324
- } ,
325
- reversescale : {
326
- valType : 'boolean' ,
327
- role : 'style' ,
328
- dflt : false ,
329
- description : [
330
- 'Has an effect only if `marker.color` is set to a numerical array.' ,
331
- 'Reverses the colorscale.'
332
- ] . join ( ' ' )
333
- } ,
334
260
showscale : {
335
261
valType : 'boolean' ,
336
262
role : 'info' ,
@@ -340,94 +266,16 @@ module.exports = {
340
266
'Determines whether or not a colorbar is displayed.'
341
267
] . join ( ' ' )
342
268
} ,
343
- line : {
344
- color : {
345
- valType : 'color' ,
346
- arrayOk : true ,
347
- role : 'style' ,
348
- description : [
349
- 'Sets the marker outline color. It accepts either a specific color' ,
350
- 'or an array of values that are mapped to the colorscale' ,
351
- 'relative to the max and min values of the array or relative to' ,
352
- '`cmin` and `cmax` if set.'
353
- ] . join ( ' ' )
354
- } ,
269
+ line : extendDeep ( { } , colorAttributes ( 'marker.line' ) , {
355
270
width : {
356
271
valType : 'number' ,
357
272
min : 0 ,
358
273
arrayOk : true ,
359
274
role : 'style' ,
360
275
description : 'Sets the width (in px) of the lines bounding the marker points.'
361
- } ,
362
- colorscale : {
363
- valType : 'colorscale' ,
364
- role : 'style' ,
365
- description : [
366
- 'Sets the colorscale and only has an effect' ,
367
- 'if `marker.line.color` is set to a numerical array.' ,
368
- 'The colorscale must be an array containing' ,
369
- 'arrays mapping a normalized value to an' ,
370
- 'rgb, rgba, hex, hsl, hsv, or named color string.' ,
371
- 'At minimum, a mapping for the lowest (0) and highest (1)' ,
372
- 'values are required. For example,' ,
373
- '`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.' ,
374
- 'To control the bounds of the colorscale in color space,' ,
375
- 'use `marker.line.cmin` and `marker.line.cmax`.'
376
- ] . join ( ' ' )
377
- } ,
378
- cauto : {
379
- valType : 'boolean' ,
380
- dflt : true ,
381
- role : 'style' ,
382
- description : [
383
- 'Has an effect only if `marker.line.color` is set to a numerical array.' ,
384
- 'Determines the whether or not the color domain is computed' ,
385
- 'with respect to the input data.'
386
- ] . join ( ' ' )
387
- } ,
388
- cmax : {
389
- valType : 'number' ,
390
- dflt : null ,
391
- role : 'info' ,
392
- description : [
393
- 'Has an effect only if `marker.line.color` is set to a numerical array.' ,
394
- 'Sets the upper bound of the color domain.' ,
395
- 'Value should be associated to the `marker.line.color` array index,' ,
396
- 'and if set, `marker.line.cmin` must be set as well.'
397
- ] . join ( ' ' )
398
- } ,
399
- cmin : {
400
- valType : 'number' ,
401
- dflt : null ,
402
- role : 'info' ,
403
- description : [
404
- 'Has an effect only if `marker.line.color` is set to a numerical array.' ,
405
- 'Sets the lower bound of the color domain.' ,
406
- 'Value should be associated to the `marker.line.color` array index,' ,
407
- 'and if set, `marker.line.cmax` must be set as well.'
408
- ] . join ( ' ' )
409
- } ,
410
- autocolorscale : {
411
- valType : 'boolean' ,
412
- dflt : true ,
413
- role : 'style' ,
414
- description : [
415
- 'Has an effect only if `marker.line.color` is set to a numerical array.' ,
416
- 'Determines whether or not the colorscale is picked using' ,
417
- 'the sign of values inside `marker.line.color`.'
418
- ] . join ( ' ' )
419
- } ,
420
- reversescale : {
421
- valType : 'boolean' ,
422
- dflt : false ,
423
- role : 'style' ,
424
- description : [
425
- 'Has an effect only if `marker.line.color` is set to a numerical array.' ,
426
- 'Reverses the colorscale.'
427
- ] . join ( ' ' )
428
276
}
429
- }
430
- } ,
277
+ } )
278
+ } ) ,
431
279
textposition : {
432
280
valType : 'enumerated' ,
433
281
values : [
0 commit comments