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

Provides functions to extend AshDiagram generated diagrams.

Can be implemented in spark extensions to resources and domains to add custom
data to the diagrams.

# `creator`

```elixir
@type creator() ::
  AshDiagram.Data.EntityRelationship
  | AshDiagram.Data.Class
  | AshDiagram.Data.Policy
  | AshDiagram.Data.Architecture
  | AshDiagram.Data.PolicySimulation
```

# `extend_diagram`

```elixir
@callback extend_diagram(creator :: creator(), diagram :: AshDiagram.t(implementation)) ::
  AshDiagram.t(implementation)
when implementation: AshDiagram.implementation()
```

Extends the diagram with additional data.
The function should return the extended diagram.

# `supports?`

```elixir
@callback supports?(creator :: creator()) :: boolean()
@callback supports?(creator :: module()) :: false
```

Checks if the extension creator supports the given creator.

Returns `true` if the creator is supported, `false` otherwise.

The function can add additional creators over time, `false` must be returned
for all creators that are not supported.

---

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