-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
🐛 (stacked discrete bar) wrap long labels #3341
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @sophiamersmann and the rest of your teammates on Graphite |
2e18aa1
to
8071ecc
Compare
8071ecc
to
00e7dad
Compare
// useful if `this.barHeight` can't be used due to a cyclic dependency | ||
// keep in mind though that this is not exactly the same as `this.barHeight` | ||
@computed private get approximateBarHeight(): number { | ||
return (0.8 * this.boundsWithoutLegend.height) / this.barCount | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a circular dependency here that I can't get rid of easily. If I remember correctly, it's something like: labelFontSize
-> barHeight
-> innerBounds
-> labelWidth
-> labelStyle
-> labelFontSize
.
Breaking the cycle by using boundsWithoutLegend
instead of innerBounds
is not new, but I added a computed property that makes it explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this looks great!
It would be awesome if we had some way to have more balanced lines (i.e. that each line is roughly the same length), but I realize that that's not easy to do. And this is already soo much better than what it was before.
00e7dad
to
128013c
Compare
Maybe write an issue for it? It could be a cool cooldown project :) |
Related: #2629
We should also do this for DiscreteBar charts, but I don't have time now. I added a note to the issue above 👆🏻