Foundation crate for rusty-mermaid: primitives, Scene, Theme, geometry, and text measurement.
This crate defines the universal intermediate representation that all diagram
types produce and all rendering backends consume. The central type is [Scene],
a collection of [Primitive] drawing elements (rects, circles, paths, text, etc.)
that is completely backend-agnostic.
Key types
- [
Scene] / [Primitive] -- the contract between layout and rendering - [
Theme] / [Style] / [TextStyle] -- visual configuration - [
Color] / [Point] / [BBox] -- geometric primitives - [
Shape] -- node shape catalog (rect, diamond, circle, etc.) - [
Direction] -- layout flow direction (TB, BT, LR, RL)
Key traits
- [
Renderer] -- backends implement this to consume a [Scene] - [
TextMeasure] -- text dimension measurement for layout
Examples
use ;
let mut scene = new;
// Add a filled rectangle
scene.push;
// Add a text label
scene.push;
assert_eq!;