Skip to content

Commit 2be6fcc

Browse files
authored
Merge pull request #7234 from plotly/drop-zauto-zmin-zmax
Drop deprecated `zauto`, `zmin` and `zmax` from the surface trace
2 parents d010201 + 5afc63b commit 2be6fcc

File tree

7 files changed

+3
-71
lines changed

7 files changed

+3
-71
lines changed

draftlogs/7234_remove.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Drop deprecated zauto, zmin and zmax from the surface trace [[#7234](https://github.com/plotly/plotly.js/pull/7234)]

src/traces/surface/attributes.js

-12
Original file line numberDiff line numberDiff line change
@@ -288,18 +288,6 @@ colorScaleAttrs('', {
288288
].join(' ')
289289
},
290290

291-
_deprecated: {
292-
zauto: extendFlat({}, colorScaleAttrs.zauto, {
293-
description: 'Obsolete. Use `cauto` instead.'
294-
}),
295-
zmin: extendFlat({}, colorScaleAttrs.zmin, {
296-
description: 'Obsolete. Use `cmin` instead.'
297-
}),
298-
zmax: extendFlat({}, colorScaleAttrs.zmax, {
299-
description: 'Obsolete. Use `cmax` instead.'
300-
})
301-
},
302-
303291
hoverinfo: extendFlat({}, baseAttrs.hoverinfo),
304292
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}),
305293
}), 'calc', 'nested');

src/traces/surface/defaults.js

-13
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,6 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
121121
coerce(contourDim + '.size');
122122
}
123123

124-
// backward compatibility block
125-
if(!surfaceColor) {
126-
mapLegacy(traceIn, 'zmin', 'cmin');
127-
mapLegacy(traceIn, 'zmax', 'cmax');
128-
mapLegacy(traceIn, 'zauto', 'cauto');
129-
}
130-
131124
// TODO if contours.?.usecolormap are false and hidesurface is true
132125
// the colorbar shouldn't be shown by default
133126

@@ -155,12 +148,6 @@ function opacityscaleDefaults(traceIn, traceOut, layout, coerce) {
155148
}
156149
}
157150

158-
function mapLegacy(traceIn, oldAttr, newAttr) {
159-
if(oldAttr in traceIn && !(newAttr in traceIn)) {
160-
traceIn[newAttr] = traceIn[oldAttr];
161-
}
162-
}
163-
164151
module.exports = {
165152
supplyDefaults: supplyDefaults,
166153
opacityscaleDefaults: opacityscaleDefaults

tasks/test_mock.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ function notBlackListed(name) {
177177
'gl2d_text_chart_single-string',
178178
'gl2d_text_chart_styling',
179179
'gl2d_texttemplate',
180-
'gl3d_autocolorscale',
181180
'gl3d_bunny',
182181
'gl3d_bunny-hull',
183182
'gl3d_coloraxes',

test/image/mocks/gl3d_autocolorscale.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
["zero two", "one two", "two two"]
1010
],
1111
"autocolorscale": true,
12-
"zmin": 0,
13-
"zmax": "50"
12+
"cmin": 0,
13+
"cmax": "50"
1414
}
1515
],
1616
"layout": {

test/jasmine/tests/surface_test.js

-29
Original file line numberDiff line numberDiff line change
@@ -107,35 +107,6 @@ describe('Test surface', function() {
107107
expect(traceOut.colorbar).toBeDefined();
108108
});
109109

110-
it('should coerce \'c\' attributes with \'z\' if \'c\' isn\'t present', function() {
111-
traceIn = {
112-
z: [[1, 2, 3], [2, 1, 2]],
113-
zauto: false,
114-
zmin: 0,
115-
zmax: 10
116-
};
117-
118-
supplyDefaults(traceIn, traceOut, defaultColor, layout);
119-
expect(traceOut.cauto).toEqual(false);
120-
expect(traceOut.cmin).toEqual(0);
121-
expect(traceOut.cmax).toEqual(10);
122-
});
123-
124-
it('should coerce \'c\' attributes with \'c\' values regardless of `\'z\' if \'c\' is present', function() {
125-
traceIn = {
126-
z: [[1, 2, 3], [2, 1, 2]],
127-
zmin: 0,
128-
zmax: 10,
129-
cmin: -10,
130-
cmax: 20
131-
};
132-
133-
supplyDefaults(traceIn, traceOut, defaultColor, layout);
134-
expect(traceOut.cauto).toEqual(false);
135-
expect(traceOut.cmin).toEqual(-10);
136-
expect(traceOut.cmax).toEqual(20);
137-
});
138-
139110
it('should default \'c\' attributes with if \'surfacecolor\' is present', function() {
140111
traceIn = {
141112
z: [[1, 2, 3], [2, 1, 2]],

test/plot-schema.json

-14
Original file line numberDiff line numberDiff line change
@@ -88601,20 +88601,6 @@
8860188601
"surface": {
8860288602
"animatable": false,
8860388603
"attributes": {
88604-
"_deprecated": {
88605-
"zauto": {
88606-
"description": "Obsolete. Use `cauto` instead.",
88607-
"editType": "calc"
88608-
},
88609-
"zmax": {
88610-
"description": "Obsolete. Use `cmax` instead.",
88611-
"editType": "calc"
88612-
},
88613-
"zmin": {
88614-
"description": "Obsolete. Use `cmin` instead.",
88615-
"editType": "calc"
88616-
}
88617-
},
8861888604
"autocolorscale": {
8861988605
"description": "Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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.",
8862088606
"dflt": false,

0 commit comments

Comments
 (0)