diff --git a/src/plots/plots.js b/src/plots/plots.js index d7a45a44a21..4089d451816 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -610,9 +610,9 @@ function relinkPrivateKeys(toContainer, fromContainer) { toContainer[k] = fromVal; } - else if(isArray(fromVal) && isArray(toVal)) { + else if(isArray(fromVal) && isArray(toVal) && isPlainObject(fromVal[0])) { - // recurse into arrays + // recurse into arrays containers for(var j = 0; j < fromVal.length; j++) { if(isPlainObject(fromVal[j]) && isPlainObject(toVal[j])) { relinkPrivateKeys(toVal[j], fromVal[j]); diff --git a/test/jasmine/tests/plots_test.js b/test/jasmine/tests/plots_test.js index aa9f52d228f..abc63b05fe0 100644 --- a/test/jasmine/tests/plots_test.js +++ b/test/jasmine/tests/plots_test.js @@ -50,6 +50,8 @@ describe('Test Plots', function() { Plots.supplyDefaults(gd); + expect(gd._fullData[0].z).toBe(newData[0].z); + expect(gd._fullData[1].z).toBe(newData[1].z); expect(gd._fullData[1]._empties).toBe(oldFullData[1]._empties); expect(gd._fullLayout.scene._scene).toBe(oldFullLayout.scene._scene); expect(gd._fullLayout._plots).toBe(oldFullLayout._plots);