Skip to content

rune-kit: First-party interactive node graph editor #2532

Backlog

Description

@Vricken

React Flow provides a reusable interaction model for node-based interfaces, including workflow editors, visual programming environments and interactive diagrams.

Rune already provides much of the necessary infrastructure through Canvas / ZoomPan (#720), El::virtual_items (#997), canvas input handlers and vector shapes.

Would a first-party interactive node graph component fit within Rune Kit's intended scope?

Core capabilities

  • Arbitrary Rune elements as custom nodes, including interactive controls.
  • Draggable nodes with stable identities.
  • Configurable connection handles.
  • Interactive connection creation, validation and removal.
  • Custom edge rendering, styles and labels.
  • Single, multiple and marquee selection.
  • Application-owned graph state and interaction callbacks.
  • Efficient viewport culling and partial updates.
  • Integration with the existing canvas, theming and motion systems.

An initial implementation could focus on nodes, edges, dragging and selection, reusing the existing viewport infrastructure.

Additional functionality such as snapping, minimaps, grouping and automatic layout could follow independently.

Reference: https://reactflow.dev/

Activity

  1. opencodejr commented on Nov 27, 2026

    @opencodejr
    Contributor

    no node graph component or earlier request exists in the repo today. most of the core pieces are already on dev: El::virtual_items (#997, crates/rune/src/el/items.rs) for zero-view-run culling, El::live_offset / El::live_scale for camera transforms, Path::cubic_to + Shape::stroke_path (crates/rune-core/src/shape.rs) for bezier edges, and drag/wheel/magnify/key handlers.

    one notable mismatch with the existing kit canvas: rune_kit::Canvas / ZoomPan (crates/rune-kit/src/zoom_pan/) models a bounded [w, h] content box with clamped pan and rebuilds via El::scale, whereas an infinite node graph using El::virtual_items needs an unbounded Live-driven camera so panning, zooming and culling stay off the view path.

    two product and design questions before building anything:

    1. scope and placement: should a first-party interactive node graph editor live in rune-kit (default or behind an opt-in cargo feature like markdown / mermaid in crates/rune-kit/Cargo.toml), or in a separate companion crate beside rune-mermaid?
    2. camera and state api: should it introduce an unbounded Live-backed camera (or add an unbounded mode to ZoomPan) paired with El::virtual_items, and should graph mutations follow react flow's change-event callbacks (on_nodes_change / on_edges_change / on_connect) or rune-kit's lens-based state pattern (TableState / TreeModel) for an initial slice (nodes, handles, edges, drag, selection, connection creation)?
  2. Vricken commented on Nov 27, 2026

    @Vricken
    Author
    1. Scope and placement: I think there is a useful distinction between a general-purpose interactive canvas and a node graph editor.

    Positioning arbitrary elements, dragging, selection, coordinate transformations and efficient viewport culling are useful for whiteboards, design tools, diagram editors and many other applications, independently of node graphs.

    Ideally, these capabilities would be available as general-purpose canvas primitives in Rune or Rune Kit, with graph-specific functionality such as connection handles and edges implemented as a higher-level component. An optional Cargo feature for the graph component makes sense.

    1. Camera: An unbounded Live-backed camera paired with El::virtual_items sounds like the right approach. Panning, zooming, dragging and viewport culling should remain independent of full view rebuilds where possible. Whether this extends ZoomPan or introduces a separate camera abstraction is less important than preserving those properties.

    2. State API: I'd prefer React Flow-style typed change events and callbacks, with application-owned graph state. A lens-based convenience API could coexist with this if appropriate.

    It would also be useful to distinguish interaction lifecycle events (begin, update, commit, cancel). For example, dragging multiple nodes should provide continuous visual feedback but be representable as a single undoable operation.

    Stable node and edge identifiers, programmatic graph manipulation, and the ability to capture and restore viewport state would make undo/redo, persistence and collaborative editing easier without requiring the framework to implement those application-specific systems itself.

    The proposed initial scope of nodes, handles, edges, dragging, selection and connection creation sounds good. The main consideration is ensuring that the underlying canvas abstractions remain reusable outside node graphs.

  3. opencodejr commented on Nov 27, 2026

    @opencodejr
    Contributor

    that split makes sense: reusable unbounded canvas primitives (camera, coordinate transforms, viewport culling, dragging, selection, viewport snapshot/restore) underneath an optional feature-gated node graph layer with typed change events and begin / update / commit / cancel interaction phases.

    one technical detail from the code on avoiding full view rebuilds during interaction: El::live_offset, El::live_scale and El::live_rect with Tx::live_only() already keep camera moves, per-node drags and marquee boxes off view, and El::virtual_items handles culling on the remount path. Shape has no Live binding today (only El::live_trim on stroke span), so updating edges attached to a dragged node mid-drag would either swap only the affected edge keys inside El::virtual_items (still without rebuilding view) or need a live-shape primitive in rune.

    leaving this under needs-design for a maintainer call on scope and crate placement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions