observablehq / observablehq/plot

Generalize pointer selection

Open
#1,797 0 comments 1 reaction 1 assignee View on GitHub

@Fil is already working on this.

Since Aug 9, 2023.

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

Description

A “best candidate” function receives as input the channels and max radius, and returns a function that receives the pointer position and returns the best candidate, if any.

This allows a user to build:

  • a pointer that knows about rects, or links
    • we might want to build Plot.pointerRect as a standard method
  • a pointer that is optimized with a quadtree or a spatial tree
  • a pointer that returns several data points at the same time (maybe?)
  • a pointer that knows about geojson (#1743)
  • more custom behaviors?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.