Graph Visualization
After compiling a pipeline, describe_graph() returns a Mermaid diagram string that shows every node and edge in the compiled graph. Paste it into GitHub Markdown, documentation, or mermaid.live for a visual DAG.
describe_graph()
Section titled “describe_graph()”from neograph import compile, describe_graph
graph = compile(pipeline)print(describe_graph(graph))Output (varies by pipeline):
%%{init: {'flowchart': {'curve': 'linear'}}}%%graph TD; __start__([<p>__start__</p>]) decompose(decompose) classify(classify) report(report) __end__([<p>__end__</p>]) __start__ --> decompose; decompose --> classify; classify --> report; report --> __end__;Where to paste it
Section titled “Where to paste it”- GitHub — wrap in a
```mermaidfenced code block in any Markdown file, PR description, or issue. - mermaid.live — paste the raw string into the editor for an interactive diagram.
- Documentation — Starlight, Docusaurus, and other doc frameworks render Mermaid natively.
- CLI — print to stderr/stdout during development for a quick topology check.
Error handling
Section titled “Error handling”If the compiled graph does not support Mermaid rendering (e.g., a non-standard backend), describe_graph() returns "(graph visualization not available)" instead of raising.
Dev-mode DAG summary
Section titled “Dev-mode DAG summary”Set the NEOGRAPH_DEV environment variable to get an automatic DAG summary printed to stderr after every compile() call:
NEOGRAPH_DEV=1 python my_pipeline.pyOutput on stderr:
[neograph-dev] Compiled 'ingestion' (4 nodes): START -> decompose decompose -> classify classify -> report report -> ENDThis shows every edge in the compiled graph, including conditional edges (marked [conditional]). The summary prints automatically — no code changes required.
Documentation © 2025-2026 Constantine Mirin, mirin.pro. Licensed under CC BY-ND 4.0.