Skip to content

Commit a161fa7

Browse files
committed
#581 colorspec corrections and clarifications
1 parent 6bfcb78 commit a161fa7

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/components/colorscale/color_attributes.js

+12-9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
var colorScaleAttributes = require('./attributes');
1212
var extendDeep = require('../../lib/extend').extendDeep;
13+
var palettes = require('./scales.js');
1314

1415
module.exports = function makeColorScaleAttributes(context) {
1516
return {
@@ -37,15 +38,15 @@ module.exports = function makeColorScaleAttributes(context) {
3738
' To control the bounds of the colorscale in color space,',
3839
' use `', context, '.cmin` and `', context, '.cmax`.',
3940
' Alternatively, `colorscale` may be a palette name string',
40-
' such as `"Viridis"` or `"Greens"`.'
41-
].join('')
41+
' of the following list: '
42+
].join('').concat(Object.keys(palettes).join(', '))
4243
}),
4344
cauto: extendDeep({}, colorScaleAttributes.zauto, {
4445
description: [
4546
'Has an effect only if `', context, '.color` is set to a numerical array',
4647
' 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`',
48+
' it controls whether the range of colors in `colorscale` is mapped to',
49+
' the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax`',
4950
' values (`cauto: false`).',
5051
' Defaults to `false` when `cmin`, `cmax` are set by the user.'
5152
].join('')
@@ -69,16 +70,18 @@ module.exports = function makeColorScaleAttributes(context) {
6970
autocolorscale: extendDeep({}, colorScaleAttributes.autocolorscale, {
7071
description: [
7172
'Has an effect only if `', context, '.color` is set to a numerical array.',
72-
' Determines whether the colorscale is the default palette (`autocolorscale: true`)',
73-
' or the palette determined by `', context, '.colorscale`.'
73+
' Determines whether the colorscale is a default palette (`autocolorscale: true`)',
74+
' or the palette determined by `', context, '.colorscale`.',
75+
' In case `colorscale` is unspecified or `autocolorscale` is true, the default ',
76+
' palette will be chosen according to whether numbers in the `color` array are',
77+
' all positive, all negative or mixed.'
7478
].join('')
7579
}),
7680
reversescale: extendDeep({}, colorScaleAttributes.reversescale, {
7781
description: [
7882
'Has an effect only if `', context, '.color` is set to a numerical array.',
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).'
83+
' Reverses the color mapping if true (`cmin` will correspond to the last color',
84+
' in the array and `cmax` will correspond to the first color).'
8285
].join('')
8386
})
8487
};

0 commit comments

Comments
 (0)