Skip to content
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

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

Closed
thierryVergult opened this issue Oct 7, 2020 · 6 comments
Closed

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

thierryVergult opened this issue Oct 7, 2020 · 6 comments
Labels
feature something new

Comments

@thierryVergult
Copy link
Contributor

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.

@archmoj
Copy link
Contributor

archmoj commented Oct 7, 2020

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"]

@nicolaskruchten
Copy link
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...

@archmoj archmoj closed this as completed Oct 9, 2020
@thierryVergult
Copy link
Contributor Author

@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.

@archmoj archmoj reopened this Oct 9, 2020
@thierryVergult
Copy link
Contributor Author

thierryVergult commented Oct 10, 2020

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.

@nicolaskruchten
Copy link
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.

@thierryVergult
Copy link
Contributor Author

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))

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

No branches or pull requests

3 participants