Module

LayeredLayout.Graph

Package
purescript-layered-layout
Repository
markgrafhq/purescript-layered-layout

#silhouetteOverflow Source

silhouetteOverflow :: Shape -> Number -> Number -> { bottom :: Number, left :: Number, right :: Number, top :: Number }

How far a shape's drawn silhouette pokes past its bounding rect, per edge, for a node of width w and height h. The Cloud's arcs rise above the top, the Cylinder's bulge and the Document's wave droop below the bottom. Rectangles (and pill/parallelogram/diamond, which stay inside the rect) overflow nowhere. The renderer's path builders and the layout's framing both read these so the painted region always covers the silhouette. Canonical home for the silhouette constants; Render.Draw re-exports them so the path builders stay in lockstep.

#cylinderBottomDrop Source

cylinderBottomDrop :: Number

The cylinder body extends this many pixels past pos.y + h so its bottom bulge covers the first slice of an incoming edge.

#cloudHatRatio Source

cloudHatRatio :: Number

Cloud arcs reach this fraction of the node height above the bbox top.

#documentWaveDrop Source

documentWaveDrop :: Number

Fraction of node height the document wave dips below the bbox bottom (the wave bottoms out at 1.05·h in Render.Draw.documentPath).

#parseShape Source

parseShape :: String -> Maybe Shape

Parse a user-facing shape name (case-insensitive) from +node id {shape: cylinder}.

#shapeName Source

shapeName :: Shape -> String

Inverse of parseShape. Used when serializing a Node back to a Document.

#Label Source

newtype Label

A displayable text label attached to a token, node, or edge. Distinct from node/edge ids so the type system catches accidental swaps with NodeId/EdgeId strings.

Constructors

Instances

#Constraints Source

data Constraints

Constructors

Instances

#Port Source

type Port = { id :: PortId, label :: Maybe String, offset :: Int, side :: Side }

#Node Source

type Node = { id :: NodeId, label :: Maybe String, ports :: Array Port, shape :: Shape, size :: GridSize }

#Endpoint Source

type Endpoint = { node :: NodeId, port :: Maybe PortId }

#Edge Source

type Edge = { from :: Endpoint, id :: EdgeId, label :: Maybe Label, to :: Endpoint }

#edgeHasArrowhead Source

#Graph Source

type Graph = { constraints :: Array Constraints, edges :: Array Edge, nodes :: Array Node }

#readEnum Source

readEnum :: forall a rep. Generic a rep => GenericEnumSumRep rep => Foreign -> F a

#writeEnum Source

writeEnum :: forall a rep. Generic a rep => GenericEnumSumRep rep => a -> Foreign