leeoniya / leeoniya/uPlot

missing data gap clipping should honour line width

Open
#1,109 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
463
PR merge metrics
No merged PRs in 30d

Description

Currently the gap clipping for missing data does not take into account the fact that a line width > 1 can lead to pixels being painted outside of the strict boundaries of a gap. This is particularly true if the data is significantly different between the start and end points of the gap.

For instance if on https://leeoniya.github.io/uPlot/demos/missing-data.html you modify

data[2][92] = 0.1
data[2][93] = 0.1
u.series[2].width=3
u.setData(data)

you get a part of the line connecting the gap, which should have been clipped away, visible:
Image

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 missing-data demo at https://leeoniya.github.io/uPlot/demos/missing-data.html and reproduce the case by setting data[2][92] and data[2][93] to 0.1, setting u.series[2].width to 3, and calling u.setData(data). Trace the gap-clipping path and verify that the connecting line remains within the gap boundaries when the line width exceeds 1.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.