Skip to content

Axes ref cleanup #1431

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 10 commits into from
Mar 2, 2017
Prev Previous commit
Next Next commit
require axis_ids instead of Axes in cartesian index
  • Loading branch information
etpinard committed Mar 1, 2017
commit 704596a5bf9a7f86850e414d5533e626fa865cdf
9 changes: 5 additions & 4 deletions src/plots/cartesian/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
var d3 = require('d3');
var Lib = require('../../lib');
var Plots = require('../plots');
var Axes = require('./axes');

var axisIds = require('./axis_ids');
var constants = require('./constants');

exports.name = 'cartesian';
Expand Down Expand Up @@ -166,7 +167,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)

if(hadCartesian && !hasCartesian) {
var subplotLayers = oldFullLayout._cartesianlayer.selectAll('.subplot');
var axIds = Axes.listIds({ _fullLayout: oldFullLayout });
var axIds = axisIds.listIds({ _fullLayout: oldFullLayout });

subplotLayers.call(purgeSubplotLayers, oldFullLayout);
oldFullLayout._defs.selectAll('.axesclip').remove();
Expand Down Expand Up @@ -241,13 +242,13 @@ function makeSubplotData(gd) {
// dimension that this one overlays to be an overlaid subplot,
// the main plot must exist make sure we're not trying to
// overlay on an axis that's already overlaying another
var xa2 = Axes.getFromId(gd, xa.overlaying) || xa;
var xa2 = axisIds.getFromId(gd, xa.overlaying) || xa;
if(xa2 !== xa && xa2.overlaying) {
xa2 = xa;
xa.overlaying = false;
}

var ya2 = Axes.getFromId(gd, ya.overlaying) || ya;
var ya2 = axisIds.getFromId(gd, ya.overlaying) || ya;
if(ya2 !== ya && ya2.overlaying) {
ya2 = ya;
ya.overlaying = false;
Expand Down