Skip to content

Commit bb2a1d6

Browse files
committed
plots: don't dive into non-container arrays
- as before 37e291b - this can lead to significant speed up when large data arrays are present
1 parent 641b231 commit bb2a1d6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/plots/plots.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,9 @@ function relinkPrivateKeys(toContainer, fromContainer) {
610610

611611
toContainer[k] = fromVal;
612612
}
613-
else if(isArray(fromVal) && isArray(toVal)) {
613+
else if(isArray(fromVal) && isArray(toVal) && isPlainObject(fromVal[0])) {
614614

615-
// recurse into arrays
615+
// recurse into arrays containers
616616
for(var j = 0; j < fromVal.length; j++) {
617617
if(isPlainObject(fromVal[j]) && isPlainObject(toVal[j])) {
618618
relinkPrivateKeys(toVal[j], fromVal[j]);

test/jasmine/tests/plots_test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ describe('Test Plots', function() {
5050

5151
Plots.supplyDefaults(gd);
5252

53+
expect(gd._fullData[0].z).toBe(newData[0].z);
54+
expect(gd._fullData[1].z).toBe(newData[1].z);
5355
expect(gd._fullData[1]._empties).toBe(oldFullData[1]._empties);
5456
expect(gd._fullLayout.scene._scene).toBe(oldFullLayout.scene._scene);
5557
expect(gd._fullLayout._plots).toBe(oldFullLayout._plots);

0 commit comments

Comments
 (0)