leeoniya / leeoniya/uPlot

When scale distr:2, scaleMin and scaleMax have wrong values

Open
#555 4 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

Not sure if this is a bug, but when I set distr:2 on the x scale, the scaleMin and scaleMax values that are passed to the function:
space: (self, axisIdx, scaleMin, scaleMax, plotDim)
are not the values of the x-data array but their indexes. So , in my case, instead of getting timestamps, I get the min and max index of the timestamp array.

I am trying to get somewhat meaningful splits/ticks with temporal data and distr:2 (for a simple stock price line chart).
Do you maybe have some examples how to achieve this? The default splits (e.g. for months) don't start at the beginning of the month)

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 by locating the implementation of the space(self, axisIdx, scaleMin, scaleMax, plotDim) callback and the x-scale handling for distr:2. Reproduce the issue with temporal data and compare the supplied bounds with the x-data timestamps and indexes. Done means the intended bounds are passed consistently, or the expected approach for month-aligned ticks is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.