Skip to content

Drop deprecated pointcloud and heatmapgl traces and gl2d subplots #7213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions draftlogs/7213_remove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Drop deprecated pointcloud and heatmapgl traces and gl2d subplots [[#7213](https://github.com/plotly/plotly.js/pull/7213)]
3 changes: 0 additions & 3 deletions lib/heatmapgl.js

This file was deleted.

2 changes: 0 additions & 2 deletions lib/index-gl2d.js
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@ Plotly.register([
// traces
require('./scattergl'),
require('./splom'),
require('./pointcloud'),
require('./heatmapgl'),
require('./parcoords'),

// transforms
2 changes: 0 additions & 2 deletions lib/index-strict.js
Original file line number Diff line number Diff line change
@@ -32,8 +32,6 @@ Plotly.register([
require('./choropleth'),
require('../src/traces/scattergl/strict'),
require('../src/traces/splom/strict'),
require('./pointcloud'),
require('./heatmapgl'),
require('../src/traces/parcoords/strict'),
require('./parcats'),
require('./scattermapbox'),
2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -32,8 +32,6 @@ Plotly.register([
require('./choropleth'),
require('./scattergl'),
require('./splom'),
require('./pointcloud'),
require('./heatmapgl'),
require('./parcoords'),
require('./parcats'),
require('./scattermapbox'),
3 changes: 0 additions & 3 deletions lib/pointcloud.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/fx/hover.js
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ exports.loneHover = function loneHover(hoverItems, opts) {
x1 += dx;
y0 += dy;
y1 += dy;
} // TODO: handle heatmapgl
}

eventData.bbox = {
x0: x0 + gLeft,
1 change: 0 additions & 1 deletion src/components/images/draw.js
Original file line number Diff line number Diff line change
@@ -229,7 +229,6 @@ module.exports = function draw(gd) {
var subplotObj = fullLayout._plots[subplot];

// filter out overlaid plots (which have their images on the main plot)
// and gl2d plots (which don't support below images, at least not yet)
if(!subplotObj.imagelayer) continue;

var imagesOnSubplot = subplotObj.imagelayer.selectAll('image')
12 changes: 0 additions & 12 deletions src/components/modebar/buttons.js
Original file line number Diff line number Diff line change
@@ -559,18 +559,6 @@ function handleGeo(gd, ev) {
}
}

modeBarButtons.hoverClosestGl2d = {
name: 'hoverClosestGl2d',
_cat: 'hoverclosest',
title: function(gd) { return _(gd, 'Toggle show closest data on hover'); },
attr: 'hovermode',
val: null,
toggle: true,
icon: Icons.tooltip_basic,
gravity: 'ne',
click: toggleHover
};

modeBarButtons.hoverClosestPie = {
name: 'hoverClosestPie',
_cat: 'hoverclosest',
11 changes: 3 additions & 8 deletions src/components/modebar/manage.js
Original file line number Diff line number Diff line change
@@ -107,7 +107,6 @@ function getButtonGroups(gd) {
var hasGeo = fullLayout._has('geo');
var hasPie = fullLayout._has('pie');
var hasFunnelarea = fullLayout._has('funnelarea');
var hasGL2D = fullLayout._has('gl2d');
var hasTernary = fullLayout._has('ternary');
var hasMapbox = fullLayout._has('mapbox');
var hasMap = fullLayout._has('map');
@@ -155,7 +154,7 @@ function getButtonGroups(gd) {
var resetGroup = [];
var dragModeGroup = [];

if((hasCartesian || hasGL2D || hasPie || hasFunnelarea || hasTernary) + hasGeo + hasGL3D + hasMapbox + hasMap + hasPolar + hasSmith > 1) {
if((hasCartesian || hasPie || hasFunnelarea || hasTernary) + hasGeo + hasGL3D + hasMapbox + hasMap + hasPolar + hasSmith > 1) {
// graphs with more than one plot types get 'union buttons'
// which reset the view or toggle hover labels across all subplots.
hoverGroup = ['toggleHover'];
@@ -175,8 +174,6 @@ function getButtonGroups(gd) {
zoomGroup = ['zoomInMap', 'zoomOutMap'];
hoverGroup = ['toggleHover'];
resetGroup = ['resetViewMap'];
} else if(hasGL2D) {
hoverGroup = ['hoverClosestGl2d'];
} else if(hasPie) {
hoverGroup = ['hoverClosestPie'];
} else if(hasSankey) {
@@ -196,14 +193,14 @@ function getButtonGroups(gd) {
hoverGroup = [];
}

if((hasCartesian || hasGL2D) && !allAxesFixed) {
if(hasCartesian && !allAxesFixed) {
zoomGroup = ['zoomIn2d', 'zoomOut2d', 'autoScale2d'];
if(resetGroup[0] !== 'resetViews') resetGroup = ['resetScale2d'];
}

if(hasGL3D) {
dragModeGroup = ['zoom3d', 'pan3d', 'orbitRotation', 'tableRotation'];
} else if(((hasCartesian || hasGL2D) && !allAxesFixed) || hasTernary) {
} else if((hasCartesian && !allAxesFixed) || hasTernary) {
dragModeGroup = ['zoom2d', 'pan2d'];
} else if(hasMapbox || hasMap || hasGeo) {
dragModeGroup = ['pan2d'];
@@ -248,14 +245,12 @@ function getButtonGroups(gd) {
enableHover('hoverClosestCartesian');
enableHover('hoverClosestGeo');
enableHover('hoverClosest3d');
enableHover('hoverClosestGl2d');
enableHover('hoverClosestPie');
} else if(b === 'v1hovermode') {
enableHover('hoverClosestCartesian');
enableHover('hoverCompareCartesian');
enableHover('hoverClosestGeo');
enableHover('hoverClosest3d');
enableHover('hoverClosestGl2d');
enableHover('hoverClosestPie');
}
} else newList.push(b);
18 changes: 8 additions & 10 deletions src/components/rangeslider/helpers.js
Original file line number Diff line number Diff line change
@@ -17,18 +17,16 @@ exports.makeData = function(fullLayout) {
var margin = fullLayout.margin;
var rangeSliderData = [];

if(!fullLayout._has('gl2d')) {
for(var i = 0; i < axes.length; i++) {
var ax = axes[i];
for(var i = 0; i < axes.length; i++) {
var ax = axes[i];

if(isVisible(ax)) {
rangeSliderData.push(ax);
if(isVisible(ax)) {
rangeSliderData.push(ax);

var opts = ax[name];
opts._id = name + ax._id;
opts._height = (fullLayout.height - margin.b - margin.t) * opts.thickness;
opts._offsetShift = Math.floor(opts.borderwidth / 2);
}
var opts = ax[name];
opts._id = name + ax._id;
opts._height = (fullLayout.height - margin.b - margin.t) * opts.thickness;
opts._offsetShift = Math.floor(opts.borderwidth / 2);
}
}

2 changes: 0 additions & 2 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
@@ -2191,8 +2191,6 @@ function _relayout(gd, aobj) {
!(vOld === 'lasso' || vOld === 'select'))
) {
flags.plot = true;
} else if(fullLayout._has('gl2d')) {
flags.plot = true;
} else if(valObject) editTypes.update(flags, valObject);
else flags.calc = true;

3 changes: 1 addition & 2 deletions src/plot_api/plot_schema.js
Original file line number Diff line number Diff line change
@@ -324,15 +324,14 @@ function layoutHeadAttr(fullLayout, head) {
_module = basePlotModules[i];
if(_module.attrRegex && _module.attrRegex.test(head)) {
// if a module defines overrides, these take precedence
// initially this is to allow gl2d different editTypes from svg cartesian
// this is to allow different editTypes from svg cartesian
if(_module.layoutAttrOverrides) return _module.layoutAttrOverrides;

// otherwise take the first attributes we find
if(!out && _module.layoutAttributes) out = _module.layoutAttributes;
}

// a module can also override the behavior of base (and component) module layout attrs
// again see gl2d for initial use case
var baseOverrides = _module.baseLayoutAttrOverrides;
if(baseOverrides && head in baseOverrides) return baseOverrides[head];
}
4 changes: 1 addition & 3 deletions src/plot_api/subroutines.js
Original file line number Diff line number Diff line change
@@ -63,9 +63,7 @@ function lsInner(gd) {
exports.drawMainTitle(gd);
ModeBar.manage(gd);

// _has('cartesian') means SVG specifically, not GL2D - but GL2D
// can still get here because it makes some of the SVG structure
// for shared features like selections.
// _has('cartesian') means SVG specifically
if(!fullLayout._has('cartesian')) {
return Plots.previousPromises(gd);
}
4 changes: 2 additions & 2 deletions src/plots/cartesian/include_components.js
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ module.exports = function makeIncludeComponents(containerArrayName) {
var xaList = subplots.xaxis;
var yaList = subplots.yaxis;
var cartesianList = subplots.cartesian;
var hasCartesianOrGL2D = layoutOut._has('cartesian') || layoutOut._has('gl2d');
var hasCartesian = layoutOut._has('cartesian');

for(var i = 0; i < array.length; i++) {
var itemi = array[i];
@@ -40,7 +40,7 @@ module.exports = function makeIncludeComponents(containerArrayName) {
var hasXref = idRegex.x.test(xref);
var hasYref = idRegex.y.test(yref);
if(hasXref || hasYref) {
if(!hasCartesianOrGL2D) Lib.pushUnique(layoutOut._basePlotModules, Cartesian);
if(!hasCartesian) Lib.pushUnique(layoutOut._basePlotModules, Cartesian);

var newAxis = false;
if(hasXref && xaList.indexOf(xref) === -1) {
2 changes: 1 addition & 1 deletion src/plots/cartesian/index.js
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ exports.finalizeSubplots = function(layoutIn, layoutOut) {
var xList = subplots.xaxis;
var yList = subplots.yaxis;
var spSVG = subplots.cartesian;
var spAll = spSVG.concat(subplots.gl2d || []);
var spAll = spSVG;
var allX = {};
var allY = {};
var i, xi, yi;
2 changes: 1 addition & 1 deletion src/plots/cartesian/layout_defaults.js
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
// look for axes in the data
for(i = 0; i < fullData.length; i++) {
var trace = fullData[i];
if(!traceIs(trace, 'cartesian') && !traceIs(trace, 'gl2d')) continue;
if(!traceIs(trace, 'cartesian')) continue;

var xaName;
if(trace.xaxis) {
14 changes: 1 addition & 13 deletions src/plots/get_data.js
Original file line number Diff line number Diff line change
@@ -99,22 +99,10 @@ exports.getSubplotData = function getSubplotData(data, type, subplotId) {
var subplotData = [];
var trace, subplotX, subplotY;

if(type === 'gl2d') {
var spmatch = subplotId.match(SUBPLOT_PATTERN);
subplotX = 'x' + spmatch[1];
subplotY = 'y' + spmatch[2];
}

for(var i = 0; i < data.length; i++) {
trace = data[i];

if(type === 'gl2d' && Registry.traceIs(trace, 'gl2d')) {
if(trace[attr[0]] === subplotX && trace[attr[1]] === subplotY) {
subplotData.push(trace);
}
} else {
if(trace[attr] === subplotId) subplotData.push(trace);
}
if(trace[attr] === subplotId) subplotData.push(trace);
}

return subplotData;
Loading