Multiple issues with transforms #2908
Copy link
Copy link
Closed
Labels
bugsomething brokensomething broken
Description
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:
"transforms": [
{
"type": "filter",
"target": [],
"targetsrc": null
}
]
Results:
scatter3d:
- filter: many warnings:
[.Offscreen-For-WebGL-0x7fef4b0d6800]RENDER WARNING: Render count or primcount is 0.
-> https://codepen.io/etpinard/pen/dgWJZg
scatter3d + marker:’line’
- filter:
Uncaught (in promise) TypeError: Cannot read property 'slice' of undefined at LinePlot.proto.update
-> https://codepen.io/etpinard/pen/Edmobo
cone, streamtube, scattergeo, table, heatmap (with 1d array input), contour (with 1d array input)
- any transforms: as I add them to
data, they never get added tofullData
choropleth, scatterternary, scatterpolar, pie:
- aggregate:
Error while plotting: TypeError: Cannot set property 'type' of undefined at Object.plots.supplyTransformDefaults
pie:
- filter:
Error: <path> attribute d: Expected number, "MNaN,NaNa189.5,18…".
-> https://codepen.io/etpinard/pen/wYdppB
2d contour histogram:
- 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
scatterwith 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
This one got fixed in: #3093
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugsomething brokensomething broken
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