MCPcopy Index your code
hub / github.com/csev/py4e / d3_mousePoint

Function d3_mousePoint

code/pagerank/d3.v2.js:2543–2569  ·  view source on GitHub ↗
(container, e)

Source from the content-addressed store, hash-verified

2541var d3_mouse_bug44083 = /WebKit/.test(navigator.userAgent) ? -1 : 0;
2542
2543function d3_mousePoint(container, e) {
2544 var svg = container.ownerSVGElement || container;
2545 if (svg.createSVGPoint) {
2546 var point = svg.createSVGPoint();
2547 if ((d3_mouse_bug44083 < 0) && (window.scrollX || window.scrollY)) {
2548 svg = d3.select(document.body)
2549 .append("svg")
2550 .style("position", "absolute")
2551 .style("top", 0)
2552 .style("left", 0);
2553 var ctm = svg[0][0].getScreenCTM();
2554 d3_mouse_bug44083 = !(ctm.f || ctm.e);
2555 svg.remove();
2556 }
2557 if (d3_mouse_bug44083) {
2558 point.x = e.pageX;
2559 point.y = e.pageY;
2560 } else {
2561 point.x = e.clientX;
2562 point.y = e.clientY;
2563 }
2564 point = point.matrixTransform(container.getScreenCTM().inverse());
2565 return [point.x, point.y];
2566 }
2567 var rect = container.getBoundingClientRect();
2568 return [e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop];
2569};
2570d3.touches = function(container, touches) {
2571 if (arguments.length < 2) touches = d3_eventSource().touches;
2572 return touches ? d3_array(touches).map(function(touch) {

Callers 1

d3.v2.jsFile · 0.70

Calls 2

appendMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected