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

Function setNodeHighlight

internal/driver/html/common.js:526–550  ·  view source on GitHub ↗
(n, set)

Source from the content-addressed store, hash-verified

524
525 // Change highlighting of node (returns true if node was found).
526 function setNodeHighlight(n, set) {
527 if (options && options.hiliter) return options.hiliter(n, set);
528
529 const elem = document.getElementById('node' + n);
530 if (!elem) return false;
531
532 // Handle table row highlighting.
533 if (elem.nodeName == 'TR') {
534 elem.classList.toggle('hilite', set);
535 return true;
536 }
537
538 // Handle svg element highlighting.
539 const p = findPolygon(elem);
540 if (p != null) {
541 if (set) {
542 origFill.set(p, p.style.fill);
543 p.style.fill = '#ccccff';
544 } else if (origFill.has(p)) {
545 p.style.fill = origFill.get(p);
546 }
547 }
548
549 return true;
550 }
551
552 function findPolygon(elem) {
553 if (elem.localName == 'polygon') return elem;

Callers 2

unselectFunction · 0.85
selectFunction · 0.85

Calls 3

findPolygonFunction · 0.85
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…