Skip to content

Commit b7281b4

Browse files
committed
use descending sorter in deleteTrace:
so that 0,1, ... 11 are sorted as 11, 10, ... 0 instead of 1, 10, 11, 2, 3 ... 9
1 parent d5daacb commit b7281b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plot_api/plot_api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ Plotly.deleteTraces = function deleteTraces(gd, indices) {
14231423
indices = positivifyIndices(indices, gd.data.length - 1);
14241424

14251425
// we want descending here so that splicing later doesn't affect indexing
1426-
indices.sort().reverse();
1426+
indices.sort(Lib.sorterDec);
14271427
for (i = 0; i < indices.length; i += 1) {
14281428
deletedTrace = gd.data.splice(indices[i], 1)[0];
14291429
traces.push(deletedTrace);

0 commit comments

Comments
 (0)