Skip to content

Better error handling in treemap #4308

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
deecay opened this issue Oct 26, 2019 · 3 comments · Fixed by #4312
Closed

Better error handling in treemap #4308

deecay opened this issue Oct 26, 2019 · 3 comments · Fixed by #4312
Assignees
Labels
bug something broken

Comments

@deecay
Copy link

deecay commented Oct 26, 2019

Hi,

When given data for treemap is somehow flawed, Plotly terminates with error. I think there needs to be some error handling.

In my case, plotting stops here with Cannot read property 'data' of undefined.

var isRoot = helpers.isHierarchyRoot(entry);

This is because calc has failed to build cd.hierarchy, but plotOne expects hierarchy to be there.

Since treemap doesn't have axis, I don't know what a blank treemap plot would look like, but I suppose that's waht we need here.

@archmoj
Copy link
Contributor

archmoj commented Oct 27, 2019

Could you please share a codepen?

@deecay
Copy link
Author

deecay commented Oct 27, 2019

https://codepen.io/deecay/pen/wvvexqo

@etpinard
Copy link
Contributor

etpinard commented Oct 28, 2019

Thanks for reporting @deecay !!

The equivalent sunburst trace behaves better: https://codepen.io/etpinard/pen/mddMOZo

... probably due to this block:

if(!entry) {
return slices.remove();
}

that we could copy over to treemap/plot.js.

@archmoj archmoj added the bug something broken label Oct 28, 2019
@archmoj archmoj self-assigned this Oct 28, 2019
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

Successfully merging a pull request may close this issue.

3 participants