diff --git a/src/components/colorscale/attributes.js b/src/components/colorscale/attributes.js index 9b261728bd0..728d6730303 100644 --- a/src/components/colorscale/attributes.js +++ b/src/components/colorscale/attributes.js @@ -34,7 +34,17 @@ module.exports = { colorscale: { valType: 'colorscale', role: 'style', - description: 'Sets the colorscale.' + description: [ + 'Sets the colorscale.', + 'The colorscale must be an array containing', + 'arrays mapping a normalized value to an', + 'rgb, rgba, hex, hsl, hsv, or named color string.', + 'At minimum, a mapping for the lowest (0) and highest (1)', + 'values are required. For example,', + '`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.', + 'To control the bounds of the colorscale in z space,', + 'use zmin and zmax' + ].join(' ') }, autocolorscale: { valType: 'boolean', diff --git a/src/traces/scatter/attributes.js b/src/traces/scatter/attributes.js index 75f8c8d7c95..2d3e8e61669 100644 --- a/src/traces/scatter/attributes.js +++ b/src/traces/scatter/attributes.js @@ -246,8 +246,15 @@ module.exports = { valType: 'colorscale', role: 'style', description: [ - 'Has only an effect if `marker.color` is set to a numerical array.', - 'Sets the colorscale.' + 'Sets the colorscale.', + 'The colorscale must be an array containing', + 'arrays mapping a normalized value to an', + 'rgb, rgba, hex, hsl, hsv, or named color string.', + 'At minimum, a mapping for the lowest (0) and highest (1)', + 'values are required. For example,', + '`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.', + 'To control the bounds of the colorscale in color space,', + 'use cmin and cmax' ].join(' ') }, cauto: { diff --git a/tasks/util/compress_attributes.js b/tasks/util/compress_attributes.js index f5316a1e0fa..488c6a9594a 100644 --- a/tasks/util/compress_attributes.js +++ b/tasks/util/compress_attributes.js @@ -15,7 +15,9 @@ attributeNamesToRemove.forEach(function(attr, i) { // one line string with or without trailing comma regexStr += attr + ': \'.*\'' + ',?' + '|'; // array of strings with or without trailing comma - regexStr += attr + ': \\[[\\s\\S]*?\\].*' + ',?'; + regexStr += attr + ':.*\\n*.*\\.join\\(\\\'\\s\\\'\\)'; + + // attr:.*\n.*\.join\(\'\s\'\) if(i !== attributeNamesToRemove.length-1) regexStr += '|'; });