toSvg

fun toSvg(graph: Vista, palette: ASILPalette.Style = ASILPalette.defaultStyle, iconSprite: String? = null): String

Renders the laid-out graph to an SVG string.

When iconSprite is non-null, the exporter parses out every <symbol id="stig-icons-…"> element from it and inlines them inside <defs> of the output SVG. Each rendered node then emits a <use href="#stig-icons-…"> at its top-left corner — the SVG is self-contained, so even when viewed as a standalone file (no Dokka asset pipeline), the icons resolve.

Pass the verbatim contents of stig-icons.svg (read from the plugin's classpath) as iconSprite; pass null to suppress icon rendering entirely (smaller output, no icons).

Generated with STIG