Inconsistent Y-axis, when y scale is set to distr: 2 the tick values are displayed as timestamps
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 463
- PR merge metrics
- No merged PRs in 30d
Description
Setting scales.y.distr: 2 displays timestamp values for the y-axis ticks, instead of the squashed original y values. The context is that the data points are always integers and represent domain concepts that can never be fractional (e.g. family members count), often small (e.g. 1, 2). Nevertheless uPlot's linear distribution also displays the in-between fractional values, ([1, 1.25, 1.5, 1.75, 2, ..]) as tick labels on the y axis. Rounding them with something like tick.toFixed(0) yields an awkward chart where the y-axis shows duplicates ([1, 1, 1, 2, 2, ..]). I was expecting scales.y.distr: 2 to get rid of the fractional values but instead it shows timestamps. Is this normal behaviour? Does distr option work for the y axis?
Contributor guide
No contributing guide indexed for this repository
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 linked JSFiddle and inspect how the y-scale handles scales.y.distr: 2 and generates tick labels for integer-valued data. Confirm whether the option should suppress fractional linear ticks rather than produce timestamps; done means the y-axis shows appropriate integer values without timestamp labels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100