Skip to content

Commit ee66bb3

Browse files
committed
update descriptions for colorscale
1 parent 6eb479d commit ee66bb3

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/components/colorscale/attributes.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ module.exports = {
3434
colorscale: {
3535
valType: 'colorscale',
3636
role: 'style',
37-
description: 'Sets the colorscale.'
37+
description: [
38+
'Sets the colorscale.',
39+
'The colorscale must be an array containing',
40+
'arrays mapping a normalized value to an rgb color. At minimum, a',
41+
'mapping for the lowest (0) and highest (1) values are required.',
42+
'For example, `[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`'
43+
].join(' ')
3844
},
3945
autocolorscale: {
4046
valType: 'boolean',

src/traces/scatter/attributes.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ module.exports = {
247247
role: 'style',
248248
description: [
249249
'Has only an effect if `marker.color` is set to a numerical array.',
250-
'Sets the colorscale.'
250+
'Sets the colorscale. The colorscale must be an array containing',
251+
'arrays mapping a normalized value to an rgb color. At minimum, a',
252+
'mapping for the lowest (0) and highest (1) values are required.',
253+
'For example, `[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`'
251254
].join(' ')
252255
},
253256
cauto: {

tasks/util/compress_attributes.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ attributeNamesToRemove.forEach(function(attr, i) {
1515
// one line string with or without trailing comma
1616
regexStr += attr + ': \'.*\'' + ',?' + '|';
1717
// array of strings with or without trailing comma
18-
regexStr += attr + ': \\[[\\s\\S]*?\\].*' + ',?';
18+
regexStr += attr + ':.*\\n*.*\\.join\\(\\\'\\s\\\'\\)';
19+
20+
// attr:.*\n.*\.join\(\'\s\'\)
1921

2022
if(i !== attributeNamesToRemove.length-1) regexStr += '|';
2123
});

0 commit comments

Comments
 (0)