Skip to content
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

Fix various missing and duplicate spaces in plot schema descriptions #6183

Merged
merged 9 commits into from
May 9, 2022
1 change: 1 addition & 0 deletions draftlogs/6183_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix various missing and duplicate spaces in plot schema descriptions [[#6183](https://github.com/plotly/plotly.js/pull/6183)]
100 changes: 46 additions & 54 deletions src/components/colorscale/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = function colorScaleAttrs(context, opts) {
}

var effectDesc = onlyIfNumerical ?
' Has an effect only if ' + colorAttrFull + 'is set to a numerical array.' :
' Has an effect only if ' + colorAttrFull + ' is set to a numerical array.' :
'';

var auto = cLetter + 'auto';
Expand All @@ -102,11 +102,11 @@ module.exports = function colorScaleAttrs(context, opts) {
editType: editTypeOverride || 'style',
description: [
'Sets the', context, 'color.',
' It accepts either a specific color',
' or an array of numbers that are mapped to the colorscale',
' relative to the max and min values of the array or relative to',
' ' + minmaxFull + ' if set.'
].join('')
'It accepts either a specific color',
'or an array of numbers that are mapped to the colorscale',
'relative to the max and min values of the array or relative to',
minmaxFull, 'if set.'
].join(' ')
};

if(opts.anim) {
Expand All @@ -121,11 +121,10 @@ module.exports = function colorScaleAttrs(context, opts) {
impliedEdits: autoImpliedEdits,
description: [
'Determines whether or not the color domain is computed',
' with respect to the input data (here ' + colorAttrFull + ') or the bounds set in',
' ', minmaxFull,
' ', effectDesc,
' Defaults to `false` when ', minmaxFull, ' are set by the user.'
].join('')
'with respect to the input data (here ' + colorAttrFull + ') or the bounds set in',
minmaxFull + effectDesc,
'Defaults to `false` when', minmaxFull, 'are set by the user.'
].join(' ')
};

attrs[min] = {
Expand All @@ -134,11 +133,10 @@ module.exports = function colorScaleAttrs(context, opts) {
editType: editTypeOverride || 'plot',
impliedEdits: minmaxImpliedEdits,
description: [
'Sets the lower bound of the color domain.',
effectDesc,
' Value should have the same units as ', colorAttrFull,
' and if set, ', maxFull, ' must be set as well.'
].join('')
'Sets the lower bound of the color domain.' + effectDesc,
'Value should have the same units as', colorAttrFull,
'and if set,', maxFull, 'must be set as well.'
].join(' ')
};

attrs[max] = {
Expand All @@ -147,11 +145,10 @@ module.exports = function colorScaleAttrs(context, opts) {
editType: editTypeOverride || 'plot',
impliedEdits: minmaxImpliedEdits,
description: [
'Sets the upper bound of the color domain.',
effectDesc,
' Value should have the same units as ', colorAttrFull,
' and if set, ', minFull, ' must be set as well.'
].join('')
'Sets the upper bound of the color domain.' + effectDesc,
'Value should have the same units as', colorAttrFull,
'and if set,', minFull, 'must be set as well.'
].join(' ')
};

attrs[mid] = {
Expand All @@ -160,12 +157,11 @@ module.exports = function colorScaleAttrs(context, opts) {
editType: 'calc',
impliedEdits: autoImpliedEdits,
description: [
'Sets the mid-point of the color domain by scaling ', minFull,
' and/or ', maxFull, ' to be equidistant to this point.',
effectDesc,
' Value should have the same units as ', colorAttrFull, '. ',
'Has no effect when ', autoFull, ' is `false`.'
].join('')
'Sets the mid-point of the color domain by scaling', minFull,
'and/or', maxFull, 'to be equidistant to this point.' + effectDesc,
'Value should have the same units as', colorAttrFull + '.',
'Has no effect when', autoFull, 'is `false`.'
].join(' ')
};

attrs.colorscale = {
Expand All @@ -174,19 +170,18 @@ module.exports = function colorScaleAttrs(context, opts) {
dflt: colorscaleDflt,
impliedEdits: {autocolorscale: false},
description: [
'Sets the colorscale.',
effectDesc,
' 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', minmaxFull, '.',
' Alternatively, `colorscale` may be a palette name string',
' of the following list: ' + paletteStr + '.'
].join('')
'Sets the colorscale.' + effectDesc,
'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', minmaxFull + '.',
'Alternatively, `colorscale` may be a palette name string',
'of the following list: ' + paletteStr + '.'
].join(' ')
};

attrs.autocolorscale = {
Expand All @@ -197,24 +192,22 @@ module.exports = function colorScaleAttrs(context, opts) {
impliedEdits: {colorscale: undefined},
description: [
'Determines whether the colorscale is a default palette (`autocolorscale: true`)',
' or the palette determined by ', code(contextHead + 'colorscale'), '.',
effectDesc,
' In case `colorscale` is unspecified or `autocolorscale` is true, the default ',
' palette will be chosen according to whether numbers in the `color` array are',
' all positive, all negative or mixed.'
].join('')
'or the palette determined by', code(contextHead + 'colorscale') + '.' + effectDesc,
'In case `colorscale` is unspecified or `autocolorscale` is true, the default',
'palette will be chosen according to whether numbers in the `color` array are',
'all positive, all negative or mixed.'
].join(' ')
};

attrs.reversescale = {
valType: 'boolean',
dflt: false,
editType: 'plot',
description: [
'Reverses the color mapping if true.',
effectDesc,
' If true, ', minFull, ' will correspond to the last color',
' in the array and ', maxFull, ' will correspond to the first color.'
].join('')
'Reverses the color mapping if true.' + effectDesc,
'If true,', minFull, 'will correspond to the last color',
'in the array and', maxFull, 'will correspond to the first color.'
].join(' ')
};

