# `Choreo.C4.Render.DOT`
[🔗](https://github.com/code-shoily/choreo/blob/v0.14.1/lib/choreo/c4/render/dot.ex#L1)

DOT (Graphviz) rendering for `Choreo.C4` architecture diagrams.

Produces C4-model-oriented visualisation:

  * **Person** — ellipse with thick border
  * **Software System** — rectangle with solid border
  * **Container** — rounded rectangle with solid border
  * **Component** — rectangle with dashed border

Relationships are rendered as directed edges with labels.
Clusters group containers by their parent software system and
components by their parent container.

## Further reading

  * [C4 Model notation](https://c4model.com/)
  * [DOT Language Reference](https://graphviz.org/doc/info/lang.html)

# `to_dot`

```elixir
@spec to_dot(Choreo.C4.t(), keyword()) :: String.t()
```

Renders a C4 model to a DOT string.

## Options

  * `:theme` — `:default`, `:dark`, `:warm`, `:forest`, `:ocean`, or a `Choreo.Theme` struct

## Examples

    iex> c4 = Choreo.C4.new()
    iex> c4 = c4
    ...>   |> Choreo.C4.add_person(:user, label: "User")
    ...>   |> Choreo.C4.add_software_system(:app, label: "App")
    ...>   |> Choreo.C4.add_relationship(:user, :app, label: "Uses")
    iex> dot = Choreo.C4.Render.DOT.to_dot(c4)
    iex> String.contains?(dot, "digraph")
    true
    iex> String.contains?(dot, "User")
    true
    iex> String.contains?(dot, "App")
    true

---

*Consult [api-reference.md](api-reference.md) for complete listing*
