Skip to content

Pie chart supply defaults generates empty marker.colors array #2205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bpostlethwaite opened this issue Dec 14, 2017 · 4 comments
Closed

Pie chart supply defaults generates empty marker.colors array #2205

bpostlethwaite opened this issue Dec 14, 2017 · 4 comments
Labels
bug something broken

Comments

@bpostlethwaite
Copy link
Member

Offending (?) line of code

if(!Array.isArray(colors)) traceOut.marker.colors = [];

This results in marker.colors being return by findArrayAttributes even though marker.colors is not in the user data. See https://codepen.io/bpostlethwaite/pen/dJozzo for an example.

This is seemingly inconsistent with standard fullData behaviour.

@etpinard etpinard added the bug something broken label Dec 14, 2017
@alexcjohnson
Copy link
Collaborator

Possible other cases to worry about:

$ ag "dflt: \[\]"
traces/sankey/attributes.js
103:            dflt: [],
161:            dflt: [],
198:            dflt: [],
204:            dflt: [],
209:            dflt: [],

traces/ohlc/attributes.js
67:        dflt: [],
74:        dflt: [],
81:        dflt: [],
88:        dflt: [],

traces/parcoords/attributes.js
125:            dflt: [],

traces/table/attributes.js
72:            dflt: [],
83:            dflt: [],
152:            dflt: [],
163:            dflt: [],

transforms/groupby.js
32:        dflt: [],

A lot of these cases the trace wouldn't make sense without the attribute but... then what's the point of filling in an empty array?

@etpinard
Copy link
Contributor

Alternatively, maybe we should skip over empty arrays here.

@alexcjohnson
Copy link
Collaborator

skip over empty arrays

Worries me a bit, empty arrays can, in some cases, be different from non-arrays or missing values.

@etpinard
Copy link
Contributor

This appears fixed in 1.34.0 (most likely by the Plotly.react push)

image

compared to in 1.33.1:

image

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

3 participants