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

never round scales that would result in 0 bandwidth #73

Closed
wants to merge 1 commit into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Dec 23, 2020

fixes #72

@mbostock
Copy link
Member

There’s a related problem with bars/rects with rounding off if you set insetLeft or insetTop, as the bin mark does by default. Also, having a zero bandwidth is fine for certain mark types, such as rules and dots. What if the bar mark had a minimum width in its ordinal dimension, say, 1px? And further, what if insets weren’t allowed to reduce the corresponding dimension beyond 1px (e.g., for a rect that’s naturally 1.5px wide with an insetLeft of 1px, the insetLeft is implicitly reduced to 0.5px).

@mbostock mbostock added this to the Friends Preview milestone Feb 24, 2021
@Fil Fil self-assigned this Mar 3, 2021
@mbostock mbostock removed this from the Friends Preview milestone Mar 10, 2021
@Fil
Copy link
Contributor Author

Fil commented Mar 26, 2021

I wonder if this is not an issue to address in d3-scale:

- if (round) step = Math.floor(step);
+ if (round) step = Math.floor(step) || Math.sign(step);

https://github.com/d3/d3-scale/blob/master/src/band.js#L26

@Fil
Copy link
Contributor Author

Fil commented Mar 31, 2021

We should do this in d3-scale d3/d3-scale#243

@Fil Fil closed this Mar 31, 2021
@Fil Fil deleted the disappearing-bars branch March 31, 2021 15:05
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

Successfully merging this pull request may close these issues.

Bars shouldn’t disappear if there are too many of them.
2 participants