Skip to content

Commit

Permalink
speed up splom.clean
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Oct 1, 2018
1 parent aaf6312 commit 478c669
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/traces/splom/base_plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,19 @@ function makeGridData(gd) {
}

function clean(newFullData, newFullLayout, oldFullData, oldFullLayout) {
oldLoop:
for(var i = 0; i < oldFullData.length; i++) {
var oldTrace = oldFullData[i];

if(oldTrace.type === 'splom') {
for(var j = 0; j < newFullData.length; j++) {
var newTrace = newFullData[j];
var lookup = {};
var i;

if(oldTrace.uid === newTrace.uid && newTrace.type === 'splom') {
continue oldLoop;
}
if(oldFullLayout._splomScenes) {
for(i = 0; i < newFullData.length; i++) {
var newTrace = newFullData[i];
if(newTrace.type === 'splom') {
lookup[newTrace.uid] = 1;
}

if(oldFullLayout._splomScenes) {
}
for(i = 0; i < oldFullData.length; i++) {
var oldTrace = oldFullData[i];
if(!lookup[oldTrace.uid]) {
var scene = oldFullLayout._splomScenes[oldTrace.uid];
if(scene && scene.destroy) scene.destroy();
// must first set scene to null in order to get garbage collected
Expand Down

0 comments on commit 478c669

Please sign in to comment.