Skip to content

Commit 4c56fa8

Browse files
committed
Changed scatter attribute fillgradient.orientation to fillgradient.type for greater consistency with marker.gradient.type
1 parent d09b343 commit 4c56fa8

File tree

6 files changed

+25
-26
lines changed

6 files changed

+25
-26
lines changed

src/components/drawing/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ function setFillStyle(sel, trace, gd, forLegend) {
193193
undefined, markerPattern.fillmode,
194194
patternBGColor, patternFGColor, patternFGOpacity
195195
);
196-
} else if(fillgradient && fillgradient.orientation !== 'none') {
197-
var direction = fillgradient.orientation;
196+
} else if(fillgradient && fillgradient.type !== 'none') {
197+
var direction = fillgradient.type;
198198
var gradientID = 'scatterfill-' + trace.uid;
199199
if(forLegend) {
200200
gradientID = 'legendfill-' + trace.uid;

src/traces/scatter/attributes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,13 @@ module.exports = {
404404
].join(' ')
405405
},
406406
fillgradient: extendFlat({
407-
orientation: {
407+
type: {
408408
valType: 'enumerated',
409409
values: ['radial', 'horizontal', 'vertical', 'none'],
410410
dflt: 'none',
411-
editType: 'style',
411+
editType: 'calc',
412412
description: [
413-
'Sets the orientation of the color gradient.',
413+
'Sets the type/orientation of the color gradient for the fill.',
414414
'Defaults to *none*.'
415415
].join(' ')
416416
},

src/traces/scatter/fillcolor_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe
3333
// to specifiy fillcolor after all other more specific candidates
3434
// are considered, but before the global default color.
3535
// fillcolor affects the background color of the hoverlabel in this case.
36-
var gradientOrientation = coerce('fillgradient.orientation');
36+
var gradientOrientation = coerce('fillgradient.type');
3737
if(gradientOrientation !== 'none') {
3838
coerce('fillgradient.start');
3939
coerce('fillgradient.stop');

test/image/mocks/zz-scatter_fill_gradient_tonext.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"fill": "tonext",
99
"hoveron": "points+fills",
1010
"fillgradient": {
11-
"orientation": "horizontal",
11+
"type": "horizontal",
1212
"colorscale": [
1313
[0.0, "rgba(0, 255, 0, 1)"],
1414
[0.5, "rgba(0, 255, 0, 0)"],
@@ -24,7 +24,7 @@
2424
"fill": "tonext",
2525
"hoveron": "fills+points",
2626
"fillgradient": {
27-
"orientation": "radial",
27+
"type": "radial",
2828
"colorscale": [
2929
[0.0, "rgba(255, 255, 0, 0.0)"],
3030
[0.8, "rgba(255, 0, 0, 0.3)"],

test/image/mocks/zz-scatter_fill_gradient_tonexty_toself.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"fill": "tonexty",
99
"fillcolor": "rgba(0, 255, 0, .5)",
1010
"fillgradient": {
11-
"orientation": "horizontal",
11+
"type": "horizontal",
1212
"colorscale": [
1313
[0.0, "rgba(0, 255, 0, 1)"],
1414
[0.5, "rgba(0, 255, 0, 0)"],
@@ -28,7 +28,7 @@
2828
"fill": "tonexty",
2929
"hoveron": "fills+points",
3030
"fillgradient": {
31-
"orientation": "horizontal",
31+
"type": "horizontal",
3232
"colorscale": [
3333
[0.0, "rgba(255, 255, 0, 1.0)"],
3434
[0.6, "rgba(255, 255, 0, 1.0)"],
@@ -44,7 +44,7 @@
4444
"mode": "none",
4545
"fill": "toself",
4646
"fillgradient": {
47-
"orientation": "vertical",
47+
"type": "vertical",
4848
"colorscale": [
4949
[0.0, "rgba(255, 0, 0, 0.8)"],
5050
[1.0, "rgba(0, 0, 255, 0.9)"]
@@ -60,7 +60,7 @@
6060
"mode": "none",
6161
"fill": "toself",
6262
"fillgradient": {
63-
"orientation": "vertical",
63+
"type": "vertical",
6464
"colorscale": [
6565
[0.0, "rgba(255, 0, 0, 0.8)"],
6666
[1.0, "rgba(0, 0, 255, 0.9)"]

test/plot-schema.json

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45041,25 +45041,12 @@
4504145041
},
4504245042
"fillgradient": {
4504345043
"colorscale": {
45044-
"anim": true,
4504545044
"description": "Sets the fill gradient colors as a color scale. The color scale is interpreted as a gradient applied in the direction specified by *orientation*, from the lowest to the highest value of the scatter plot along that axis, or from the center to the most distant point from it, if orientation is *radial*.",
4504645045
"editType": "style",
4504745046
"valType": "colorscale"
4504845047
},
4504945048
"description": "Sets a fill gradient. If not specified, the fillcolor is used instead.",
45050-
"editType": "style",
45051-
"orientation": {
45052-
"description": "Sets the orientation of the color gradient. Defaults to *none*.",
45053-
"dflt": "none",
45054-
"editType": "style",
45055-
"valType": "enumerated",
45056-
"values": [
45057-
"radial",
45058-
"horizontal",
45059-
"vertical",
45060-
"none"
45061-
]
45062-
},
45049+
"editType": "calc",
4506345050
"role": "object",
4506445051
"start": {
4506545052
"description": "Sets the gradient start value. It is given as the absolute position on the axis determined by the orientiation. E.g., if orientation is *horizontal*, the gradient will be horizontal and start from the x-position given by start. If omitted, the gradient starts at the lowest value of the trace along the respective axis. Ignored if orientation is *radial*.",
@@ -45070,6 +45057,18 @@
4507045057
"description": "Sets the gradient end value. It is given as the absolute position on the axis determined by the orientiation. E.g., if orientation is *horizontal*, the gradient will be horizontal and end at the x-position given by end. If omitted, the gradient ends at the highest value of the trace along the respective axis. Ignored if orientation is *radial*.",
4507145058
"editType": "calc",
4507245059
"valType": "number"
45060+
},
45061+
"type": {
45062+
"description": "Sets the type/orientation of the color gradient for the fill. Defaults to *none*.",
45063+
"dflt": "none",
45064+
"editType": "calc",
45065+
"valType": "enumerated",
45066+
"values": [
45067+
"radial",
45068+
"horizontal",
45069+
"vertical",
45070+
"none"
45071+
]
4507345072
}
4507445073
},
4507545074
"fillpattern": {

0 commit comments

Comments
 (0)