observablehq / observablehq/plot
Interval-aware default ticks/tick formats
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
When the data only contains integers, it would be great if the default tickFormat would not do "1.0, 2.0, 3.0"… but rather "1, 2, 3".
In #849 I hoped that indicating an integer interval would be used, in this case to infer an intent of only having integers. (Similarly, if we used interval: d3.utcYear we'd rather format the ticks as "%Y", and d3.utcMonth would result in a default of "%Y-%m" or something.)
Example: the test plot integer-interval.js (svg) should have inferred an integer tickFormat for the x axis. (See also the discussion here.)
Also related to #768
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the integer-interval.js test plot and its referenced test/output/integerInterval.svg output, then read the discussion in #849 and PR #852. Define how interval hints should influence default numeric and date tick formats, and update the relevant test output once the expected behavior is agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100