Skip to content

feat: add dsl::toDot, a Graphviz DOT export of a parsed graph - #18

Merged
psyinf merged 1 commit into
mainfrom
feature/to-dot
Sep 19, 2026
Merged

psyinf merged 1 commit into
mainfrom
feature/to-dot

Conversation

@psyinf

@psyinf psyinf commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Implements the Graphviz export from the console-rendering discussion. Stacked on #17. Merge that first; this PR then retargets to main.

What

dsl::toDot(program) renders a parsed graph as a Graphviz DOT digraph. It draws the same picture as toMermaid, with the same node ids:

  • stages are boxes listing their arguments (RunRecord\nlabel=tap)
  • edges are ellipses, shown as in / in.<key> / out / out.<key> / out[i]
  • every -> end gets its own double-bordered box
  • the links of a named group carry the slot names (e3 -> s2 [label="name"];)
std::cout << dsl::toDot(graph.program());   // | dot -Tsvg -o graph.svg, or | graph-easy --as=boxart

Checked against Graphviz 9.0 (dot -Tpng) with the namedPipeline greet graph (named inputs plus a named-slot merge).

Also

  • toMermaid and toDot share detail::edgeDisplayNames / detail::configLines. toMermaid's output is unchanged.
  • TODO.md: the Graphviz item is not listed, since this PR implements it. The console-rendering item (dsl::toAscii) is added as item 7; the stacked follow-up PR implements its first step.

Docs / tests

README (feature list + "Visualizing"), EXAMPLE.md section 6, CHANGELOG. Three new cases: layout/ids, escaping of " and \, slot labels. All 110 tests pass (MSVC debug, ASan).

@psyinf
psyinf deleted the branch main September 19, 2026 20:52
@psyinf psyinf closed this Sep 19, 2026
@psyinf psyinf reopened this Sep 19, 2026
@psyinf
psyinf changed the base branch from docs/named-pipeline to main September 19, 2026 20:53
Renders the same picture as toMermaid, with the same node ids: stages as boxes
listing their arguments, edges as ellipses, a box per dead end, slot names on
the links of a named group. The edge display names and config lines both
renderers use move into shared helpers.

TODO.md: adds the console-rendering item that remains (dsl::toAscii).
@psyinf
psyinf merged commit 878730e into main Sep 19, 2026
3 checks passed
@psyinf
psyinf deleted the feature/to-dot branch September 19, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant