Skip to content

Cleanup legacy polar framework #5414

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 1 commit into from
Jan 16, 2021
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
8 changes: 0 additions & 8 deletions src/lib/queue.js
Original file line number Diff line number Diff line change
@@ -126,10 +126,6 @@ queue.stopSequence = function(gd) {
queue.undo = function undo(gd) {
var queueObj, i;

if(gd.framework && gd.framework.isPolar) {
gd.framework.undo();
return;
}
if(gd.undoQueue === undefined ||
isNaN(gd.undoQueue.index) ||
gd.undoQueue.index <= 0) {
@@ -159,10 +155,6 @@ queue.undo = function undo(gd) {
queue.redo = function redo(gd) {
var queueObj, i;

if(gd.framework && gd.framework.isPolar) {
gd.framework.redo();
return;
}
if(gd.undoQueue === undefined ||
isNaN(gd.undoQueue.index) ||
gd.undoQueue.index >= gd.undoQueue.queue.length) {
14 changes: 0 additions & 14 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
@@ -152,12 +152,6 @@ function plot(gd, data, layout, config) {
}
}

// polar need a different framework
if(gd.framework !== makePlotFramework) {
gd.framework = makePlotFramework;
makePlotFramework(gd);
}

// clear gradient defs on each .plot call, because we know we'll loop through all traces
Drawing.initGradients(gd);

@@ -1770,10 +1764,6 @@ function relayout(gd, astr, val) {
gd = Lib.getGraphDiv(gd);
helpers.clearPromiseQueue(gd);

if(gd.framework && gd.framework.isPolar) {
return Promise.resolve(gd);
}

var aobj = {};
if(typeof astr === 'string') {
aobj[astr] = val;
@@ -2283,10 +2273,6 @@ function update(gd, traceUpdate, layoutUpdate, _traces) {
gd = Lib.getGraphDiv(gd);
helpers.clearPromiseQueue(gd);

if(gd.framework && gd.framework.isPolar) {
return Promise.resolve(gd);
}

if(!Lib.isPlainObject(traceUpdate)) traceUpdate = {};
if(!Lib.isPlainObject(layoutUpdate)) layoutUpdate = {};

3 changes: 0 additions & 3 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
@@ -1740,7 +1740,6 @@ plots.purge = function(gd) {
delete gd._fullData;
delete gd._fullLayout;
delete gd.calcdata;
delete gd.framework;
delete gd.empty;

delete gd.fid;
@@ -2235,8 +2234,6 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfi
}
}

if(gd.framework && gd.framework.isPolar) obj = gd.framework.getConfig();

if(frames) obj.frames = stripObj(frames);

if(includeConfig) obj.config = stripObj(gd._context, true);
5 changes: 0 additions & 5 deletions src/snapshot/cloneplot.js
Original file line number Diff line number Diff line change
@@ -58,11 +58,6 @@ function keyIsAxis(keyName) {


module.exports = function clonePlot(graphObj, options) {
// Polar plot compatibility
if(graphObj.framework && graphObj.framework.isPolar) {
graphObj = graphObj.framework.getConfig();
}

var i;
var oldData = graphObj.data;
var oldLayout = graphObj.layout;
27 changes: 0 additions & 27 deletions test/jasmine/tests/plot_promise_test.js
Original file line number Diff line number Diff line change
@@ -373,33 +373,6 @@ describe('Plotly.___ methods', function() {
});
});

describe('Plotly.relayout promise', function() {
var promise;
var promiseGd;

beforeEach(function(done) {
var data = [{ x: [1, 2, 3], y: [4, 5, 6] }];
var layout = {hovermode: 'closest'};
var initialDiv = createGraphDiv();

Plotly.newPlot(initialDiv, data, layout);

initialDiv.framework = { isPolar: true };
promise = Plotly.relayout(initialDiv, 'hovermode', false);

promise.then(function(gd) {
promiseGd = gd;
done();
});
});

it('should be returned with the graph div unchanged when the framework is polar', function() {
expect(promiseGd).toBeDefined();
expect(typeof promiseGd).toBe('object');
expect(promiseGd.changed).toBeFalsy();
});
});

describe('Plotly.relayout promise', function() {
var promise;
var promiseRejected = false;