Skip to content

Commit 6460fb8

Browse files
committed
Merge pull request #366 from plotly/colorscale-descriptions
🎎 Clarify color attribute descriptions
2 parents 826ed94 + 58d215b commit 6460fb8

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

src/traces/scatter/attributes.js

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ module.exports = {
200200
valType: 'color',
201201
arrayOk: true,
202202
role: 'style',
203-
description: 'Sets the marker color.'
203+
description: [
204+
'Sets the marker color. It accepts either a specific color',
205+
'or an array of values that are mapped to the colorscale',
206+
'relative to the max and min values of the array or relative to',
207+
'`cmin` and `cmax` if set.'
208+
].join(' ')
204209
},
205210
maxdisplayed: {
206211
valType: 'number',
@@ -247,15 +252,16 @@ module.exports = {
247252
valType: 'colorscale',
248253
role: 'style',
249254
description: [
250-
'Sets the colorscale.',
255+
'Sets the colorscale and only has an effect',
256+
'if `marker.color` is set to a numerical array.',
251257
'The colorscale must be an array containing',
252258
'arrays mapping a normalized value to an',
253259
'rgb, rgba, hex, hsl, hsv, or named color string.',
254260
'At minimum, a mapping for the lowest (0) and highest (1)',
255261
'values are required. For example,',
256262
'`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.',
257263
'To control the bounds of the colorscale in color space,',
258-
'use cmin and cmax'
264+
'use `marker.cmin` and `marker.cmax`.'
259265
].join(' ')
260266
},
261267
cauto: {
@@ -274,7 +280,9 @@ module.exports = {
274280
role: 'info',
275281
description: [
276282
'Has only an effect if `marker.color` is set to a numerical array.',
277-
'Sets the upper bound of the color domain.'
283+
'Sets the upper bound of the color domain.',
284+
'Value should be associated to the `marker.color` array index,',
285+
'and if set, `marker.cmin` must be set as well.'
278286
].join(' ')
279287
},
280288
cmin: {
@@ -283,7 +291,9 @@ module.exports = {
283291
role: 'info',
284292
description: [
285293
'Has only an effect if `marker.color` is set to a numerical array.',
286-
'Sets the lower bound of the color domain.'
294+
'Sets the lower bound of the color domain.',
295+
'Value should be associated to the `marker.color` array index,',
296+
'and if set, `marker.cmax` must be set as well.'
287297
].join(' ')
288298
},
289299
autocolorscale: {
@@ -319,7 +329,12 @@ module.exports = {
319329
valType: 'color',
320330
arrayOk: true,
321331
role: 'style',
322-
description: 'Sets the color of the lines bounding the marker points.'
332+
description: [
333+
'Sets the marker outline color. It accepts either a specific color',
334+
'or an array of values that are mapped to the colorscale',
335+
'relative to the max and min values of the array or relative to',
336+
'`cmin` and `cmax` if set.'
337+
].join(' ')
323338
},
324339
width: {
325340
valType: 'number',
@@ -332,8 +347,16 @@ module.exports = {
332347
valType: 'colorscale',
333348
role: 'style',
334349
description: [
335-
'Has only an effect if `marker.line.color` is set to a numerical array.',
336-
'Sets the colorscale.'
350+
'Sets the colorscale and only has an effect',
351+
'if `marker.line.color` is set to a numerical array.',
352+
'The colorscale must be an array containing',
353+
'arrays mapping a normalized value to an',
354+
'rgb, rgba, hex, hsl, hsv, or named color string.',
355+
'At minimum, a mapping for the lowest (0) and highest (1)',
356+
'values are required. For example,',
357+
'`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.',
358+
'To control the bounds of the colorscale in color space,',
359+
'use `marker.line.cmin` and `marker.line.cmax`.'
337360
].join(' ')
338361
},
339362
cauto: {
@@ -352,7 +375,9 @@ module.exports = {
352375
role: 'info',
353376
description: [
354377
'Has only an effect if `marker.line.color` is set to a numerical array.',
355-
'Sets the upper bound of the color domain.'
378+
'Sets the upper bound of the color domain.',
379+
'Value should be associated to the `marker.line.color` array index,',
380+
'and if set, `marker.line.cmin` must be set as well.'
356381
].join(' ')
357382
},
358383
cmin: {
@@ -361,7 +386,9 @@ module.exports = {
361386
role: 'info',
362387
description: [
363388
'Has only an effect if `marker.line.color` is set to a numerical array.',
364-
'Sets the lower bound of the color domain.'
389+
'Sets the lower bound of the color domain.',
390+
'Value should be associated to the `marker.line.color` array index,',
391+
'and if set, `marker.line.cmax` must be set as well.'
365392
].join(' ')
366393
},
367394
autocolorscale: {

0 commit comments

Comments
 (0)