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§
- Anim
Keyframe - A property animation keyframe.
- Anim
Properties - Animatable property overrides.
- Color
- RGBA color. Stored as 4 × f32 [0.0, 1.0].
- Edge
- A visual connection between two endpoints.
- Edge
Defaults - Document-level default styles for edges.
- Flow
Anim - A flow animation attached to an edge.
- Font
Spec - Gradient
Stop - A gradient stop.
- Graph
Snapshot - 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. - Resolved
Bounds - Resolved absolute bounding box after constraint solving.
- Scene
Graph - The complete FD document — a DAG of
SceneNodevalues. - Scene
Node - A single node in the scene graph.
- Shadow
- Stroke
Enums§
- Anim
Trigger - The trigger for an animation.
- Arrow
Kind - Arrow head placement on an edge.
- Constraint
- Constraint-based layout — no absolute coordinates in the format.
- Curve
Kind - How the edge path is drawn between two nodes.
- Easing
- Easing function.
- Edge
Anchor - An edge endpoint — either connected to a node or a free point in scene-space.
- Flow
Kind - Flow animation kind — continuous motion along the edge path.
- HPlace
- Horizontal placement of a child within its parent.
- Image
Fit - How an image fits within its declared dimensions.
- Image
Source - Source for an embedded image.
- Layout
Mode - Group layout mode (for children arrangement).
- Node
Kind - The node kinds in the scene DAG.
- Paint
- Fill or stroke paint.
- PathCmd
- A single path command (SVG-like but simplified).
- Stroke
Cap - Stroke
Join - Text
Align - Horizontal text alignment.
- TextV
Align - Vertical text alignment.
- VPlace
- Vertical placement of a child within its parent.
Functions§
- hex_val
- Helper to parse a single hex digit.