* Apply intensity-based heat colors to source spans * Hot spans get orange highlight, cold spans get dimmed * @param {boolean} enable - Whether to enable or disable span coloring
(enable)
| 345 | * @param {boolean} enable - Whether to enable or disable span coloring |
| 346 | */ |
| 347 | function applySpanHeatColors(enable) { |
| 348 | document.querySelectorAll('.instr-span').forEach(span => { |
| 349 | const samples = enable ? (parseInt(span.dataset.samples) || 0) : 0; |
| 350 | if (samples > 0) { |
| 351 | const intensity = samples / (parseInt(span.dataset.maxSamples) || 1); |
| 352 | span.style.backgroundColor = calculateHeatColor(intensity); |
| 353 | span.style.borderRadius = '2px'; |
| 354 | span.style.padding = '0 1px'; |
| 355 | span.style.cursor = 'pointer'; |
| 356 | } else { |
| 357 | span.style.cssText = ''; |
| 358 | } |
| 359 | }); |
| 360 | } |
| 361 | |
| 362 | // ======================================== |
| 363 | // SPAN TOOLTIPS |
no test coverage detected
searching dependent graphs…