dagitty icon indicating copy to clipboard operation
dagitty copied to clipboard

Use offsetX/Y to allow embedding in scrollable elements and improve performance

Open krassowski opened this issue 3 years ago • 0 comments

offsetX and offsetY give directly the offset which so far was calculated in a multi-step process; these properties of mouse event have a very good support in browsers (see https://caniuse.com/mdn-api_mouseevent_offsetx - 97% coverage).

By delegating this to the browser, you get a better performance and correctness (previous code was not working when dagitty is placed inside an absolutely positioned or scrollable element).

krassowski avatar Jul 29 '22 21:07 krassowski