Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 91cfaa4

Browse filesBrowse files
committed
Merge remote-tracking branch 'origin/master' into perf-setcategoryindex
2 parents 2992126 + 989f07a commit 91cfaa4
Copy full SHA for 91cfaa4

File tree

1 file changed

+4
-4
lines changed
Filter options

1 file changed

+4
-4
lines changed

‎src/traces/scatter/plot.js

Copy file name to clipboardExpand all lines: src/traces/scatter/plot.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ module.exports = function plot(gd, plotinfo, cdscatter, transitionOpts, makeOnCo
5151
// Sort the traces, once created, so that the ordering is preserved even when traces
5252
// are shown and hidden. This is needed since we're not just wiping everything out
5353
// and recreating on every update.
54-
for(i = 0, uids = []; i < cdscatter.length; i++) {
55-
uids[i] = cdscatter[i][0].trace.uid;
54+
for(i = 0, uids = {}; i < cdscatter.length; i++) {
55+
uids[cdscatter[i][0].trace.uid] = i;
5656
}
5757

5858
scatterlayer.selectAll('g.trace').sort(function(a, b) {
59-
var idx1 = uids.indexOf(a[0].trace.uid);
60-
var idx2 = uids.indexOf(b[0].trace.uid);
59+
var idx1 = uids[a[0].trace.uid];
60+
var idx2 = uids[b[0].trace.uid];
6161
return idx1 > idx2 ? 1 : -1;
6262
});
6363

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.