Skip to main content

A DATA VISUALIZATION TOOLKIT FOR THE WEB

Dagr.

Structure you can explore.
Changes you can follow.

Data visualization built on graph layout, GPU rendering and motion. Compose reading interfaces, charts and visual languages from focused packages. Explore Dagr’s own building blocks below.

Build with Dagr ↗

DAGR, MAPPED WITH DAGR

What fits together.

Eight packages, from graph identity to reading interfaces and charts. Start with dependencies, or switch to the features each layer provides. Select a node for usage, limits and sources.

  • FoundationsGraph · Layout
  • RenderingRender
  • Application surfacesReact · Explorer · Chart
  • CompositionVDSL · Umbrella

Arrows: dependent → dependency. Solid: dependency; dashed: required peer (VDSL is types-only). Umbrella edges also forward exports. External peers are explained in details.

Use Outline to read at a small screen size. Boundaries mark membership, not containment. This map uses Explorer’s SVG/DOM default. Nested layout, drill-down and collapse/expand remain planned. Roadmap ↗

Read packages, features and dependencies without the map

Published baseline is 0.1.4 for the seven public packages. This map describes current repository source, including later work; it does not announce a 0.2.0 publication. Chart public metadata is approved; publication remains pending. Follow the package sources for current details. Graph models parent relationships, but layout ignores parent today. Drill-down (M6.4), collapse/expand and compound layout (M7) remain planned.

Foundations

Graph

The headless directed graph model owns IDs, adjacency, attributes, ports, traversal, serialization and reversible patches. It has zero runtime dependencies. Keep one installed copy: Graph has nominal private fields. The parent field models acyclic containment; layout currently ignores it.

