mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-07 03:00:26 -04:00
viz: small fixups from memory graph (#11017)
* don't need div.id * tooltip z-index
This commit is contained in:
@@ -205,7 +205,8 @@
|
||||
}
|
||||
#tooltip {
|
||||
position: absolute;
|
||||
background: #1e2029;
|
||||
z-index: 4;
|
||||
background-color: #1e2029;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
pointer-events: none;
|
||||
|
||||
@@ -262,10 +262,9 @@ async function renderProfiler() {
|
||||
for (const [k, { timeline }] of Object.entries(layout)) {
|
||||
if (timeline.shapes.length === 0) continue;
|
||||
const div = deviceList.appendChild(document.createElement("div"));
|
||||
div.id = k;
|
||||
div.innerText = k;
|
||||
div.style.padding = `${padding}px`;
|
||||
const { y:baseY, height:baseHeight } = rect(`#${k}`);
|
||||
const { y:baseY, height:baseHeight } = rect(div);
|
||||
const levelHeight = baseHeight-padding;
|
||||
const offsetY = baseY-canvasTop+padding/2;
|
||||
for (const [i,e] of timeline.shapes.entries()) {
|
||||
@@ -380,7 +379,7 @@ async function renderProfiler() {
|
||||
tooltip.style.display = "block";
|
||||
tooltip.style.left = (e.pageX+10)+"px";
|
||||
tooltip.style.top = (e.pageY)+"px";
|
||||
tooltip.textContent = foundRect.tooltipText;
|
||||
tooltip.innerText = foundRect.tooltipText;
|
||||
} else tooltip.style.display = "none";
|
||||
});
|
||||
canvas.addEventListener("mouseleave", () => tooltip.style.display = "none");
|
||||
|
||||
Reference in New Issue
Block a user