Expand description
SVG rendering backend for rusty-mermaid.
Converts a Scene into an SVG string by
walking each primitive and emitting the corresponding SVG element. Marker
definitions are generated per-color so arrow heads match their edge stroke.
Implements the Renderer trait from core
(Output = String).
§Key types
SvgRenderer– the rendering backend.SvgConfig– padding, default stroke color/width. UseSvgConfig::from_themeto derive settings from aTheme.
SvgRenderer::render_themed adds a background <rect> when the theme
background is not white (e.g. dark themes).
§Examples
use rusty_mermaid_core::{Renderer, Scene};
use rusty_mermaid_svg::SvgRenderer;
let scene = Scene::new(200.0, 100.0);
let svg: String = SvgRenderer::new().render(&scene);
assert!(svg.contains("<svg"));Modules§
Structs§
- SvgConfig
- SVG-specific rendering configuration.
- SvgRenderer
- SVG rendering backend. Converts a Scene to an SVG string.