From fe3578322d5046107b015f85b0c173982831559b Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Thu, 17 Oct 2024 11:03:55 -0400 Subject: [PATCH 1/6] drop deprecated zauto, zmin & zmax from surface --- src/traces/surface/attributes.js | 12 ------------ src/traces/surface/defaults.js | 13 ------------- 2 files changed, 25 deletions(-) diff --git a/src/traces/surface/attributes.js b/src/traces/surface/attributes.js index 9346ca2821f..c8f9c6e036b 100644 --- a/src/traces/surface/attributes.js +++ b/src/traces/surface/attributes.js @@ -288,18 +288,6 @@ colorScaleAttrs('', { ].join(' ') }, - _deprecated: { - zauto: extendFlat({}, colorScaleAttrs.zauto, { - description: 'Obsolete. Use `cauto` instead.' - }), - zmin: extendFlat({}, colorScaleAttrs.zmin, { - description: 'Obsolete. Use `cmin` instead.' - }), - zmax: extendFlat({}, colorScaleAttrs.zmax, { - description: 'Obsolete. Use `cmax` instead.' - }) - }, - hoverinfo: extendFlat({}, baseAttrs.hoverinfo), showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}), }), 'calc', 'nested'); diff --git a/src/traces/surface/defaults.js b/src/traces/surface/defaults.js index 3330882bf59..243d0b7ccd7 100644 --- a/src/traces/surface/defaults.js +++ b/src/traces/surface/defaults.js @@ -121,13 +121,6 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) { coerce(contourDim + '.size'); } - // backward compatibility block - if(!surfaceColor) { - mapLegacy(traceIn, 'zmin', 'cmin'); - mapLegacy(traceIn, 'zmax', 'cmax'); - mapLegacy(traceIn, 'zauto', 'cauto'); - } - // TODO if contours.?.usecolormap are false and hidesurface is true // the colorbar shouldn't be shown by default @@ -155,12 +148,6 @@ function opacityscaleDefaults(traceIn, traceOut, layout, coerce) { } } -function mapLegacy(traceIn, oldAttr, newAttr) { - if(oldAttr in traceIn && !(newAttr in traceIn)) { - traceIn[newAttr] = traceIn[oldAttr]; - } -} - module.exports = { supplyDefaults: supplyDefaults, opacityscaleDefaults: opacityscaleDefaults From cd47cbd35ec31513315df2d76a26e4a8f8a4efca Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Thu, 17 Oct 2024 11:04:36 -0400 Subject: [PATCH 2/6] update schema --- test/plot-schema.json | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/test/plot-schema.json b/test/plot-schema.json index 5ee484e7217..95993565185 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -88601,20 +88601,6 @@ "surface": { "animatable": false, "attributes": { - "_deprecated": { - "zauto": { - "description": "Obsolete. Use `cauto` instead.", - "editType": "calc" - }, - "zmax": { - "description": "Obsolete. Use `cmax` instead.", - "editType": "calc" - }, - "zmin": { - "description": "Obsolete. Use `cmin` instead.", - "editType": "calc" - } - }, "autocolorscale": { "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.", "dflt": false, From c602bb273e0e6d44f5fb9eacc67bd9d6629f0f56 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Thu, 17 Oct 2024 11:17:50 -0400 Subject: [PATCH 3/6] use non-deprecated attributes in gl3d_autocolorscale mock --- test/image/mocks/gl3d_autocolorscale.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/image/mocks/gl3d_autocolorscale.json b/test/image/mocks/gl3d_autocolorscale.json index 1e70a80c6aa..0c1f53a5a6d 100644 --- a/test/image/mocks/gl3d_autocolorscale.json +++ b/test/image/mocks/gl3d_autocolorscale.json @@ -9,8 +9,8 @@ ["zero two", "one two", "two two"] ], "autocolorscale": true, - "zmin": 0, - "zmax": "50" + "cmin": 0, + "cmax": "50" } ], "layout": { From 10f2a773dab4d288a6ba7abe9e7604503f452551 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Thu, 17 Oct 2024 11:18:26 -0400 Subject: [PATCH 4/6] gl3d_autocolorscale mock is now pass mock validation --- tasks/test_mock.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/test_mock.mjs b/tasks/test_mock.mjs index bf8a1f9939d..360e238b0c4 100644 --- a/tasks/test_mock.mjs +++ b/tasks/test_mock.mjs @@ -177,7 +177,6 @@ function notBlackListed(name) { 'gl2d_text_chart_single-string', 'gl2d_text_chart_styling', 'gl2d_texttemplate', - 'gl3d_autocolorscale', 'gl3d_bunny', 'gl3d_bunny-hull', 'gl3d_coloraxes', From d76046f53e252ca99c049daf96ad855934e42eaf Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Thu, 17 Oct 2024 11:19:40 -0400 Subject: [PATCH 5/6] remove unused jasmine tests --- test/jasmine/tests/surface_test.js | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/test/jasmine/tests/surface_test.js b/test/jasmine/tests/surface_test.js index ec86fc243ba..734e1595259 100644 --- a/test/jasmine/tests/surface_test.js +++ b/test/jasmine/tests/surface_test.js @@ -107,35 +107,6 @@ describe('Test surface', function() { expect(traceOut.colorbar).toBeDefined(); }); - it('should coerce \'c\' attributes with \'z\' if \'c\' isn\'t present', function() { - traceIn = { - z: [[1, 2, 3], [2, 1, 2]], - zauto: false, - zmin: 0, - zmax: 10 - }; - - supplyDefaults(traceIn, traceOut, defaultColor, layout); - expect(traceOut.cauto).toEqual(false); - expect(traceOut.cmin).toEqual(0); - expect(traceOut.cmax).toEqual(10); - }); - - it('should coerce \'c\' attributes with \'c\' values regardless of `\'z\' if \'c\' is present', function() { - traceIn = { - z: [[1, 2, 3], [2, 1, 2]], - zmin: 0, - zmax: 10, - cmin: -10, - cmax: 20 - }; - - supplyDefaults(traceIn, traceOut, defaultColor, layout); - expect(traceOut.cauto).toEqual(false); - expect(traceOut.cmin).toEqual(-10); - expect(traceOut.cmax).toEqual(20); - }); - it('should default \'c\' attributes with if \'surfacecolor\' is present', function() { traceIn = { z: [[1, 2, 3], [2, 1, 2]], From 5afc63b949204687a0f1b7784f9428d7df39f746 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Thu, 17 Oct 2024 11:30:43 -0400 Subject: [PATCH 6/6] PR log --- draftlogs/7234_remove.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/7234_remove.md diff --git a/draftlogs/7234_remove.md b/draftlogs/7234_remove.md new file mode 100644 index 00000000000..104557bf44c --- /dev/null +++ b/draftlogs/7234_remove.md @@ -0,0 +1 @@ + - Drop deprecated zauto, zmin and zmax from the surface trace [[#7234](https://github.com/plotly/plotly.js/pull/7234)]