observablehq / plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
https://observablehq.com/plot/
ISC License
4.27k stars 174 forks source link

the pointer interaction breaks on mobile when you drag vertically #2157

Open Fil opened 2 weeks ago

Fil commented 2 weeks ago

On mobile, pointing (with Plot.pointer) works if you tap on a point, and it also works if you touch and drag horizontally. But as soon as you drag 1 pixel vertically (or sideways), the page scrolls up/down, and the pointer interaction stops.

Not sure if this is a 100% correct description. Tested in an observable notebook (I'd want to try and replicate it on a framework page).

mbostock commented 2 weeks ago

Not sure we want to change this; doing so would presumably prevent vertical scrolling if that is what you intended by touching and dragging and simply happened to touch the chart to start. We don’t want to create “dead areas” where you can’t scroll because the chart is stealing the input.

Fil commented 2 weeks ago

Yes that's an important design constraint. But it still feels slightly broken as is, when I compare against this smooth chart. In the NYT chart dragging does not break the interaction, and at the same time does not create a dead zone.