observablehq / observablehq/plot

Plot value not restored correctly when interacting with multiple pointers

Open
#2,431 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
HTML
Stars
5.4k
Forks
244
PR merge metrics
No merged PRs in 30d

Description

If the mouse is within the radius of multiple pointers and moves outside of one pointer's max radius, then the plot value will be set to null instead of according to the remaining active pointer.

Example (notebook):

viewof value = Plot.plot({
  marks: [
    Plot.frame(),
    Plot.rect(["foo"], Plot.pointerY({y: d => d, maxRadius: Infinity, fill: "orange"})),
    Plot.dot([{y: "foo"}], {y: "y", tip: true})
  ],
})

Steps:

  1. Move the mouse into the frame on either the left or right side so that value reads "foo".
  2. Move the mouse towards the dot until the tip appears; observe that value reads {y: "foo"}.
  3. Within the frame, move the mouse away from the dot until the tip disappears; observe that value reads null instead of "foo".

Demo:

Contributor guide

Open the contributing guide

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 Observable notebook linked in the issue and trace the interaction entry points used by Plot.pointerY and the tip from Plot.dot. Reproduce the pointer movement sequence, then verify that leaving the dot keeps value set to "foo" while the pointerY mark remains active.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.