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

Feature Request: Configurable Min Height Setting for Stacked Bars #366

Open
seancrater opened this issue Apr 9, 2024 · 1 comment
Open

Comments

@seancrater
Copy link

Currently, a user can input that they want a min height of 1px via props for the StackedBars component but what if they want it to be 3px or 5px? What if they've applied a stroke to the bars?

Currently I'm facing the pain point of having a stroke making it so the min1Px prop effectively does nothing, you don't see the color of my bar due to the stroke. I'd love to have some control over that and I've tried applying some CSS hacks to the bar paths but unfortunately that won't work either due to the positioning of the bars calculated by the library.

Love the mission of this library, just wanted to raise this as a pain point 😄

@seancrater seancrater changed the title Feature Request: Min Height Setting for Stacked Bars Feature Request: Configurable Min Height Setting for Stacked Bars Apr 9, 2024
@rokotyan
Copy link
Contributor

Thanks for the feedback @seancrater! We thought about this and intentionally made it only 1px for the StackedBar component because a larger value can distort the visual encoding of the chart. But we didn't think about the 'stroke' use case. Maybe we should revisit it and just warn users instead of enforcing it.

And we welcome code contributions, if you want to have this feature sooner you can try playing with this line in the code, and raising a PR:

const h = !isEntering && config.barMinHeight1Px && (height < 1) && isFinite(value) && (value !== config.barMinHeightZeroValue) ? 1 : height

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

No branches or pull requests

2 participants