Skip to content

Clarify color attribute descriptions #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 37 additions & 10 deletions src/traces/scatter/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ module.exports = {
valType: 'color',
arrayOk: true,
role: 'style',
description: 'Sets the marker color.'
description: [
'Sets the marker color. It accepts either a specific color',
'or an array of values that are mapped to the colorscale',
'relative to the max and min values of the array or relative to',
'`cmin` and `cmax` if set.'
].join(' ')
},
maxdisplayed: {
valType: 'number',
Expand Down Expand Up @@ -247,15 +252,16 @@ module.exports = {
valType: 'colorscale',
role: 'style',
description: [
'Sets the colorscale.',
'Sets the colorscale and only has an effect',
'if `marker.color` is set to a numerical array.',
'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'
'use `marker.cmin` and `marker.cmax`.'
].join(' ')
},
cauto: {
Expand All @@ -274,7 +280,9 @@ module.exports = {
role: 'info',
description: [
'Has only an effect if `marker.color` is set to a numerical array.',
'Sets the upper bound of the color domain.'
'Sets the upper bound of the color domain.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and vice versa: use w/ cmin

'Value should be associated to the `marker.color` array index,',
'and if set, `marker.cmin` must be set as well.'
].join(' ')
},
cmin: {
Expand All @@ -283,7 +291,9 @@ module.exports = {
role: 'info',
description: [
'Has only an effect if `marker.color` is set to a numerical array.',
'Sets the lower bound of the color domain.'
'Sets the lower bound of the color domain.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're making this super explicit (and using cmin AND cmax was mentioned in the issue: #331 (comment)) - I would vote to add: must be used w/ cmax here as well.

'Value should be associated to the `marker.color` array index,',
'and if set, `marker.cmax` must be set as well.'
].join(' ')
},
autocolorscale: {
Expand Down Expand Up @@ -319,7 +329,12 @@ module.exports = {
valType: 'color',
arrayOk: true,
role: 'style',
description: 'Sets the color of the lines bounding the marker points.'
description: [
'Sets the marker outline color. It accepts either a specific color',
'or an array of values that are mapped to the colorscale',
'relative to the max and min values of the array or relative to',
'`cmin` and `cmax` if set.'
].join(' ')
},
width: {
valType: 'number',
Expand All @@ -332,8 +347,16 @@ module.exports = {
valType: 'colorscale',
role: 'style',
description: [
'Has only an effect if `marker.line.color` is set to a numerical array.',
'Sets the colorscale.'
'Sets the colorscale and only has an effect',
'if `marker.line.color` is set to a numerical array.',
'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,',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

color space ⭐ 🌈 ⭐

'use `marker.line.cmin` and `marker.line.cmax`.'
].join(' ')
},
cauto: {
Expand All @@ -352,7 +375,9 @@ module.exports = {
role: 'info',
description: [
'Has only an effect if `marker.line.color` is set to a numerical array.',
'Sets the upper bound of the color domain.'
'Sets the upper bound of the color domain.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plus the w/ cmin explicitness

'Value should be associated to the `marker.line.color` array index,',
'and if set, `marker.line.cmin` must be set as well.'
].join(' ')
},
cmin: {
Expand All @@ -361,7 +386,9 @@ module.exports = {
role: 'info',
description: [
'Has only an effect if `marker.line.color` is set to a numerical array.',
'Sets the lower bound of the color domain.'
'Sets the lower bound of the color domain.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plus the w/ cmax explicitness

'Value should be associated to the `marker.line.color` array index,',
'and if set, `marker.line.cmax` must be set as well.'
].join(' ')
},
autocolorscale: {
Expand Down