Skip to main content

Module svg

Module svg 

Source
Expand description

SVG Renderer for simulation visualization.

Consumes Vec<RenderCommand> and outputs Grid Protocol SVG strings for consumption by rmedia’s native SVG producer (type="svg").

§Grid Protocol Compliance

Output SVGs follow the Grid Protocol specification:

  • Canvas: 1920x1080, viewBox matches width/height
  • 16x9 grid (120px cells) for element positioning
  • Dark palette (#0f172a canvas, #1e293b panels)
  • 18px minimum font size, 4.5:1 WCAG AA contrast
  • Element IDs on every <g> group for rmedia targeting

§References

  • SVG Grid Protocol: docs/specifications/svg-grid-protocol.md
  • rmedia SVG producer: paiml/rmedia#6, paiml/rmedia#7

Structs§

SvgConfig
SVG renderer configuration.
SvgRenderer
SVG renderer that consumes render commands and produces SVG strings.

Functions§

color_to_hex
Convert RGBA color to hex string.