Skip to content

Commit 4d0b2ff

Browse files
committed
plotly#581 colorspec corrections and clarifications
1 parent e7beb41 commit 4d0b2ff

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/components/colorscale/color_attributes.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = function makeColorScaleAttributes(context) {
1919
role: 'style',
2020
description: [
2121
'Sets the ', context, ' color. It accepts either a specific color',
22-
' or an array of values that are mapped to the colorscale',
22+
' or an array of numbers that are mapped to the colorscale',
2323
' relative to the max and min values of the array or relative to',
2424
' `cmin` and `cmax` if set.'
2525
].join('')
@@ -35,14 +35,19 @@ module.exports = function makeColorScaleAttributes(context) {
3535
' values are required. For example,',
3636
' `[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.',
3737
' To control the bounds of the colorscale in color space,',
38-
' use `', context, '.cmin` and `', context, '.cmax`.'
38+
' use `', context, '.cmin` and `', context, '.cmax`.',
39+
' Alternatively, `colorscale` may be a palette name string',
40+
' such as `"Viridis"` or `"Greens"`.'
3941
].join('')
4042
}),
4143
cauto: extendDeep({}, colorScaleAttributes.zauto, {
4244
description: [
43-
'Has an effect only if `', context, '.color` is set to a numerical array.',
44-
' Determines the whether or not the color domain is computed',
45-
' automatically.'
45+
'Has an effect only if `', context, '.color` is set to a numerical array',
46+
' and `cmin`, `cmax` are set by the user. In this case,',
47+
' it controls whether the first/last colors in `colorscale` correspond to',
48+
' the lowest/highest values in `color` (`cauto: true`), or the `cmin`/`cmax`',
49+
' values (`cauto: false`).',
50+
' Defaults to `false` when `cmin`, `cmax` are set by the user.'
4651
].join('')
4752
}),
4853
cmax: extendDeep({}, colorScaleAttributes.zmax, {
@@ -64,14 +69,16 @@ module.exports = function makeColorScaleAttributes(context) {
6469
autocolorscale: extendDeep({}, colorScaleAttributes.autocolorscale, {
6570
description: [
6671
'Has an effect only if `', context, '.color` is set to a numerical array.',
67-
' Determines whether or not the colorscale is picked using',
68-
' values inside `', context, '.color`.'
72+
' Determines whether the colorscale is the default palette (`autocolorscale: true`)',
73+
' or the palette determined by `', context, '.colorscale`.'
6974
].join('')
7075
}),
7176
reversescale: extendDeep({}, colorScaleAttributes.reversescale, {
7277
description: [
7378
'Has an effect only if `', context, '.color` is set to a numerical array.',
74-
' Reverses the colorscale.'
79+
' Reverses the color mapping if true (`cmin` or lowest `color` value will',
80+
' correspond to the last color and `cmax` or highest `color` value will',
81+
' correspond to the first color).'
7582
].join('')
7683
})
7784
};

0 commit comments

Comments
 (0)