# `AshDiagram.Renderer`
[🔗](https://github.com/team-alembic/ash_diagram/blob/v0.2.3/lib/ash_diagram/renderer.ex#L1)

Behaviour for rendering AshDiagram diagrams.

# `color`

```elixir
@type color() :: String.t()
```

# `dimension`

```elixir
@type dimension() :: pos_integer()
```

# `format`

```elixir
@type format() :: :svg | :png | :pdf
```

# `option`

```elixir
@type option() ::
  {:theme, theme()}
  | {:format, format()}
  | {:width, dimension()}
  | {:height, dimension()}
  | {:background_color, color()}
  | {:config_file, Path.t()}
  | {:svg_id, String.t()}
  | {:scale, float()}
  | {:puppeteer_config_file, Path.t()}
  | {:icon_packs, [String.t()]}
```

Single rendering option for customizing diagram output.

## Available Options

- `{:theme, theme()}` - Visual theme (`:default`, `:forest`, `:dark`, `:neutral`)
- `{:format, format()}` - Output format (`:svg`, `:png`, `:pdf`)
- `{:width, dimension()}` - Output width in pixels
- `{:height, dimension()}` - Output height in pixels
- `{:background_color, color()}` - Background color (e.g., `"white"`, `"#ffffff"`)
- `{:config_file, Path.t()}` - Path to Mermaid configuration file
- `{:svg_id, String.t()}` - Custom SVG element ID
- `{:scale, float()}` - Scale factor for output (e.g., `1.0`, `2.0`)
- `{:puppeteer_config_file, Path.t()}` - Path to Puppeteer configuration
- `{:icon_packs, [String.t()]}` - List of icon pack names

## Examples

    # Set dark theme with PNG output
    [{:theme, :dark}, {:format, :png}]

    # High resolution SVG with custom size
    [{:format, :svg}, {:width, 1920}, {:height, 1080}, {:scale, 2.0}]

    # PDF with custom background color
    [{:format, :pdf}, {:background_color, "#f8f9fa"}]

# `options`

```elixir
@type options() :: [option()]
```

List of rendering options. See `t:option/0` for available options.

# `theme`

```elixir
@type theme() :: :default | :forest | :dark | :neutral
```

# `render`

```elixir
@callback render(diagram :: iodata(), options :: options()) :: iodata()
```

Render the diagram to the specified format.

# `supported?`

```elixir
@callback supported?() :: boolean()
```

Determine if the current environment supports this renderer.

# `render`

```elixir
@spec render(diagram :: iodata(), options :: options()) :: iodata()
```

Render the diagram to the specified format, using the configured renderer.

---

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