# `Yog.Multi.DOT`
[🔗](https://github.com/code-shoily/yog_ex/blob/v0.97.1/lib/yog/multi/dot.ex#L1)

DOT (Graphviz) format export for visualizing multigraphs.

This module exports multigraphs (graphs with support for parallel edges)
to the DOT language. It mirrors the capabilities of `Yog.Render.DOT`
but adapts the edge configurations to account for multiple relationships.

## Per-Edge Customization

Because multiple edges can exist between the same nodes, callback functions
pass the unique `edge_id`:

    options = %{
      Yog.Multi.DOT.default_options() |
      edge_attributes: fn from, to, edge_id, weight ->
        if edge_id == 5 do
          [{:color, "red"}, {:style, "dashed"}]
        else
          []
        end
      end
    }

# `arrow_style`

```elixir
@type arrow_style() ::
  :normal
  | :dot
  | :diamond
  | :odiamond
  | :box
  | :crow
  | :vee
  | :inv
  | :tee
  | :none
  | {:custom, String.t()}
```

Arrow head/tail style

# `layout`

```elixir
@type layout() ::
  :dot
  | :neato
  | :circo
  | :fdp
  | :sfdp
  | :twopi
  | :osage
  | {:custom, String.t()}
```

Graphviz layout engine

# `node_shape`

```elixir
@type node_shape() ::
  :box
  | :box3d
  | :circle
  | :cloud
  | :component
  | :cylinder
  | :diamond
  | :doublecircle
  | :ellipse
  | :folder
  | :hexagon
  | :house
  | :invhouse
  | :invtriangle
  | :note
  | :octagon
  | :parallelogram
  | :pentagon
  | :plain
  | :plaintext
  | :point
  | :rect
  | :rectangle
  | :square
  | :tab
  | :trapezoid
  | :triangle
  | :underline
  | {:custom, String.t()}
```

Node shapes

# `options`

```elixir
@type options() :: %{
  node_label: (Yog.Model.node_id(), any() -&gt; String.t()),
  edge_label: (Yog.Multi.Graph.edge_id(), any() -&gt; String.t()),
  highlighted_nodes: [Yog.Model.node_id()] | nil,
  highlighted_edges:
    [Yog.Multi.Graph.edge_id() | {Yog.Model.node_id(), Yog.Model.node_id()}]
    | nil,
  node_attributes: (Yog.Model.node_id(), any() -&gt; [{atom(), String.t()}]),
  edge_attributes: (Yog.Model.node_id(),
                    Yog.Model.node_id(),
                    Yog.Multi.Graph.edge_id(),
                    any() -&gt;
                      [{atom(), String.t()}]),
  subgraphs: [subgraph()] | nil,
  ranks: [{:same | :min | :max | :source | :sink, [Yog.Model.node_id()]}] | nil,
  graph_name: String.t(),
  layout: layout() | nil,
  rankdir: rank_dir() | nil,
  bgcolor: String.t() | nil,
  splines: splines() | nil,
  overlap: overlap() | nil,
  nodesep: float() | nil,
  ranksep: float() | nil,
  node_shape: node_shape(),
  node_color: String.t(),
  node_style: style(),
  node_fontname: String.t(),
  node_fontsize: integer(),
  node_fontcolor: String.t(),
  edge_color: String.t(),
  edge_style: style(),
  edge_fontname: String.t(),
  edge_fontsize: integer(),
  edge_penwidth: float(),
  arrowhead: arrow_style() | nil,
  arrowtail: arrow_style() | nil,
  highlight_color: String.t(),
  highlight_penwidth: float()
}
```

Options for customizing multigraph DOT rendering

# `overlap`

```elixir
@type overlap() :: true | false | :scale | :scalexy | :prism | {:custom, String.t()}
```

Overlap handling

# `rank_dir`

```elixir
@type rank_dir() :: :tb | :lr | :bt | :rl
```

Graph direction (rank direction)

# `splines`

```elixir
@type splines() :: :line | :polyline | :curved | :ortho | :spline | :none
```

Edge routing style

# `style`

```elixir
@type style() ::
  :solid
  | :dashed
  | :dotted
  | :bold
  | :filled
  | :rounded
  | :diagonals
  | :striped
  | :wedged
```

Visual style

# `subgraph`

```elixir
@type subgraph() :: %{
  name: String.t(),
  label: String.t() | nil,
  node_ids: [Yog.Model.node_id()] | nil,
  style: style() | nil,
  fillcolor: String.t() | nil,
  color: String.t() | nil,
  subgraphs: [subgraph()] | nil
}
```

A subgraph (cluster) for grouping nodes visually in the diagram.

# `default_options`

```elixir
@spec default_options() :: options()
```

Creates default DOT options with multigraph labeling capabilities.

# `to_dot`

```elixir
@spec to_dot(Yog.Multi.Graph.t(), options()) :: String.t()
```

Converts a multigraph (`Yog.Multi.Graph`) to DOT syntax.

---

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