viz: small fixups from memory graph (#11017)

* don't need div.id

* tooltip z-index
This commit is contained in:
qazal
2025-06-28 16:34:14 +03:00
committed by GitHub
parent fc3e509822
commit 508bc68078
2 changed files with 4 additions and 4 deletions

View File

@@ -205,7 +205,8 @@
}
#tooltip {
position: absolute;
background: #1e2029;
z-index: 4;
background-color: #1e2029;
padding: 4px 8px;
border-radius: 4px;
pointer-events: none;

View File

@@ -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");