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

Fix TransformAwareTranslator transform #3397

Closed themadcreator closed 7 years ago

themadcreator commented 7 years ago

The previous implementation walked the HTMLElement ancestry using the element.offsetParent chain. However, some elements in the acenstry may contain scroll offsets that are not taken into account with this approach.

This new implementation walks the HTMLElement ancestry using element.parentElement to include all scroll offsets. Client/offset offsets are added only for offsetParent elements.

No longer reverse order of elements in the acnestry. Instead we reverse the order of matrix multiplications.

Removed origin addition in dispatchers since that is taken into account by offset chain.

Updated unit test stub.

blueprint-bot commented 7 years ago

Fix TransformAwareTranslator transform

Demo: quicktests | fiddle

themadcreator commented 7 years ago

full css transforms demo

codepen demo

blueprint-bot commented 7 years ago

npm-run-all

Demo: quicktests | fiddle