palantir / plottable

:bar_chart: A library of modular chart components built on D3
http://plottablejs.org/
MIT License
2.96k stars 224 forks source link

Reform TransformAwareTranslator for touch events #3389

Closed themadcreator closed 7 years ago

themadcreator commented 7 years ago

Since touch events have clientX/clientY properties but no offsetX/offsetY properties, we still need to use something like TransformAwareTranslator.

The previous TransformAwareTranslator would add, move, and measure a pseudo hidden component, causing awful DOM layout thrashing.

In the new approach, we compute the a cumulative CSS3 transform matrix of the root element ancestors up to <body> and apply it directly to touch event clientX/clientY values.

blueprint-bot commented 7 years ago

eslint

Demo: quicktests | fiddle

themadcreator commented 7 years ago

The new css transform preview test (don't forget to emulate a touch device)