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.
EdgeDefaults
Document-level default styles for edges.
FlowAnim
A flow animation attached to an edge.
FontSpec
GradientStop
A gradient stop.
GraphSnapshot
A lightweight snapshot of graph state for diff computation.
Import
A file import declaration: import "path.fd" as namespace.
Properties
A reusable style set that nodes can reference via use: style_name.
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

Enums§

AnimTrigger
The trigger for an animation.
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.
HPlace
Horizontal placement of a child within its parent.
ImageFit
How an image fits within its declared dimensions.
ImageSource
Source for an embedded image.
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.
VPlace
Vertical placement of a child within its parent.

Functions§

hex_val
Helper to parse a single hex digit.