if(!noScale) {
Expand All @@ -223,9 +216,8 @@ module.exports = function colorScaleAttrs(context, opts) {
dflt: showScaleDflt,
editType: 'calc',
description: [
'Determines whether or not a colorbar is displayed for this trace.',
effectDesc
].join('')
'Determines whether or not a colorbar is displayed for this trace.' + effectDesc
].join(' ')
};

attrs.colorbar = colorbarAttrs;
Expand Down
2 changes: 1 addition & 1 deletion src/plots/geo/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ proto.fetchTopojson = function() {
if(err.status === 404) {
return reject(new Error([
'plotly.js could not find topojson file at',
topojsonPath, '.',
topojsonPath + '.',
'Make sure the *topojsonURL* plot config option',
'is set properly.'
].join(' ')));
Expand Down
2 changes: 1 addition & 1 deletion src/traces/pointcloud/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
'Sets the marker fill color. It accepts a specific color.',
'If the color is not fully opaque and there are hundreds of thousands',
'of points, it may cause slower zooming and panning.'
].join('')
].join(' ')
},
opacity: {
valType: 'number',
Expand Down
8 changes: 2 additions & 6 deletions src/traces/sankey/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,13 @@ var attrs = module.exports = overrideAll({
valType: 'number',
editType: 'calc',
dflt: 1,
description: [
'Sets the upper bound of the color domain.'
].join('')
description: 'Sets the upper bound of the color domain.'
},
cmin: {
valType: 'number',
editType: 'calc',
dflt: 0,
description: [
'Sets the lower bound of the color domain.'
].join('')
description: 'Sets the lower bound of the color domain.'
},
colorscale: extendFlat(colorAttributes().colorscale, {dflt: [[0, 'white'], [1, 'black']]})
}),
Expand Down
20 changes: 10 additions & 10 deletions src/traces/surface/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,16 @@ colorScaleAttrs('', {
editType: 'calc',
description: [
'Sets the opacityscale.',
' The opacityscale must be an array containing',
' arrays mapping a normalized value to an opacity value.',
' At minimum, a mapping for the lowest (0) and highest (1)',
' values are required. For example,',
' `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have',
' higher opacity values and those in the middle would be more transparent',
' Alternatively, `opacityscale` may be a palette name string',
' of the following list: \'min\', \'max\', \'extremes\' and \'uniform\'.',
' The default is \'uniform\'.'
].join('')
'The opacityscale must be an array containing',
'arrays mapping a normalized value to an opacity value.',
'At minimum, a mapping for the lowest (0) and highest (1)',
'values are required. For example,',
'`[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have',
'higher opacity values and those in the middle would be more transparent',
'Alternatively, `opacityscale` may be a palette name string',
'of the following list: \'min\', \'max\', \'extremes\' and \'uniform\'.',
'The default is \'uniform\'.'
].join(' ')
},

_deprecated: {
Expand Down
8 changes: 4 additions & 4 deletions src/traces/table/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ var attrs = module.exports = overrideAll({
dflt: 'white',
description: [
'Sets the cell fill color. It accepts either a specific color',
' or an array of colors or a 2D array of colors.'
].join('')
'or an array of colors or a 2D array of colors.'
].join(' ')
}
},

Expand Down Expand Up @@ -157,8 +157,8 @@ var attrs = module.exports = overrideAll({
dflt: 'white',
description: [
'Sets the cell fill color. It accepts either a specific color',
' or an array of colors or a 2D array of colors.'
].join('')
'or an array of colors or a 2D array of colors.'
].join(' ')
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/traces/violin/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.exports = {
'*width* means each violin has the same (max) width',
'*count* means the violins are scaled by the number of sample points making',
'up each violin.'
].join('')
].join(' ')
},

spanmode: {
Expand Down