Skip to main content

Module model

Module model 

Source
Expand description

Core scene-graph data model for FD documents.

The document is a DAG (Directed Acyclic Graph) where nodes represent visual elements (shapes, text, groups) and edges represent parent→child containment. Styles and animations are attached to nodes. Layout is constraint-based — relationships are preferred over raw positions. Position { x, y } is the escape hatch for drag-placed or pinned nodes.

Structs§

AnimKeyframe
A property animation keyframe.
AnimProperties
Animatable property overrides.
Color
RGBA color. Stored as 4 × f32 [0.0, 1.0].
Edge
A visual connection between two endpoints.
FlowAnim
A flow animation attached to an edge.
FontSpec
GradientStop
A gradient stop.
Import
A file import declaration: import "path.fd" as namespace.
ResolvedBounds
Resolved absolute bounding box after constraint solving.
SceneGraph
The complete FD document — a DAG of SceneNode values.
SceneNode
A single node in the scene graph.
Shadow
Stroke
Style
A reusable theme set that nodes can reference via use: theme_name.

Enums§

AnimTrigger
The trigger for an animation.
Annotation
Structured annotation attached to a scene node. Parsed from spec { ... } blocks in the FD format.
ArrowKind
Arrow head placement on an edge.
Constraint
Constraint-based layout — no absolute coordinates in the format.
CurveKind
How the edge path is drawn between two nodes.
Easing
Easing function.
EdgeAnchor
An edge endpoint — either connected to a node or a free point in scene-space.
FlowKind
Flow animation kind — continuous motion along the edge path.
LayoutMode
Group layout mode (for children arrangement).
NodeKind
The node kinds in the scene DAG.
Paint
Fill or stroke paint.
PathCmd
A single path command (SVG-like but simplified).
StrokeCap
StrokeJoin
TextAlign
Horizontal text alignment.
TextVAlign
Vertical text alignment.

Functions§

hex_val
Helper to parse a single hex digit.