From 074a5f8edbae08b00eeb75363be3c5bbb453774e Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:36:43 -0400 Subject: [PATCH 1/4] drop deprecated attribute 'gl3d.cameraposition' (use 'gl3d.camera' instead) --- src/plot_api/helpers.js | 23 ---------------------- src/plots/gl3d/layout/layout_attributes.js | 8 -------- 2 files changed, 31 deletions(-) diff --git a/src/plot_api/helpers.js b/src/plot_api/helpers.js index f30b9539fd3..82a11e0b61d 100644 --- a/src/plot_api/helpers.js +++ b/src/plot_api/helpers.js @@ -108,29 +108,6 @@ exports.cleanLayout = function(layout) { var scene = layout[key]; - // clean old Camera coords - var cameraposition = scene.cameraposition; - - if(Array.isArray(cameraposition) && cameraposition[0].length === 4) { - var rotation = cameraposition[0]; - var center = cameraposition[1]; - var radius = cameraposition[2]; - var mat = m4FromQuat([], rotation); - var eye = []; - - for(j = 0; j < 3; ++j) { - eye[j] = center[j] + radius * mat[2 + 4 * j]; - } - - scene.camera = { - eye: {x: eye[0], y: eye[1], z: eye[2]}, - center: {x: center[0], y: center[1], z: center[2]}, - up: {x: 0, y: 0, z: 1} // we just ignore calculating camera z up in this case - }; - - delete scene.cameraposition; - } - // clean axis titles cleanTitle(scene.xaxis); cleanTitle(scene.yaxis); diff --git a/src/plots/gl3d/layout/layout_attributes.js b/src/plots/gl3d/layout/layout_attributes.js index b5b6630693d..3666d33e741 100644 --- a/src/plots/gl3d/layout/layout_attributes.js +++ b/src/plots/gl3d/layout/layout_attributes.js @@ -159,12 +159,4 @@ module.exports = { ].join(' ') }, editType: 'plot', - - _deprecated: { - cameraposition: { - valType: 'info_array', - editType: 'camera', - description: 'Obsolete. Use `camera` instead.' - } - } }; From 82eb4d2b5e9f2402e80be179a2982e364f1f9c80 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:36:58 -0400 Subject: [PATCH 2/4] update mocks --- test/image/mocks/gl3d_ibm-plot.json | 25 ++++++++++++++------- test/image/mocks/gl3d_opacity-surface.json | 25 ++++++++++++++------- test/image/mocks/gl3d_surface-lighting.json | 25 ++++++++++++++------- 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/test/image/mocks/gl3d_ibm-plot.json b/test/image/mocks/gl3d_ibm-plot.json index 8c769a162fc..4e4b4a37dd2 100644 --- a/test/image/mocks/gl3d_ibm-plot.json +++ b/test/image/mocks/gl3d_ibm-plot.json @@ -175,14 +175,23 @@ "zerolinecolor": "rgb(255, 255, 255)", "zerolinewidth": 0.7000000000000001 }, - "cameraposition": [ - [ - 0.29286395317284275, 0.5148424663837641, 0.6900510261325995, - -0.4159297068895228 - ], - [0.0634642139736937, 0.08533175793925227, -0.12431759394236179], - 2.0737597910908456 - ] + "camera": { + "eye": { + "x": 1.7897835835805567, + "y": 1.0535982168424982, + "z": 0.4943593571623967 + }, + "center": { + "x": 0.0634642139736937, + "y": 0.08533175793925227, + "z": -0.12431759394236179 + }, + "up": { + "x": 0, + "y": 0, + "z": 1 + } + } } } } diff --git a/test/image/mocks/gl3d_opacity-surface.json b/test/image/mocks/gl3d_opacity-surface.json index d3477efd059..e28efcd4cbd 100644 --- a/test/image/mocks/gl3d_opacity-surface.json +++ b/test/image/mocks/gl3d_opacity-surface.json @@ -1540,14 +1540,23 @@ "range": [1, 2], "gridcolor": "rgb(255, 255, 255)" }, - "cameraposition": [ - [ - -0.8326258918343652, -0.31013201281074904, -0.14770225080852764, - 0.4344379172943774 - ], - [-0.09586835824120499, -0.07248137902934104, 0.013764797418843955], - 1.9263438581634802 - ], + "camera": { + "eye": { + "x": 0.8970225259545955, + "y": -1.289611163151606, + "z": -1.101386959324396 + }, + "center": { + "x": -0.09586835824120499, + "y": -0.07248137902934104, + "z": 0.013764797418843955 + }, + "up": { + "x": 0, + "y": 0, + "z":1 + } + }, "bgcolor": "rgb(67, 67, 67)", "zaxis": { "showticklabels": false, diff --git a/test/image/mocks/gl3d_surface-lighting.json b/test/image/mocks/gl3d_surface-lighting.json index 30144e43563..64ca97a2751 100644 --- a/test/image/mocks/gl3d_surface-lighting.json +++ b/test/image/mocks/gl3d_surface-lighting.json @@ -244,14 +244,23 @@ }, "showlegend": false, "scene": { - "cameraposition": [ - [ - -0.4605922047730424, 0.09969805401182547, 0.46756921524156575, - -0.7478597113676797 - ], - [0, 0, 0], - 2.165063509461097 - ], + "camera": { + "eye": { + "x": -0.6096757261087671, + "y": 1.6934005016751204, + "z": 1.2034077654395448 + }, + "center": { + "x":0, + "y":0, + "z":0 + }, + "up": { + "x":0, + "y":0, + "z":1 + } + }, "xaxis": { "showbackground": true, "type": "linear", From 62ab0f422f454ad2925dec1a83ec054239d5d7a5 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:40:04 -0400 Subject: [PATCH 3/4] add draftlog --- draftlogs/7217_remove.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/7217_remove.md diff --git a/draftlogs/7217_remove.md b/draftlogs/7217_remove.md new file mode 100644 index 00000000000..c018d586577 --- /dev/null +++ b/draftlogs/7217_remove.md @@ -0,0 +1 @@ +Drop support for deprecated attribute `gl3d.cameraposition` (use `gl3d.camera` instead) [[#7217](https://github.com/plotly/plotly.js/pull/7217)] \ No newline at end of file From 312e5205c02f001a2360ffedd426c90c6cb34f00 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:41:24 -0400 Subject: [PATCH 4/4] update plot-schema --- test/plot-schema.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/plot-schema.json b/test/plot-schema.json index b2f43d0245d..c3a0c48ffd7 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -6698,13 +6698,6 @@ "_arrayAttrRegexps": [ {} ], - "_deprecated": { - "cameraposition": { - "description": "Obsolete. Use `camera` instead.", - "editType": "camera", - "valType": "info_array" - } - }, "_isSubplotObj": true, "annotations": { "items": {