leeoniya / leeoniya/uPlot

Confusing interplay between sync and lock

Open
#1,120 0 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

I was implementing the cursor synchronization following the sync-cursor demo and I had some really strange behavior on my charts, like they were "locking up"

I was able to reproduce this in the sync cursor demo with the following steps:

  1. Load the sync-cursor demo
  2. Disable sync
  3. Click inside the CPU plot to lock the cursor
  4. Enable sync
  5. Click inside the CPU plot to unlock the cursor

The other two plots now get a locked cursor while the first plot has it unlocked.

There's other weird behavior that happens with an unsynced cursor lock, like zooming doesn't quite work, but it sort of fixes it (probably because the first click unlocks the cursor in the other two plots while still listening for mouseup in the first plot).

In the example I sort of had to go out of my way to recreate this behavior, but for my implementation it seems like the first mousedown when zooming locks the other cursors. Also, this doesn't happen if I don't call ".sub" on the uplot.sync object (and yet sync still works).

I'm just reporting the issue. Maybe it's worth removing lock: true from the cursor sync demo?

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 sync-cursor demo and reproduce the listed sequence: disable sync, lock the CPU cursor, re-enable sync, and unlock it. Inspect the cursor synchronization behavior around lock: true and calling .sub on the uplot.sync object. Done means cursor locking, unlocking, and zooming remain consistent across all three plots.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.