From 530db81f43e1af4f0e31991ed8ebede7eeb994c1 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 11 Nov 2016 16:43:50 -0500 Subject: [PATCH 1/3] Clone input trace --- src/plot_api/plot_api.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index bd9f22f8fe8..8727a3442a7 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -956,6 +956,12 @@ Plotly.addTraces = function addTraces(gd, traces, newIndices) { if(!Array.isArray(traces)) { traces = [traces]; } + + // make sure traces does not repeat existing ones + traces = traces.map(function(trace) { + return Lib.extendFlat({}, trace); + }); + helpers.cleanData(traces, gd.data); // add the traces to gd.data (no redrawing yet!) From 80bc5f6d0b8c8f23aed1c567d7d548a2519eb6dc Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 11 Nov 2016 16:55:00 -0500 Subject: [PATCH 2/3] Ignore line ending style --- .eslintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 093ed358b6f..9404630b5bc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -22,7 +22,6 @@ "no-trailing-spaces": [2], "no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 0}], "eol-last": [2], - "linebreak-style": [2, "unix"], "indent": [2, 4, {"SwitchCase": 1}], "max-len": [0, 80], "brace-style": [0, "stroustrup", {"allowSingleLine": true}], From bb0403a906c98221886d4014b15487010e0543dc Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 11 Nov 2016 16:55:06 -0500 Subject: [PATCH 3/3] Fix typo --- src/plot_api/plot_api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index 8727a3442a7..11191a1d275 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -957,7 +957,7 @@ Plotly.addTraces = function addTraces(gd, traces, newIndices) { traces = [traces]; } - // make sure traces does not repeat existing ones + // make sure traces do not repeat existing ones traces = traces.map(function(trace) { return Lib.extendFlat({}, trace); });