viz: canonicalize device name colors (#11921)

This commit is contained in:
qazal
2025-08-30 18:12:30 +03:00
committed by GitHub
parent a4f05ebd1a
commit c86ee5bfaf

View File

@@ -219,7 +219,7 @@ async function renderProfiler() {
levels.push(et);
} else levels[depth] = et;
if (depth === 0) colorKey = e.name.split(" ")[0];
if (!colorMap.has(colorKey)) colorMap.set(colorKey, cycleColors(colorScheme[k] ?? colorScheme.DEFAULT, colorMap.size));
if (!colorMap.has(colorKey)) colorMap.set(colorKey, cycleColors(colorScheme[k.split(":")[0]] ?? colorScheme.DEFAULT, colorMap.size));
const fillColor = d3.color(colorMap.get(colorKey)).brighter(depth).toString();
const label = parseColors(e.name).map(({ color, st }) => ({ color, st, width:ctx.measureText(st).width }));
if (e.ref != null) ref = {ctx:e.ref, step:0};