never round scales that would result in 0 bandwidth#73
Closed
Conversation
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). |
Contributor
Author
|
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); |
Contributor
Author
|
We should do this in d3-scale d3/d3-scale#243 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #72