year and integer type scales #1268
Draft
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.
Adds an integer flag on a scale when the associated channels are all integers, either because the interval option is integer, or because we checked a sample of 40 values in each channel.
This flag cannot be specified by the user (but they can use interval: 1), and is censored when the scale is exported.
When the axis text mark decides on its tickFormat, the heuristic is that if the scale is integer and the domain is covered by [1500...2200], it's probably best to default to "d" rather than formatDefault (for ordinal scales) or the linear scale’s default number format, since it's possible that the values are years.
Closes #768
(This is built on top of #1265 but the same logic could be built on the scale function.)
Related: #932