8000 More consistent geo maps configs by etpinard · Pull Request #4 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

More consistent geo maps configs #4

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 16 commits into from
Nov 16, 2015
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert "rm check for Plotly.Queue:"
This reverts commit 94a450c.
  • Loading branch information
etpinard committed Nov 16, 2015
commit bf971d69933d5b7bd5648b70912859e98161dd83
31 changes: 21 additions & 10 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,9 @@ Plotly.extendTraces = function extendTraces (gd, update, indices, maxPoints) {
Plotly.redraw(gd);

var undoArgs = [gd, undo.update, indices, undo.maxPoints];
Plotly.Queue.add(gd, Plotly.prependTraces, undoArgs, extendTraces, arguments);
if (Plotly.Queue) {
Plotly.Queue.add(gd, Plotly.prependTraces, undoArgs, extendTraces, arguments);
}
};

Plotly.prependTraces = function prependTraces (gd, update, indices, maxPoints) {
Expand All @@ -1384,7 +1386,9 @@ Plotly.prependTraces = function prependTraces (gd, update, indices, maxPoints)
Plotly.redraw(gd);

var undoArgs = [gd, undo.update, indices, undo.maxPoints];
Plotly.Queue.add(gd, Plotly.extendTraces, undoArgs, prependTraces, arguments);
if (Plotly.Queue) {
Plotly.Queue.add(gd, Plotly.extendTraces, undoArgs, prependTraces, arguments);
}
};

/**
Expand Down Expand Up @@ -1428,7 +1432,7 @@ Plotly.addTraces = function addTraces (gd, traces, newIndices) {
// i.e., we can simply redraw and be done
if (typeof newIndices === 'undefined') {
Plotly.redraw(gd);
Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
if (Plotly.Queue) Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
return;
}

Expand All @@ -1451,10 +1455,10 @@ Plotly.addTraces = function addTraces (gd, traces, newIndices) {

// if we're here, the user has defined specific places to place the new traces
// this requires some extra work that moveTraces will do
Plotly.Queue.startSequence(gd);
Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
if (Plotly.Queue) Plotly.Queue.startSequence(gd);
if (Plotly.Queue) Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
Plotly.moveTraces(gd, currentIndices, newIndices);
Plotly.Queue.stopSequence(gd);
if (Plotly.Queue) Plotly.Queue.stopSequence(gd);
};

/**
Expand Down Expand Up @@ -1494,7 +1498,8 @@ Plotly.deleteTraces = function deleteTraces (gd, indices) {
}

Plotly.redraw(gd);
Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);

if (Plotly.Queue) Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
};

/**
Expand Down Expand Up @@ -1588,8 +1593,10 @@ Plotly.moveTraces = function moveTraces (gd, currentIndices, newIndices) {
}

gd.data = newData;

Plotly.redraw(gd);
Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);

if (Plotly.Queue) Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
};

// -----------------------------------------------------
Expand Down Expand Up @@ -2026,7 +2033,9 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {

// now all attribute mods are done, as are redo and undo
// so we can save them
Plotly.Queue.add(gd, restyle, [gd, undoit, traces], restyle, [gd, redoit, traces]);
if(Plotly.Queue) {
Plotly.Queue.add(gd, restyle, [gd, undoit, traces], restyle, [gd, redoit, traces]);
}

// do we need to force a recalc?
var autorangeOn = false;
Expand Down Expand Up @@ -2404,7 +2413,9 @@ Plotly.relayout = function relayout(gd, astr, val) {
}
// now all attribute mods are done, as are
// redo and undo so we can save them
Plotly.Queue.add(gd, relayout, [gd, undoit], relayout, [gd, redoit]);
if(Plotly.Queue) {
Plotly.Queue.add(gd, relayout, [gd, undoit], relayout, [gd, redoit]);
}

// calculate autosizing - if size hasn't changed,
// will remove h&w so we don't need to redraw
Expand Down
0