npm.io
2.17.0 • Published 1 month ago

@x12i/graphenix-dot

Licence
MIT
Version
2.17.0
Deps
1
Size
54 kB
Vulns
0
Weekly
0

@x12i/graphenix-dot

Convert Graphenix graph documents and executable lifecycle artifacts to Graphviz DOT language for visualization, debugging, and documentation.

DOT output can be rendered with the Graphviz dot CLI or any compatible viewer:

npm install @x12i/graphenix-dot @x12i/graphenix-core
import { graphenixToDot, executablePlanToDot, toDot } from "@x12i/graphenix-dot";
import { createMinimalExecutableGraph } from "@x12i/graphenix-authoring-format";

const doc = createMinimalExecutableGraph();
const dot = graphenixToDot(doc, { includeNodeParameters: true });

// Write to a file and render:
// dot -Tsvg graph.dot -o graph.svg

Supported inputs

Function Input Purpose
graphenixToDot GraphDocument / authoring graph Design-time topology with graph inputs/outputs
executablePlanToDot ExecutableGraphPlanV2 Compiled plan topology (+ optional execution units)
toDot Either of the above Auto-dispatch by artifact shape
graphenixToDotWithTrace graph + GraphExecutionTraceV2 Color nodes by run status
executablePlanToDotWithTrace plan + trace Same overlay on compiled topology

Options

Common options (DotRenderOptions):

  • direction — layout direction (LR, TB, …). Default: LR.
  • includeGraphInputs / includeGraphOutputs — boundary nodes for graph ports. Default: true.
  • includePortLabels — show port ids on edges. Default: true.
  • includeNodeParameters — include skill/finalizer hints in labels. Default: false.
  • includeSubgraphs — render document subgraphs as DOT clusters. Default: true.
  • useLayout — emit pos from Graphenix node.layout (use with neato/fdp). Default: false.

Plan-specific options:

  • includeExecutionUnits — nested cluster per node showing PRE/MAIN/POST units.
  • highlightDeferredGates — dashed edges where the plan has deferred gates.

Trace overlay uses default fill colors (pending gray, running yellow, completed green, failed red, skipped light gray). Override via statusColors.

Dependencies

  • Peer: @x12i/graphenix-core
  • Runtime: @x12i/graphenix-executable-contracts (plan/trace types)

This package generates DOT text only. It does not bundle Graphviz binaries.

License

MIT

Keywords