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}], diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index bd9f22f8fe8..11191a1d275 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 do 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!)