Skip to content

Better error handling in treemap #4308

Closed

Description

@deecay

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.

Activity

  1. archmoj commented on Oct 27, 2019

    @archmoj
    Contributor

    Could you please share a codepen?

  2. deecay commented on Oct 27, 2019

    @deecay
    Author
  3. etpinard commented on Oct 28, 2019

    @etpinard
    Contributor

    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.

  4. self-assigned this
    on Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions