From ee66bb347d65eab65745b954b61a8dcea8d976fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Tusz?= Date: Fri, 15 Jan 2016 17:46:19 -0500 Subject: [PATCH 1/2] update descriptions for colorscale --- src/components/colorscale/attributes.js | 8 +++++++- src/traces/scatter/attributes.js | 5 ++++- tasks/util/compress_attributes.js | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/colorscale/attributes.js b/src/components/colorscale/attributes.js index 9b261728bd0..d51a763413b 100644 --- a/src/components/colorscale/attributes.js +++ b/src/components/colorscale/attributes.js @@ -34,7 +34,13 @@ 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 color. 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)\']]`' + ].join(' ') }, autocolorscale: { valType: 'boolean', diff --git a/src/traces/scatter/attributes.js b/src/traces/scatter/attributes.js index 75f8c8d7c95..42068d5cd43 100644 --- a/src/traces/scatter/attributes.js +++ b/src/traces/scatter/attributes.js @@ -247,7 +247,10 @@ module.exports = { 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 color. 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)\']]`' ].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 += '|'; }); From 00d85590f2a7207ef3212ce7ed34f62556e6f24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Tusz?= Date: Mon, 18 Jan 2016 09:38:23 -0500 Subject: [PATCH 2/2] Improve colorscale descriptions. --- src/components/colorscale/attributes.js | 10 +++++++--- src/traces/scatter/attributes.js | 14 +++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/colorscale/attributes.js b/src/components/colorscale/attributes.js index d51a763413b..728d6730303 100644 --- a/src/components/colorscale/attributes.js +++ b/src/components/colorscale/attributes.js @@ -37,9 +37,13 @@ module.exports = { description: [ 'Sets the colorscale.', 'The colorscale must be an array containing', - 'arrays mapping a normalized value to an rgb color. 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)\']]`' + '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: { diff --git a/src/traces/scatter/attributes.js b/src/traces/scatter/attributes.js index 42068d5cd43..2d3e8e61669 100644 --- a/src/traces/scatter/attributes.js +++ b/src/traces/scatter/attributes.js @@ -246,11 +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. The colorscale must be an array containing', - 'arrays mapping a normalized value to an rgb color. 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)\']]`' + '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: {