Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1058366

Browse files
dyetpinard
authored andcommitted
Clone input trace
1 parent 775682f commit 1058366

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/plot_api/plot_api.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,12 @@ Plotly.addTraces = function addTraces(gd, traces, newIndices) {
956956
if(!Array.isArray(traces)) {
957957
traces = [traces];
958958
}
959+
960+
// make sure traces does not repeat existing ones
961+
traces = traces.map(function(trace) {
962+
return Lib.extendFlat({}, trace);
963+
});
964+
959965
helpers.cleanData(traces, gd.data);
960966

961967
// add the traces to gd.data (no redrawing yet!)

0 commit comments

Comments
 (0)