Expand description
Generate Graphviz DOT visualizations from Toolpath documents.
Renders Documents — Steps, Paths, and Graphs — as Graphviz DOT
digraphs. Steps become nodes, parent references become edges, and
actor types are color-coded (blue for humans, green for agents,
yellow for tools). Dead ends are highlighted with dashed red borders.
§Example
use toolpath::v1::{Document, Path, PathIdentity, Step};
use toolpath_dot::{render, RenderOptions};
let step = Step::new("step-001", "human:alex", "2026-01-29T10:00:00Z")
.with_raw_change("src/main.rs", "@@ -1 +1 @@\n-old\n+new")
.with_intent("Fix greeting");
let path = Path {
path: PathIdentity { id: "p1".into(), base: None, head: "step-001".into() },
steps: vec![step],
meta: None,
};
let dot = render(&Document::Path(path), &RenderOptions::default());
assert!(dot.contains("digraph toolpath"));Pipe the output through Graphviz to produce images:
path derive git --repo . --branch main | path render dot | dot -Tpng -o graph.pngStructs§
- Render
Options - Options controlling what information is rendered in the DOT output.
Functions§
- actor_
color - Return a fill color for a given actor string.
- escape_
dot - Escape a string for use in DOT label attributes (double-quoted context).
- escape_
html - Escape a string for use inside HTML-like DOT labels.
- render
- Render any Toolpath
Documentvariant to a Graphviz DOT string. - render_
graph - Render a
Graphas a DOT digraph. - render_
path - Render a
Pathas a DOT digraph. - render_
step - Render a single
Stepas a DOT digraph.