View Source hexpm

Repo: git@github.com:hexpm/hexpm.git

Default

Output

FormatDocumentImage
DBMLView
DOTViewView
QuickDBDView
PlantUMLViewView
MermaidView

No fields

Output

FormatDocumentImage
DOTViewView
MermaidView

Config file

# .ecto_erd.exs
[
  columns: []
]

Contexts as clusters

Output

FormatDocumentImage
DBMLView
DOTViewView
PlantUMLViewView

Config file

# .ecto_erd.exs
alias Ecto.ERD.Node

[
  map_node: fn
    %Node{schema_module: schema_module} = node ->
      case Module.split(schema_module) do
        [_] -> node
        [namespace, _] -> node |> Node.set_cluster(namespace)
        parts -> node |> Node.set_cluster(parts |> Enum.take(2) |> Enum.join("."))
      end
  end
]

Contexts as clusters (no fields)

Output

FormatDocumentImage
DOTViewView
PlantUMLViewView

Config file

# .ecto_erd.exs
alias Ecto.ERD.Node

[
  columns: [],
  map_node: fn
    %Node{schema_module: schema_module} = node ->
      case Module.split(schema_module) do
        [_] -> node
        [namespace, _] -> node |> Node.set_cluster(namespace)
        parts -> node |> Node.set_cluster(parts |> Enum.take(2) |> Enum.join("."))
      end
  end
]

Only selected cluster (Accounts context)

Output

FormatDocumentImage
DBMLView
DOTViewView
QuickDBDView
PlantUMLViewView

Config file

# .ecto_erd.exs
alias Ecto.ERD.Node

[
  map_node: fn
    %Node{schema_module: schema_module} = node ->
      cluster_name = schema_module |> Module.split() |> Enum.take(2) |> Enum.join(".")
      case cluster_name do
        "Hexpm.Accounts" -> node |> Node.set_cluster(cluster_name)
        _ -> nil
      end
  end
]

Only embedded schemas

Output

FormatDocumentImage
DOTViewView
PlantUMLViewView

Config file

# .ecto_erd.exs
alias Ecto.ERD.Node

[
  map_node: fn
    %Node{source: nil} = node -> node
    _ -> nil
  end
]