leeoniya / leeoniya/uPlot

Inconsistent Y-axis, when y scale is set to distr: 2 the tick values are displayed as timestamps

Open
#786 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
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?

https://jsfiddle.net/eytuajg0/61/

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.