| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Strings.Svg.Layout
Description
Port-aware layout of untyped string diagrams (SDiagram).
Coordinates use chart-svg data space (y increases upward). Morphisms
compose left-to-right (SThenD); tensor stacks top-to-bottom
(SBeside). That matches the left/right port model and the wall-chart
schematics — not the wording slip in the requirements bullet that had
composition stacking vertically.
Every primitive emits its boundary ports on a uniform vertical grid
with portPitch spacing, so thenL aligns whole port lists pairwise
and besideL concatenates port lists slot by slot. A port-count
mismatch in thenL is a wiring error: the connection is truncated to
the common prefix and each unmatched port is marked with a dangling
stub and dot, so the error is visible rather than silent.
Synopsis
- data Layout = Layout {}
- layoutSDiagram :: SDiagram -> Layout
- layoutWidth :: Layout -> Double
- layoutHeight :: Layout -> Double
- moveLayout :: Point Double -> Layout -> Layout
- countCharts :: Layout -> Int
- countLines :: Layout -> Int
- countRects :: Layout -> Int
- countPaths :: Layout -> Int
- countGlyphs :: Layout -> Int
- unitW :: Double
- boxH :: Double
- composeGap :: Double
- tensorGap :: Double
- portPitch :: Double
Documentation
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 #
countGlyphs :: Layout -> Int Source #
Glyph charts (spider dots, port pads, wiring-error markers).
composeGap :: Double Source #
Gap between sequential (then) cells.