diff --git a/backend/resources/app/templates/graph-console.tmpl b/backend/resources/app/templates/graph-console.tmpl
index b6e387eec3..837006f277 100644
--- a/backend/resources/app/templates/graph-console.tmpl
+++ b/backend/resources/app/templates/graph-console.tmpl
@@ -166,13 +166,9 @@ Graph Console
- Renders the in-memory Ladybug graph with AntV G6 (CDN). Node color
- and glyph encode the node table; edges are IsChildOf
- (arrow points to parent). With "fold containers" on, anything with
- children (except the root) renders as a foldable box: double-click
- to collapse or expand. Redraws automatically after live changes
- (fold state survives redraws). Very large graphs need an explicit
- "Render anyway".
+ Live view of the in-memory Ladybug graph (AntV G6); the legend
+ shows what is displayed. Double-click folds containers when
+ folding is on.
'
+ ''
+ (GLYPH_CHARS[s.glyph] || "●") + ' '
+ escapeHtml(table) + "";
- // join with a space: the spans are nowrap, so the separator is the
- // only soft-wrap opportunity in the legend row
- }).join(" ");
+ }
+ const items = Object.keys(NODE_STYLES)
+ .filter(function (t) { return tables[t]; })
+ .map(function (t) { return nodeItem(t, NODE_STYLES[t]); });
+ Object.keys(tables).sort().forEach(function (t) {
+ if (!NODE_STYLES[t]) items.push(nodeItem(t, FALLBACK_STYLE));
+ });
+ Object.keys(rels).sort().forEach(function (rel) {
+ const s = edgeStyle(rel);
+ items.push(''
+ + ''
+ + (s.lineDash ? "⇢" : "→") + ' '
+ + escapeHtml(rel) + "");
+ });
+ // join with a space: the spans are nowrap, so the separator is the
+ // only soft-wrap opportunity in the legend row
+ el.innerHTML = items.join(" ");
}
function graphStatusText(data) {
@@ -634,6 +676,7 @@ Graph Console
function renderCurrent() {
if (!lastGraphData) return;
const data = filteredGraphData();
+ renderGraphLegend(data);
const anywayBtn = document.getElementById("graph-render-anyway");
const filterBtn = document.getElementById("graph-filter-reset");
if (filterBtn) filterBtn.style.display = graphFilterIds ? "inline" : "none";
@@ -1072,7 +1115,6 @@ Graph Console
connect();
refreshSyncStatus();
- renderGraphLegend();
refetchGraph();
window.addEventListener("beforeunload", function () {