# `WolframModel.HypergraphSVG`
[🔗](https://github.com/sragli/wolfram_model/blob/main/lib/wolfram_model/hypergraph_svg.ex#L1)

SVG rendering of a `Hypergraph` state.

Vertices are placed with a force-directed spring layout (Fruchterman-Reingold
style). Rendering conventions:
- **Unary** hyperedges: dashed ring around the vertex.
- **Binary** hyperedges: directed line with an arrowhead (order preserved).
- **N-ary** (3+) hyperedges: translucent filled polygon in a distinct colour
  per hyperedge, with a solid border.

## Example

    hg
    |> WolframModel.HypergraphSVG.to_svg(title: "Step 5")
    |> then(&File.write!("hypergraph.svg", &1))

    # Render whole evolution history as a horizontal strip
    model
    |> WolframModel.HypergraphSVG.evolution_to_svg(max_snapshots: 8)
    |> then(&File.write!("evolution.svg", &1))

    # Render in a 3-column grid
    model
    |> WolframModel.HypergraphSVG.evolution_to_svg(max_snapshots: 12, columns: 3)
    |> then(&File.write!("evolution.svg", &1))

# `evolution_to_svg`

```elixir
@spec evolution_to_svg(
  WolframModel.t(),
  keyword()
) :: String.t()
```

Renders the full `evolution_history` of `model` as a grid of panels,
oldest first. Each panel shows one hypergraph snapshot.

Options:
- `:max_snapshots` — maximum panels to show (default `6`).
- `:panel_size` — pixel size of each square panel (default `200`).
- `:columns` — number of panels per row (default: all panels in one row).

# `to_svg`

```elixir
@spec to_svg(
  Hypergraph.t(),
  keyword()
) :: String.t()
```

Returns an SVG string rendering `hg`.

Options:
- `:width` / `:height` — canvas size in pixels (default `500`).
- `:title` — optional label drawn at the top of the canvas.
- `:directed` — draw arrowheads on binary edges (default `true`).

---

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