Skip to content

Is there a reliable way of extracting pointer coordinates in data space? #2334

Answered by Fil
jwoLondon asked this question in Q&A
Discussion options

You must be logged in to vote

Plot.pointer sets the value of the chart to the closest datum (within a maxRadius distance), and emits an "input" event when that datum changes.

If you want to follow the pointer in a continuous way, it's a different story: basically you'd need to add your own event listener and use the Plot's x and y scales inverse functions.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@mbostock
Comment options

Answer selected by jwoLondon
Comment options

You must be logged in to vote
1 reply
@Fil
Comment options

Fil Jul 16, 2025
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants