observablehq / observablehq/plot

Clicking a pinned element should unpin it

Open
#2,300 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Users can sticky a pointer selection by clicking. However, to unsticky it again they have to click outside the currently rendered mark elements:
https://github.com/observablehq/plot/blob/90a56897cabda400e2b7537f8ecbbd2cebd18f7f/src/interactions/pointer.js#L167

I frequently find myself stumbling over this behavior since I intuitively treat pinning as a toggle. If technically feasible I believe it would be preferable if any click, even on the mark itself, would unpin the selection.

Is the current implementation meant to handle cases where a user interacts with the pinned mark, like clicking a link or selecting text?

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 at src/interactions/pointer.js around line 167 and inspect how clicks on rendered mark elements are handled after a pointer selection is pinned. Check whether the existing behavior protects interactions such as links or text selection, then verify that clicking the pinned mark unpins it when appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
d3, javascript
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.