circuits-diagrams
Safe HaskellNone
LanguageGHC2024

Strings.Svg

Description

String-diagram SVG rendering for circuits-diagrams via chart-svg.

Pipeline:

  1. Build a typed Diagram (or an untyped SDiagram).
  2. Forget types with skeleton (if needed).
  3. layoutSDiagramLayout (ports + bounds + ChartTree).
  4. renderLayout / renderSDiagramChartOptions.
  5. writeChartOptions → SVG file.
Synopsis

Re-exports from circuits-diagrams

Layout

data Layout Source #

Laid-out diagram with boundary ports and bounding box.

Instances

Instances details
Eq Layout Source # 
Instance details

Defined in Strings.Svg.Layout

Methods

(==) :: Layout -> Layout -> Bool #

(/=) :: Layout -> Layout -> Bool #

Show Layout Source # 
Instance details

Defined in Strings.Svg.Layout

layoutSDiagram :: SDiagram -> Layout Source #

Layout an untyped skeleton at the origin (first left port near x=0).

Render

renderLayout :: Layout -> ChartOptions Source #

Render a Layout to chart options (no hud).

renderSDiagram :: SDiagram -> ChartOptions Source #

Layout then render an untyped skeleton.

renderDiagram :: Diagram a da b db -> ChartOptions Source #

Forget types via skeleton, then render.

equalityRow :: Layout -> Layout -> Layout Source #

Place two layouts side by side with an equals sign between them.

withBackground :: Rect Double -> ChartTree -> ChartTree Source #

Dark background rect behind a chart tree, spanning the given bounds.

Palette

Examples