feat(graph): interactive Cytoscape viewer for /__graph__
CI / build (push) Has been cancelled

Mermaid's static diagram overlaps badly as the graph grows. Replace the
/__graph__ HTML with an interactive Cytoscape.js + dagre viewer (both loaded
from a CDN, so no runtime dependency is added — the one-dep pitch holds).

Clicking a route lights up its real transitive slice and dims the rest;
clicking a provider/step shows its blast radius. Edges are colour-coded by
kind (needs vs feeds-endpoint), provider/step/endpoint nodes are visually
distinct, and nodes are draggable. toMermaid()/toDOT() and the text/plain
path are unchanged.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-07-09 10:44:03 -05:00
1 parent 2db5de6858
commit 27a984f070
4 files changed
+162 -24

No files matched your search

+3 -3
View File
@@ -562,11 +562,11 @@ function devGraphRoute(graph: () => GraphView): RouteDef {
pattern: '/__graph__',
transport: 'buffer',
handler: async (req) => {
const mermaid = toMermaid(graph());
const view = graph();
const accept = String(req.headers['accept'] ?? '');
return accept.includes('text/plain')
? { status: 200, headers: { 'content-type': 'text/plain' }, body: mermaid }
: { status: 200, headers: { 'content-type': 'text/html' }, body: graphHtml(mermaid) };
? { status: 200, headers: { 'content-type': 'text/plain' }, body: toMermaid(view) }
: { status: 200, headers: { 'content-type': 'text/html' }, body: graphHtml(view) };
},
};
}