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:
4 files changed
+162
-24
No files matched your search
+3
-3
@@ -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) };
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user