Skip to content

Commit a85dd8b

Browse files
cpcloudclaude
andcommitted
docs(website): debug label SVG structure (temporary)
Log all label/loop elements from pre.mermaid containers to console. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 24a2688 commit a85dd8b

1 file changed

Lines changed: 12 additions & 21 deletions

File tree

docs/layouts/_default/baseof.html

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -228,27 +228,6 @@
228228
parent.replaceChild(frag, textNode);
229229
});
230230

231-
// Debug: log labelBox SVG structure to console for inspection.
232-
svg.querySelectorAll(".labelBox").forEach(function(box, i) {
233-
var g = box.closest("g");
234-
if (!g) return;
235-
var text = g.querySelector(".labelText");
236-
if (!text) return;
237-
console.log("labelBox[" + i + "]:", {
238-
boxY: box.getAttribute("y"),
239-
boxH: box.getAttribute("height"),
240-
boxW: box.getAttribute("width"),
241-
textY: text.getAttribute("y"),
242-
textDY: text.getAttribute("dy"),
243-
textDomBaseline: text.getAttribute("dominant-baseline"),
244-
textBBox: text.getBBox(),
245-
tspans: Array.from(text.querySelectorAll("tspan")).map(function(ts) {
246-
return { y: ts.getAttribute("y"), dy: ts.getAttribute("dy"), text: ts.textContent };
247-
}),
248-
outerHTML: g.outerHTML.substring(0, 500)
249-
});
250-
});
251-
252231
// Widen note rects when monospace text overflows the original box.
253232
svg.querySelectorAll(".note").forEach(function(noteRect) {
254233
var g = noteRect.closest("g");
@@ -276,6 +255,18 @@
276255
}
277256
});
278257
});
258+
259+
// Debug: dump labelBox structure from all mermaid containers.
260+
document.querySelectorAll("pre.mermaid").forEach(function(pre, pi) {
261+
var labels = pre.querySelectorAll("[class*='label'], [class*='loop']");
262+
console.log("mermaid[" + pi + "] label/loop elements:", labels.length);
263+
labels.forEach(function(el, i) {
264+
console.log(" [" + i + "]", el.tagName, el.getAttribute("class"),
265+
"y=" + el.getAttribute("y"),
266+
"h=" + el.getAttribute("height"),
267+
el.outerHTML.substring(0, 300));
268+
});
269+
});
279270
</script>
280271

281272
{{ partial "theme-toggle.html" . }}

0 commit comments

Comments
 (0)