Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c63407

Browse files
authored
Merge pull request plotly#6183 from plotly/fix6182-schema-missing-spaces
Fix various missing and duplicate spaces in plot schema descriptions
2 parents 6c1c119 + 778a97a commit 8c63407

File tree

9 files changed

+421
-432
lines changed

9 files changed

+421
-432
lines changed

draftlogs/6183_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix various missing and duplicate spaces in plot schema descriptions [[#6183](https://github.com/plotly/plotly.js/pull/6183)]

src/components/colorscale/attributes.js

Lines changed: 46 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module.exports = function colorScaleAttrs(context, opts) {
7777
}
7878

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

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

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

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

144142
attrs[max] = {
@@ -147,11 +145,10 @@ module.exports = function colorScaleAttrs(context, opts) {
147145
editType: editTypeOverride || 'plot',
148146
impliedEdits: minmaxImpliedEdits,
149147
description: [
150-
'Sets the upper bound of the color domain.',
151-
effectDesc,
152-
' Value should have the same units as ', colorAttrFull,
153-
' and if set, ', minFull, ' must be set as well.'
154-
].join('')
148+
'Sets the upper bound of the color domain.' + effectDesc,
149+
'Value should have the same units as', colorAttrFull,
150+
'and if set,', minFull, 'must be set as well.'
151+
].join(' ')
155152
};
156153

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

171167
attrs.colorscale = {
@@ -174,19 +170,18 @@ module.exports = function colorScaleAttrs(context, opts) {
174170
dflt: colorscaleDflt,
175171
impliedEdits: {autocolorscale: false},
176172
description: [
177-
'Sets the colorscale.',
178-
effectDesc,
179-
' The colorscale must be an array containing',
180-
' arrays mapping a normalized value to an',
181-
' rgb, rgba, hex, hsl, hsv, or named color string.',
182-
' At minimum, a mapping for the lowest (0) and highest (1)',
183-
' values are required. For example,',
184-
' `[[0, \'rgb(0,0,255)\'], [1, \'rgb(255,0,0)\']]`.',
185-
' To control the bounds of the colorscale in color space,',
186-
' use', minmaxFull, '.',
187-
' Alternatively, `colorscale` may be a palette name string',
188-
' of the following list: ' + paletteStr + '.'
189-
].join('')
173+
'Sets the colorscale.' + effectDesc,
174+
'The colorscale must be an array containing',
175+
'arrays mapping a normalized value to an',
176+
'rgb, rgba, hex, hsl, hsv, or named color string.',
177+
'At minimum, a mapping for the lowest (0) and highest (1)',
178+
'values are required. For example,',
179+
'`[[0, \'rgb(0,0,255)\'], [1, \'rgb(255,0,0)\']]`.',
180+
'To control the bounds of the colorscale in color space,',
181+
'use', minmaxFull + '.',
182+
'Alternatively, `colorscale` may be a palette name string',
183+
'of the following list: ' + paletteStr + '.'
184+
].join(' ')
190185
};
191186

192187
attrs.autocolorscale = {
@@ -197,24 +192,22 @@ module.exports = function colorScaleAttrs(context, opts) {
197192
impliedEdits: {colorscale: undefined},
198193
description: [
199194
'Determines whether the colorscale is a default palette (`autocolorscale: true`)',
200-
' or the palette determined by ', code(contextHead + 'colorscale'), '.',
201-
effectDesc,
202-
' In case `colorscale` is unspecified or `autocolorscale` is true, the default ',
203-
' palette will be chosen according to whether numbers in the `color` array are',
204-
' all positive, all negative or mixed.'
205-
].join('')
195+
'or the palette determined by', code(contextHead + 'colorscale') + '.' + effectDesc,
196+
'In case `colorscale` is unspecified or `autocolorscale` is true, the default',
197+
'palette will be chosen according to whether numbers in the `color` array are',
198+
'all positive, all negative or mixed.'
199+
].join(' ')
206200
};
207201

208202
attrs.reversescale = {
209203
valType: 'boolean',
210204
dflt: false,
211205
editType: 'plot',
212206
description: [
213-
'Reverses the color mapping if true.',
214-
effectDesc,
215-
' If true, ', minFull, ' will correspond to the last color',
216-
' in the array and ', maxFull, ' will correspond to the first color.'
217-
].join('')
207+
'Reverses the color mapping if true.' + effectDesc,
208+
'If true,', minFull, 'will correspond to the last color',
209+
'in the array and', maxFull, 'will correspond to the first color.'
210+
].join(' ')
218211
};
219212

220213
if(!noScale) {
@@ -223,9 +216,8 @@ module.exports = function colorScaleAttrs(context, opts) {
223216
dflt: showScaleDflt,
224217
editType: 'calc',
225218
description: [
226-
'Determines whether or not a colorbar is displayed for this trace.',
227-
effectDesc
228-
].join('')
219+
'Determines whether or not a colorbar is displayed for this trace.' + effectDesc
220+
].join(' ')
229221
};
230222

231223
attrs.colorbar = colorbarAttrs;

src/plots/geo/geo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ proto.fetchTopojson = function() {
119119
if(err.status === 404) {
120120
return reject(new Error([
121121
'plotly.js could not find topojson file at',
122-
topojsonPath, '.',
122+
topojsonPath + '.',
123123
'Make sure the *topojsonURL* plot config option',
124124
'is set properly.'
125125
].join(' ')));

src/traces/pointcloud/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module.exports = {
5353
'Sets the marker fill color. It accepts a specific color.',
5454
'If the color is not fully opaque and there are hundreds of thousands',
5555
'of points, it may cause slower zooming and panning.'
56-
].join('')
56+
].join(' ')
5757
},
5858
opacity: {
5959
valType: 'number',

src/traces/sankey/attributes.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,13 @@ var attrs = module.exports = overrideAll({
249249
valType: 'number',
250250
editType: 'calc',
251251
dflt: 1,
252-
description: [
253-
'Sets the upper bound of the color domain.'
254-
].join('')
252+
description: 'Sets the upper bound of the color domain.'
255253
},
256254
cmin: {
257255
valType: 'number',
258256
editType: 'calc',
259257
dflt: 0,
260-
description: [
261-
'Sets the lower bound of the color domain.'
262-
].join('')
258+
description: 'Sets the lower bound of the color domain.'
263259
},
264260
colorscale: extendFlat(colorAttributes().colorscale, {dflt: [[0, 'white'], [1, 'black']]})
265261
}),

src/traces/surface/attributes.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,16 +276,16 @@ colorScaleAttrs('', {
276276
editType: 'calc',
277277
description: [
278278
'Sets the opacityscale.',
279-
' The opacityscale must be an array containing',
280-
' arrays mapping a normalized value to an opacity value.',
281-
' At minimum, a mapping for the lowest (0) and highest (1)',
282-
' values are required. For example,',
283-
' `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have',
284-
' higher opacity values and those in the middle would be more transparent',
285-
' Alternatively, `opacityscale` may be a palette name string',
286-
' of the following list: \'min\', \'max\', \'extremes\' and \'uniform\'.',
287-
' The default is \'uniform\'.'
288-
].join('')
279+
'The opacityscale must be an array containing',
280+
'arrays mapping a normalized value to an opacity value.',
281+
'At minimum, a mapping for the lowest (0) and highest (1)',
282+
'values are required. For example,',
283+
'`[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have',
284+
'higher opacity values and those in the middle would be more transparent',
285+
'Alternatively, `opacityscale` may be a palette name string',
286+
'of the following list: \'min\', \'max\', \'extremes\' and \'uniform\'.',
287+
'The default is \'uniform\'.'
288+
].join(' ')
289289
},
290290

291291
_deprecated: {

src/traces/table/attributes.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ var attrs = module.exports = overrideAll({
8989
dflt: 'white',
9090
description: [
9191
'Sets the cell fill color. It accepts either a specific color',
92-
' or an array of colors or a 2D array of colors.'
93-
].join('')
92+
'or an array of colors or a 2D array of colors.'
93+
].join(' ')
9494
}
9595
},
9696

@@ -157,8 +157,8 @@ var attrs = module.exports = overrideAll({
157157
dflt: 'white',
158158
description: [
159159
'Sets the cell fill color. It accepts either a specific color',
160-
' or an array of colors or a 2D array of colors.'
161-
].join('')
160+
'or an array of colors or a 2D array of colors.'
161+
].join(' ')
162162
}
163163
},
164164

src/traces/violin/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module.exports = {
6464
'*width* means each violin has the same (max) width',
6565
'*count* means the violins are scaled by the number of sample points making',
6666
'up each violin.'
67-
].join('')
67+
].join(' ')
6868
},
6969

7070
spanmode: {

0 commit comments

Comments
 (0)