Spaces:
Paused
Paused
Download node_modules/@plotly/d3/src/event/mouse.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/d3/src/event/mouse.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/d3/src/event/mouse.js
-
curl -L -o mouse.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/d3/src/event/mouse.js
1.32 kB
| import "../core/document"; | |
| import "event"; | |
| d3.mouse = function(container) { | |
| return d3_mousePoint(container, d3_eventSource()); | |
| }; | |
| // https://bugs.webkit.org/show_bug.cgi?id=44083 | |
| var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0; | |
| function d3_mousePoint(container, e) { | |
| if (e.changedTouches) e = e.changedTouches[0]; | |
| var svg = container.ownerSVGElement || container; | |
| if (svg.createSVGPoint) { | |
| var point = svg.createSVGPoint(); | |
| if (d3_mouse_bug44083 < 0) { | |
| var window = d3_window(container); | |
| if (window.scrollX || window.scrollY) { | |
| svg = d3.select("body").append("svg").style({ | |
| position: "absolute", | |
| top: 0, | |
| left: 0, | |
| margin: 0, | |
| padding: 0, | |
| border: "none" | |
| }, "important"); | |
| var ctm = svg[0][0].getScreenCTM(); | |
| d3_mouse_bug44083 = !(ctm.f || ctm.e); | |
| svg.remove(); | |
| } | |
| } | |
| if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; | |
| else point.x = e.clientX, point.y = e.clientY; | |
| point = point.matrixTransform(container.getScreenCTM().inverse()); | |
| return [point.x, point.y]; | |
| } | |
| var rect = container.getBoundingClientRect(); | |
| return [e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop]; | |
| }; | |