Choreo.Requirement.Render.DOT (Choreo v0.11.0)

Copy Markdown View Source

Graphviz DOT rendering for Choreo.Requirement diagrams.

Renders requirements as boxes colored by risk, components as rounded boxes, tests as stadiums, and stakeholders as circles. Relationship edges are labeled and styled by their type.

Summary

Functions

Renders a requirements diagram to a DOT string.

Functions

theme(name \\ :default, overrides \\ [])

@spec theme(
  atom(),
  keyword()
) :: Choreo.Theme.t()

Returns a theme for Choreo.Requirement DOT diagrams.

to_dot(req, opts \\ [])

@spec to_dot(
  Choreo.Requirement.t(),
  keyword()
) :: String.t()

Renders a requirements diagram to a DOT string.

Options

  • :theme:default, :dark, :warm, :forest, :ocean, or a Choreo.Theme struct
  • :direction:tb (default), :td (alias for :tb), :lr, :bt, :rl

Examples

iex> req = Choreo.Requirement.new() |> Choreo.Requirement.add_requirement(:a, id: "R1", text: "A")
iex> dot = Choreo.Requirement.Render.DOT.to_dot(req)
iex> String.contains?(dot, "digraph")
true