Skip to main content

Crate rusty_mermaid_svg

Crate rusty_mermaid_svg 

Source
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::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§

document
markers
path
primitive
style

Structs§

SvgConfig
SVG-specific rendering configuration.
SvgRenderer
SVG rendering backend. Converts a Scene to an SVG string.