Architecture
The repository keeps product-neutral diagram data separate from platform rendering:
mermaid-coreturns source into a typed AST and source-located diagnostics.mermaid-layout-apidefines layout input/output and draw-command seams.mermaid-layout-simplesupplies the permissive deterministic starter layout. A future ELK adapter is isolated because ELK/elk-swift are EPL-2.0, not MIT.mermaid-render-svgserializes common data; an ASCII renderer may be added later as a separate module.mermaid-kuiklyreserves the future host text-measurement and drawing adapter seam; its native renderer is not implemented yet. No DOM, WebView, or JavaScript type belongs incommonMain.
The AST intentionally has no coordinates or font assumptions. Layout receives a text-measurement seam and returns stable geometry. This makes parser tests and geometry tests deterministic while allowing Android, iOS, and OHOS fonts to remain platform-specific.
Public modules share one version and are published with Gradle Module Metadata. Consumers should depend on exact published artifacts rather than source or composite builds.