let currentThreadFilter = 'all';
let isInverted = false;
let useModuleNames = true;
+let zoomedNodeValue = null;
// Heat colors are now defined in CSS variables (--heat-1 through --heat-8)
// and automatically switch with theme changes - no JS color arrays needed!
const selfSamples = d.data.self || 0;
const selfMs = (selfSamples / 1000).toFixed(2);
const percentage = ((d.data.value / data.value) * 100).toFixed(2);
+ const relativePercentage = Math.min(100, ((d.data.value / (zoomedNodeValue ?? data.value)) * 100)).toFixed(2);
const calls = d.data.calls || 0;
const childCount = d.children ? d.children.length : 0;
const source = d.data.source;
<span class="tooltip-stat-label">Percentage:</span>
<span class="tooltip-stat-value accent">${percentage}%</span>
+ ${relativePercentage != percentage && relativePercentage != "100.00" ? `
+ <span class="tooltip-stat-label">Relative Percentage:</span>
+ <span class="tooltip-stat-value accent">${relativePercentage}%</span>
+ ` : ''}
+
${calls > 0 ? `
<span class="tooltip-stat-label">Function Calls:</span>
<span class="tooltip-stat-value">${calls.toLocaleString()}</span>
const percentage = d.data.value / rootValue;
const level = getHeatLevel(percentage);
return heatColors[level];
+ })
+ .onClick(function (d) {
+ zoomedNodeValue = d.data.value;
});
return chart;
d3.select("#chart").datum(data).call(chart);
window.flamegraphChart = chart;
window.flamegraphData = data;
+ zoomedNodeValue = null;
populateStats(data);
}
function resetZoom() {
if (window.flamegraphChart) {
+ zoomedNodeValue = null;
window.flamegraphChart.resetZoom();
}
}