Skip to main content

Module dataflow

Module dataflow 

Source
Expand description

Dataflow graph intermediate representation for Algebraic TSX

This module provides the dataflow graph model that connects geometric state to DOM operations. Unlike virtual DOM, this represents a static graph of transformations that can be optimized at compile time.

§Key Concepts

  • Node: A computation unit (source, transform, projection, sink)
  • Edge: Data dependency between nodes
  • Graph: The complete dataflow network

§Dataflow Semantics

GeometricState ──┬── Projection ──► DOM Text
                 │
                 ├── Transform ───► Projection ──► DOM Style
                 │
                 └── Sink ────────► Event Handler

§Example

use cliffy_core::dataflow::{DataflowGraph, Node, NodeKind};

let mut graph = DataflowGraph::new();

// Add a source node (geometric state)
let state_id = graph.add_node(Node::source("counter_state"));

// Add a projection to extract the count
let proj_id = graph.add_node(Node::projection("count_text", "scalar_to_string"));

// Connect source to projection
graph.connect(state_id, proj_id);

// Add a sink (DOM text content)
let sink_id = graph.add_node(Node::sink("span_text", "textContent"));
graph.connect(proj_id, sink_id);

Structs§

DataflowGraph
A dataflow graph representing the transformation pipeline.
GraphBuilder
Builder for constructing dataflow graphs fluently.
Node
A node in the dataflow graph.
ProjectionSpec
Specification for a projection node.
SinkSpec
Specification for a sink node.

Enums§

CombinerType
Type of combiner for multiple inputs.
NodeKind
The kind of computation a node performs.
RotationPlane
Plane of rotation in 3D.
TransformType
Type of geometric transformation.

Type Aliases§

NodeId
A unique identifier for a node in the dataflow graph.