Skip to content

Commit bf971d6

Browse files
committed
Revert "rm check for Plotly.Queue:"
This reverts commit 94a450c.
1 parent dc28064 commit bf971d6

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

src/plot_api/plot_api.js

+21-10
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,9 @@ Plotly.extendTraces = function extendTraces (gd, update, indices, maxPoints) {
13591359
Plotly.redraw(gd);
13601360

13611361
var undoArgs = [gd, undo.update, indices, undo.maxPoints];
1362-
Plotly.Queue.add(gd, Plotly.prependTraces, undoArgs, extendTraces, arguments);
1362+
if (Plotly.Queue) {
1363+
Plotly.Queue.add(gd, Plotly.prependTraces, undoArgs, extendTraces, arguments);
1364+
}
13631365
};
13641366

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

13861388
var undoArgs = [gd, undo.update, indices, undo.maxPoints];
1387-
Plotly.Queue.add(gd, Plotly.extendTraces, undoArgs, prependTraces, arguments);
1389+
if (Plotly.Queue) {
1390+
Plotly.Queue.add(gd, Plotly.extendTraces, undoArgs, prependTraces, arguments);
1391+
}
13881392
};
13891393

13901394
/**
@@ -1428,7 +1432,7 @@ Plotly.addTraces = function addTraces (gd, traces, newIndices) {
14281432
// i.e., we can simply redraw and be done
14291433
if (typeof newIndices === 'undefined') {
14301434
Plotly.redraw(gd);
1431-
Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
1435+
if (Plotly.Queue) Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
14321436
return;
14331437
}
14341438

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

14521456
// if we're here, the user has defined specific places to place the new traces
14531457
// this requires some extra work that moveTraces will do
1454-
Plotly.Queue.startSequence(gd);
1455-
Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
1458+
if (Plotly.Queue) Plotly.Queue.startSequence(gd);
1459+
if (Plotly.Queue) Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
14561460
Plotly.moveTraces(gd, currentIndices, newIndices);
1457-
Plotly.Queue.stopSequence(gd);
1461+
if (Plotly.Queue) Plotly.Queue.stopSequence(gd);
14581462
};
14591463

14601464
/**
@@ -1494,7 +1498,8 @@ Plotly.deleteTraces = function deleteTraces (gd, indices) {
14941498
}
14951499

14961500
Plotly.redraw(gd);
1497-
Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
1501+
1502+
if (Plotly.Queue) Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
14981503
};
14991504

15001505
/**
@@ -1588,8 +1593,10 @@ Plotly.moveTraces = function moveTraces (gd, currentIndices, newIndices) {
15881593
}
15891594

15901595
gd.data = newData;
1596+
15911597
Plotly.redraw(gd);
1592-
Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
1598+
1599+
if (Plotly.Queue) Plotly.Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);
15931600
};
15941601

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

20272034
// now all attribute mods are done, as are redo and undo
20282035
// so we can save them
2029-
Plotly.Queue.add(gd, restyle, [gd, undoit, traces], restyle, [gd, redoit, traces]);
2036+
if(Plotly.Queue) {
2037+
Plotly.Queue.add(gd, restyle, [gd, undoit, traces], restyle, [gd, redoit, traces]);
2038+
}
20302039

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

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

0 commit comments

Comments
 (0)