Skip to content

Graph

A directed graph of linked boxes and wires, drawn once at build time and laid out in layers.

Installation

// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/graph.css";
import { smoothPath, graphSvg } from "capsomer/behavior/graph";

API reference

Functions

FunctionSignatureDoes
smoothPath(pts: readonly Point[]): stringA wire through dagre's points as one smooth curve (Catmull-Rom as cubic Béziers), so wires that share a rank read as separate strands rather than a tangle of corners.
graphSvg(o: GraphOptions): string

Parts and data attributes

ClassIs
.cap-graphthe root
.cap-graph-boxa part
.cap-graph-carda part
.cap-graph-heada part
.cap-graph-namea part
.cap-graph-ringa part
.cap-graph-ring-labela part
.cap-graph-scrollera part
.cap-graph-statusa part
.cap-graph-suba part
.cap-graph-svga part
.cap-graph-wirea part
AttributeValues
data-tonecrit ok warn
StateRead from
:focus-visiblethe platform
:hoverthe platform

Accessibility

No manual NVDA or VoiceOver run is planned (decision of 2026-11-07); the automated browser checks and a front-end review stand in.