(n, set)
| 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; |
no test coverage detected
searching dependent graphs…