MCPcopy Create free account
hub / github.com/google/pprof / onClick

Function onClick

internal/driver/html/stacks.js:467–480  ·  view source on GitHub ↗
(target, handler)

Source from the content-addressed store, hash-verified

465
466 // Handle clicks, but only if the mouse did not move during the click.
467 function onClick(target, handler) {
468 // Disable click if mouse moves more than threshold pixels since mousedown.
469 const threshold = 3;
470 let [x, y] = [-1, -1];
471 target.addEventListener('mousedown', (e) => {
472 [x, y] = [e.clientX, e.clientY];
473 });
474 target.addEventListener('click', (e) => {
475 if (Math.abs(e.clientX - x) <= threshold &&
476 Math.abs(e.clientY - y) <= threshold) {
477 handler();
478 }
479 });
480 }
481
482 function drawSep(y, posTotal, negTotal) {
483 const m = document.createElement('div');

Callers 1

drawBoxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…