Coordinated plots
#1984
-
Is there a way to implement a linked hover interaction, where hovering on any chart in a set of linked charts would show the pointers for that x position across all linked charts? Example here: https://observablehq.com/@iopsystems/coordinated-plots In general, the plots might not be of the same type and may want to exist in different parts of the DOM. Otherwise I think this could be done with facets. |
Beta Was this translation helpful? Give feedback.
Answered by
Fil
Sep 3, 2024
Replies: 1 comment 3 replies
-
Take a look at render transforms as demonstrated here: #1871 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is difficult, since you need to make sure you don't have circular effects.
To answer the first question "to get the ID of the point that is hovered in the Plot": you can do
viewof hovered = Plot.plot({…
, and in a separate cell doThis will set the value of
selectedPointId
when you mouse over the chart. However it will not highlight that point on the map. To do so, you will have to restructure the code a bit more, so you can manipulate the Leaflet markers without re-generating the whole map. I've sent you a suggestion in https://observablehq.com/compare/a1c5edd0489f4478...caec8…