Skip to content

Treemap: drilldown is increasing the height of the treemap #5199

Closed

Description

@thierryVergult

When doing a drill-down in the treemap, the height of the treemap changes, when going from the highest level to any other level.

> jsfiddle

Changing between other levels keeps the height constant, which gives a better, calmer visible feel.

Activity

  1. archmoj commented on Oct 7, 2020

    @archmoj
    Contributor

    I don't see this as a bug. In fact that was the expected behaviour to leave the space for the pathbar and smooth transition.
    Have you tried dropping the blank root in your example, like this?

    labels: ["level1", "level2", "level3"],
    parents: [ "level0", "level1", "level2"]
    
  2. nicolaskruchten commented on Oct 8, 2020

    @nicolaskruchten
    Contributor

    So what's happening here isn't actually that the treemap is growing, it's that the "pathbar" starts out empty and the top level appears in the pathbar. The initial position of the top level label is very close to its position in the pathbar so it looks a bit odd, indeed. I'm not sure what a great fix for this would be...

  3. thierryVergult commented on Oct 9, 2020

    @thierryVergult
    ContributorAuthor

    @archmoj : I'm also not sure if this is a bug, or could be called an enhancement or feature.

    I have included a new fiddle, with a basic layout, which hides in fact (unintentionally) the pathbar. By doing a drill down, it fills the whole space above, and overlaps with the modebar. @nicolaskruchten : I agree to label that odd.

    > new fiddle

    I can investigate how to keep the height of the treemap constant.

  4. reopened this on Oct 9, 2020
  5. thierryVergult commented on Oct 10, 2020

    @thierryVergult
    ContributorAuthor

    I think I'm getting somewhere.

    The color of the root is harcoded to rgba(0, 0, 0, 0) in ../sunburst/calc.js

    else {
    // root gets no coloring by default
    cdi.color = 'rgba(0,0,0,0.)';
    }

    And ../treemap/style.js is forcing further styling

    if(isRoot && fillColor === 'rgba(0,0,0,0)') {
    opacity = 0;
    lineColor = 'rgba(0,0,0,0)';
    lineWidth = 0;

    By changing the color of the root node, I get the behavior I was looking for : visual fixed height of the treemap.

    Are there already similar attributes for other graph types that enforce the color and opacity of a specific node? If so, I can use these in a PR.

  6. nicolaskruchten commented on Oct 10, 2020

    @nicolaskruchten
    Contributor

    I'm not sure I understand what you're aiming to do with this PR... could you elaborate please? If you set the margins to 0, the pathbar will definitely be out of view, but this is pretty much the intended behaviour.

  7. thierryVergult commented on Oct 12, 2020

    @thierryVergult
    ContributorAuthor

    Maybe the png file at the link explains it better? screenshots before and after, with & without drilldown (pathBar at the bottom)

    You can rephrase it like : what is the color in the middle of a donut chart ? (Same for sunburst with a labeled root)

    My proposal is to make the root color configurable. (now hard coded rgba(0,0,0,0))

  8. added
    feature
    on Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions