You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve been trying to add transforms to multiple trace types with varying degrees of success. Documentation doesn’t make it clear which trace types support transforms. All I know from discussion with @etpinard, is that anything that takes 2d arrays as input doesn’t support them. react-chart-editor as of now does not prepopulate target/targetsrc:
filter: Error while plotting: TypeError: Cannot read property 'length' of undefined at makeCrossings (plotly-with-meta.js?ab3a:146042)
Edit:
Add this one to the list:
When defining a scatter with just Y defined, and than add an aggregate: Uncaught TypeError: Cannot set property 'type' of undefined at Object.plots.supplyTransformDefaults https://codepen.io/dmt0/pen/xJoWoY
Most of these problems occur because transforms[i].target: [] turns data arrays into [] during the calc step (as filter transforms are applied using _module.calcTransform) and the trace type module plot method expect empty data array to be associated with visible: false (from the supplyDefault logic) traces.
Perhaps, the most robust to handle this would be to make transform items with target: [] (or any other falsy value?) set enable to false similar to how traces with empty data array get visible:false during supplyDefaults.
Activity
etpinard commentedon Aug 15, 2018
Ok. Thanks for the report!
What does
targetsrc: nullwhich isn't a plotly.js attribute) do?. I suspect it injectstarget: []in the user data, but I would like to confirmetpinard commentedon Aug 15, 2018
But yeah, we could do better than declaring
transformsin the schema for all trace types (including the ones that don't support them yet):plotly.js/src/plots/attributes.js
Lines 160 to 167 in 7bba266
dmt0 commentedon Aug 16, 2018
yes, in fullData I see
target: Array[0]etpinard commentedon Oct 10, 2018
Most of these problems occur because
transforms[i].target: []turns data arrays into[]during the calc step (as filter transforms are applied using_module.calcTransform) and the trace type moduleplotmethod expect empty data array to be associated withvisible: false(from the supplyDefault logic) traces.Note that
has a legend item, whereas
does not, which I believe is correct.
Perhaps, the most robust to handle this would be to make transform items with
target: [](or any other falsy value?) setenabletofalsesimilar to how traces with empty data array getvisible:falseduring supplyDefaults.etpinard commentedon Oct 10, 2018
scatterpolarnow looks like:https://codepen.io/etpinard/pen/YJVYYd
etpinard commentedon Oct 30, 2018
As far as I can tell, @antoinerg 's #3158 removed the
transformsattribute container from all traces that do not support transforms.set enabled:false when filter target array is empty