observablehq / observablehq/plot
PointerY falls back to nearest X/Y outside of frame
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
When the cursor is moved outside of the frame area, PointerY will no longer match by closest Y, instead matching the closest point b X/Y distance.
This is problematic when hovering axis labels, as the tooltip may no longer line up with the axis label.
Example:
Plot.plot({
height: 100,
marks: [
Plot.frame(),
Plot.dot([1,2,1], {x: d => d, y: (d, i) => i, tip: {pointer: "y"}}),
],
})
https://github.com/user-attachments/assets/7c3c0395-c65c-4316-8be7-36763bae4af6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied Plot.plot example and inspect the PointerY interaction behavior when the cursor is outside the frame, especially over axis labels. The change is done when PointerY consistently matches the closest Y and the tooltip remains aligned with the hovered axis label; the issue names no file or test to start from.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100