Skip to content

Dragging and zooming in Plot.geo #2258

Answered by Fil
espinielli asked this question in Q&A
Dec 4, 2024 · 1 comments · 10 replies
Discussion options

You must be logged in to vote

Hi Enrico,

here’s a port of the D3 notebook for Plot: Plot: Versor Zooming / Observable | Observable

I fixed several issues since yesterday's version:

  • the behavior is now local to the mark
  • a pointer-events: all style on the plot ensures that it works on mobile
  • the behavior also covers a dot mark

You can disable the zooming part by specifying a zoomExtent [1, 1].

The centroid transform is not great for labels, because when a shape extends on both sides of the map, its centroid might be in the middle. See #2098 for a better alternative.

Replies: 1 comment 10 replies

Comment options

Fil
Dec 5, 2024
Collaborator

You must be logged in to vote
10 replies
@Fil
Comment options

Fil Dec 5, 2024
Collaborator

@espinielli
Comment options

@espinielli
Comment options

@Fil
Comment options

Fil Dec 6, 2024
Collaborator

@espinielli
Comment options

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