Published baseline: 0.1.4; details describe current source

    Documentation · Source and usage

    Layout

    The headless Sugiyama pipeline returns node boxes and edge routes. createLayout retains stage state for patch-driven relayout and reports influence and absolute deltas. Stability trades against crossings; use the documented corpus for measurements. Graph is a required peer, not a bundled second copy.

    Published baseline: 0.1.4; details describe current source

    • Layout → Graph: required peer

    Documentation · Source and usage

    Rendering

    Render

    The full entry uses three.js WebGPURenderer, WebGPU with WebGL2 fallback, instanced marks, rich DOM overlays and scene springs. It accepts scene geometry, not Graph or LayoutResult, so there is no graph/layout package dependency. The /core entry provides camera, touch and edge-path mechanics without three.js. three is an optional manifest peer but required to import the full entry.

    Published baseline: 0.1.4; details describe current source

      Documentation · Source and usage

      Application surfaces

      React

      DagrCanvas joins the graph model, incremental layout and renderer. Html places React content in world space; useDagr exposes layout and useGraphInteraction shares picking behavior. Current source includes GPU node picking and CPU edge hits. React and React DOM 19 are required, along with graph and render peers.

      Published baseline: 0.1.4; details describe current source

      • React → Layout: dependency
      • React → Graph: required peer
      • React → Render: required peer

      Documentation · Source and usage

      Explorer

      DagrExplorer supplies views, shared search and selection, connection following, camera controls and adaptive details. This homepage uses it directly. The default drawing is SVG plus DOM, using renderer /core, never the GPU renderer or three.js. Current source includes the outline reader and shared touch navigation. Direct installs support React 18 and 19.

      Published baseline: 0.1.4; details describe current source

      • Explorer → Graph: dependency
      • Explorer → Layout: dependency
      • Explorer → Render: dependency (core only)

      Documentation · Source and usage

      Chart

      DagrChart uses D3 scales and arrays for categorical bars, lines and dual axes, with a data table and tooltip. GPU drawing uses render; explicit SVG rendering is also available. Public 0.2.0 metadata is approved; the package is not forwarded by the umbrella. Packed candidate checks do not mean it is published.

      Approved 0.2.0 candidate, not published

      • Chart → Render: dependency

      Documentation · Source and usage

      Composition

      VDSL

      defineRegistry adapts your node kinds, ports and configuration checks. The application supplies semantics and compatibility rules such as sameType. Graph is a types-only required peer; VDSL has no runtime dependencies. Validation does not provide an editor or automatic nested layout.

      Published baseline: 0.1.4; details describe current source

      • VDSL → Graph: types-only peer

      Documentation · Source and usage

      Umbrella

      The @prnt/dagr root forwards Graph. Subpaths forward layout, render, render/core, react, vdsl and explorer. These six packages are manifest dependencies; forwarding is not a new rendering layer. Chart is excluded. The umbrella requires React 19; three is optional for core-only use and needed for full rendering.

      Published baseline: 0.1.4; details describe current source

      • Umbrella → Graph: dependency + forwards
      • Umbrella → Layout: dependency + forwards
      • Umbrella → Render: dependency + forwards
      • Umbrella → React: dependency + forwards
      • Umbrella → VDSL: dependency + forwards
      • Umbrella → Explorer: dependency + forwards

      Documentation · Source and usage

      Feature guide

      Identity and patches

      Stable IDs connect model changes to layout and motion. batch emits one ordered patch; apply and invert support undo. PatchOp is an open union, so consumers need a default case.

      • Graph provides Identity and patches
      Documentation

      Incremental layout

      createLayout consumes patches and exposes stage execution, influence and absolute deltas. Absent means unchanged; removals precede additions. Stability and crossings are measured separately.

      • Layout provides Incremental layout
      • React uses Incremental layout
      Documentation

      GPU drawing and motion

      createRenderer draws scene data; createSceneMotion animates node positions, edge routes and bounds. Full drawing needs three.js. Core camera and path utilities can serve SVG/DOM hosts independently.

      • Render provides GPU drawing and motion
      • React uses GPU drawing and motion
      • Chart uses GPU drawing and motion
      Documentation

      Interaction and picking

      DagrCanvas and useGraphInteraction join pointer and keyboard input with GPU node picking and CPU edge hit targets in current source. Renderer core supplies camera and pinch mechanics, also used by Explorer.

      • React provides Interaction and picking
      Documentation

      Search, outline and details

      Map and outline share one root, query, selection and details drawer. Details connections preserve incoming/outgoing meaning. Groups annotate member bounds; they do not place nested nodes.

      • Explorer provides Search, outline and details
      Documentation

      VDSL validation

      The registry checks declared kinds, ports, directions, capacity and application rules before a connection is added. sameType is an explicit policy, not a universal language type system.

      • VDSL provides VDSL validation
      Documentation

      Bar and line charts

      The current-source chart candidate maps categories and series to bars and lines using D3. GPU and explicit SVG modes share chart geometry. This is not a published chart API commitment.

      • Chart provides Bar and line charts
      Documentation

      THE GRAPH IS THE MEDIUM

      You bring the meaning.
      Dagr brings the structure.

      A service map, a build pipeline, a procedural pattern. Each has its own vocabulary. Dagr handles graph identity, layout, rendering, and motion so your application can define what the connections mean.

      The case for visual languages →

      MEASURE IT HERE

      A bigger graph.
      An actual measurement.

      Run the layout engine on a seeded graph in your browser. This measures layout and the worker round trip on your device, not GPU frame rate. Read the methodology →

      Nodes
      rankSep 42 · nodeSep 4

      Laying out…

      Measuring 1,000 nodes on your device…

      Timed end to end around one runAsync call, so it counts preparing the graph and the trip to the worker, not the pipeline alone. The page's first run is a warm-up and is not reported, which is the rule the repository's own benchmark captures follow. Focus the graph to scroll-zoom, or drag to pan.

      FROM EXPLORING TO BUILDING

      Start with two nodes.

      The graph and layout packages work without a browser. Add the renderer and React bindings when you want a canvas, rich content, and animation.

      Get started →

      Available on npm as @prnt/dagr. Explore the repository ↗

      import { Graph } from '@prnt/dagr-graph';
      import { layout } from '@prnt/dagr-layout';

      const graph = new Graph();
      graph.addNode({ id: 'source' });
      graph.addNode({ id: 'preview' });
      graph.addEdge({ source: 'source', target: 'preview' });

      const result = layout({ graph });
      // Node boxes and routed edges, keyed by your IDs.