| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Strings.Svg
Description
String-diagram SVG rendering for circuits-diagrams via chart-svg.
Pipeline:
- Build a typed
Diagram(or an untypedSDiagram). - Forget types with
skeleton(if needed). layoutSDiagram→Layout(ports + bounds +ChartTree).renderLayout/renderSDiagram→ChartOptions.writeChartOptions→ SVG file.
Synopsis
- module Circuit.Poly.StringDiagram
- data Layout = Layout {}
- layoutSDiagram :: SDiagram -> Layout
- layoutWidth :: Layout -> Double
- layoutHeight :: Layout -> Double
- countCharts :: Layout -> Int
- countLines :: Layout -> Int
- countRects :: Layout -> Int
- countPaths :: Layout -> Int
- renderLayout :: Layout -> ChartOptions
- renderSDiagram :: SDiagram -> ChartOptions
- renderDiagram :: Diagram a da b db -> ChartOptions
- equalityRow :: Layout -> Layout -> Layout
- withBackground :: Rect Double -> ChartTree -> ChartTree
- module Strings.Svg.Palette
- module Strings.Svg.Examples
Re-exports from circuits-diagrams
module Circuit.Poly.StringDiagram
Layout
Laid-out diagram with boundary ports and bounding box.
Constructors
| Layout | |
layoutSDiagram :: SDiagram -> Layout Source #
Layout an untyped skeleton at the origin (first left port near x=0).
layoutWidth :: Layout -> Double Source #
layoutHeight :: Layout -> Double Source #
countCharts :: Layout -> Int Source #
countLines :: Layout -> Int Source #
countRects :: Layout -> Int Source #
countPaths :: Layout -> Int Source #
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
module Strings.Svg.Palette
Examples
module Strings.Svg.Examples