Skip to content

Conversation

@Fil
Copy link
Member

@Fil Fil commented Mar 31, 2021

fixes #242

step,
bandwidth,
round = false,
roundingPrecision = 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we employ the same test as d3-axis so that roundingPrecision can default to 0.5 if devicePixelRatio > 1?

https://github.com/d3/d3-axis/blob/4fc4f2bd287de20c4fc5f1da447ae1194d3acca6/src/axis.js#L39

Also, I think internally perhaps we should store the inverse rounding precision as an integer (e.g., precision = 2 if we want to round to the nearest half-pixel), so as to reduce the likelihood of floating point error.

Also, how about the shorter name scale.precision. Is that too ambiguous?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with using devicePixelRatio and integer representation. For the name, I think precision presents the risk of being ambiguous (though we have no use for a scale's precision yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

round scaleBand might collapse

3 participants