Choreo.MindMap.Render.DOT (Choreo v0.14.0)

Copy Markdown View Source

DOT (Graphviz) rendering for Choreo.MindMap.

Produces mind-map oriented visualisation:

  • Root — double circle, bold border, prominent colour
  • Topics — ellipses, medium size
  • Subtopics — boxes, compact
  • Notes — note shape, pale background

Edge styles:

  • Branch — solid grey with arrowhead
  • Associates — dashed grey without arrowhead

Layout is top-down so the root sits at the top and branches flow downward. Siblings at the same depth are aligned on the same rank.

Summary

Functions

Renders a mind map to a DOT string.

Functions

to_dot(map, opts \\ [])

@spec to_dot(Choreo.MindMap.t(), keyword()) :: String.t()

Renders a mind map to a DOT string.

Options

  • :theme:default, :dark, :minimal, :warm, :forest, :ocean, or a Choreo.Theme struct
  • :highlighted_nodes — list of node IDs to highlight
  • :highlighted_edges — list of {from, to} tuples to highlight
  • Any other option accepted by Yog.Render.DOT.to_dot/2, such as :rankdir

Examples

iex> map = Choreo.MindMap.new()
iex> map = map
...>   |> Choreo.MindMap.set_root(:a, label: "A")
...>   |> Choreo.MindMap.add_topic(:b, label: "B")
...>   |> Choreo.MindMap.branch(:a, :b)
iex> dot = Choreo.MindMap.Render.DOT.to_dot(map)
iex> String.contains?(dot, "digraph")
true
iex> String.contains?(dot, "A")
true
iex> String.contains?(dot, "B")
true