Class UiDiagram

java.lang.Object
ai.mindconnect.ui.model.UiNode
ai.mindconnect.ui.ext.diagram.UiDiagram

public class UiDiagram extends UiNode
Renderer node for displaying a directed graph as an interactive SVG canvas. The primary use case in this codebase is rendering WorkflowData as an activity diagram, but the node is intentionally domain-agnostic — any server-side producer can build a UiDiagram.

Lives in its own extension module rather than the smaller extensions because the editor pipeline this module grows into (Phase 2 + 3) brings substantial extra weight: ELK layout, Web-Component event plumbing, and a domain-specific patch type. Co-locating it with the small markdown / jsonviewer extensions would dilute that module's "tiny third-party-backed renderers" focus.

Wire shape:


 {
   "type": "diagram",
   "id": "wf-42",
   "width": 800,
   "height": 600,
   "nodes": [ {"id": "n1", "shape": "event-start", "position": {...}}, ... ],
   "edges": [ {"id": "e1", "source": "n1", "target": "n2", "kind": "flow"}, ... ]
 }
 

The subtype is registered with Jackson via UiDiagramModule, which Spring Boot picks up automatically through UiDiagramAutoConfiguration; non-Spring consumers can call mapper.findAndRegisterModules() to register it via ServiceLoader.

The matching front-end handler lives at src/main/ts/diagram/extension.ts in the same module and is loaded by the host page via import("/sui-ext/diagram/extension.js").