dagitty
dagitty copied to clipboard
Use offsetX/Y to allow embedding in scrollable elements and improve performance
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).