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

+2 -2
View File
@@ -376,8 +376,8 @@ describe('devGraph endpoint', () => {
const app = createApp({ modules: [M], devGraph: true });
const s = await app.listen(0);
const html = await fetch(`http://127.0.0.1:${portOf(s)}/__graph__`).then((r) => r.text());
expect(html).toContain('class="mermaid"');
expect(html).toContain('flowchart');
expect(html).toContain('cytoscape');
expect(html).toContain('/api/u/me');
const mmd = await fetch(`http://127.0.0.1:${portOf(s)}/__graph__`, { headers: { accept: 'text/plain' } });
expect(mmd.headers.get('content-type')).toContain('text/plain');
expect(await mmd.text()).toContain('flowchart');