Definitively.Visualize (definitively v0.2.1)

Copy Markdown

Renders workflow programs as Graphviz graphs via Graphvix.

Builds a directed graph from Definitively.Domain.Program states and transitions.

Summary

Functions

CLI helper: render workflow visualizations under the workspace.

Loads a YAML program and builds a Graphvix graph.

Parses CLI flags after the program path.

Renders a program to DOT, PNG, or SVG.

Returns DOT source for a program file.

Types

cli_mode()

@type cli_mode() :: :default | :single

parsed_cli()

@type parsed_cli() :: {cli_mode(), atom() | nil, String.t() | nil}

Functions

cli_render(path, rest)

@spec cli_render(Path.t(), [String.t()]) ::
  {:ok, {:files, [String.t()]}} | {:error, term()}

CLI helper: render workflow visualizations under the workspace.

Default mode writes DOT and PNG to .definitively/visualizations/<basename>. Single mode writes one format; omit --out to use the same default directory.

graph(path)

@spec graph(Path.t()) :: {:ok, Graphvix.Graph.t()} | {:error, term()}

Loads a YAML program and builds a Graphvix graph.

parse_cli_opts(args)

@spec parse_cli_opts([String.t()]) :: parsed_cli()

Parses CLI flags after the program path.

render(path, opts \\ [])

@spec render(
  Path.t(),
  keyword()
) :: {:ok, String.t()} | {:error, term()}

Renders a program to DOT, PNG, or SVG.

Options:

  • :format:dot, :png, or :svg
  • :out — output path without extension

to_dot(path)

@spec to_dot(Path.t()) :: {:ok, String.t()} | {:error, term()}

Returns DOT source for a program file.