Boxart.Render (Boxart v0.3.2)

Copy Markdown View Source

Draw orchestrator: combines layout, routing, and rendering into final output.

Drawing order (back to front):

  1. Subgraph borders (background)
  2. Nodes (boxes)
  3. Edge lines
  4. Edge corners
  5. Arrow heads
  6. T-junctions (where edges leave nodes)
  7. Edge labels
  8. Subgraph labels

Summary

Functions

Renders a graph to a string.

Renders a graph and returns the Canvas struct.

Types

render_opts()

@type render_opts() :: [
  charset: :unicode | :ascii,
  padding_x: non_neg_integer(),
  padding_y: non_neg_integer(),
  gap: non_neg_integer()
]

Functions

render_graph(graph, opts \\ [])

@spec render_graph(Boxart.Graph.t(), render_opts()) :: String.t()

Renders a graph to a string.

Returns "" for empty graphs.

render_graph_canvas(graph, opts)

@spec render_graph_canvas(Boxart.Graph.t(), render_opts()) :: Boxart.Canvas.t() | nil

Renders a graph and returns the Canvas struct.

Returns nil for empty graphs.