Plotly.js: Can't layer an existing trace on top of itself

Created on 18 Nov 2016  路  6Comments  路  Source: plotly/plotly.js

http://codepen.io/cpsievert/pen/zoNBMV

Possibly related to #1083. I also tried pushing traces to gd.data and calling Plotly.redraw(gd) with the same problem, so I think the issue needs to be resolved there.

PS. this is quite important for the R packages' newest stuff

bug

All 6 comments

Why don't you just make a clone of that trace in question?

I suppose that would be a smart thing to do 馃槅

I still find the behavior kind of surprising, but I know u have better things to work on...

PS. would u recommend cloning with var traceClone = JSON.parse(JSON.stringify(trace));?

@cpsievert I believe a mere _flat_ extend suffice here as @dfcreative 's patch in https://github.com/plotly/plotly.js/pull/1136

JSON.parse + JSON.striginify makes a deep copy which is safer but also very slow.

Should be resolved in #1136

Oh and I should mention @cpsievert both this issue and #1083 will be fixed in 1.20.3 set to be released in the next few hours.

Was this page helpful?
0 / 5 - 0 ratings