mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
viz: split all long labels with ... (#14794)
This commit is contained in:
@@ -353,7 +353,11 @@ async function renderProfiler(path, unit, opts) {
|
||||
colorMap.set(colorKey, d3.rgb(color));
|
||||
}
|
||||
const fillColor = colorMap.get(colorKey).brighter(0.3*depth).toString();
|
||||
const label = parseColors(e.name).map(({ color, st }) => ({ color, st, width:ctx.measureText(st).width }));
|
||||
const label = parseColors(e.name).flatMap(({ color, st }) => {
|
||||
const parts = [];
|
||||
for (let i=0; i<st.length; i+=4) { const part = st.slice(i, i+4); parts.push({ color, st:part, width:ctx.measureText(part).width }); }
|
||||
return parts;
|
||||
});
|
||||
let shapeRef = e.ref;
|
||||
if (shapeRef != null) { ref = {ctx:e.ref, step:0}; shapeRef = ref; }
|
||||
else if (ref != null) {
|
||||
|
||||
Reference in New Issue
Block a user