WolframModel.BranchialGraphSVG (WolframModel v1.3.0)

Copy Markdown View Source

SVG rendering of the branchial graph returned by WolframModel.branchial_graph/1.

Each node represents a possible rule match at the current state. An edge connects two nodes when their matched hyperedges overlap, meaning the two rule applications conflict (they cannot both be applied without first resolving the branch).

Nodes are placed on a circle and coloured by rule name. The label shows the rule name (truncated) and which hyperedges it matched.

Example

universe
|> WolframModel.branchial_graph()
|> WolframModel.BranchialGraphSVG.to_svg()
|> then(&File.write!("branchial.svg", &1))

Summary

Functions

Returns an SVG string for branchial_data.

Functions

to_svg(map, opts \\ [])

@spec to_svg(
  %{nodes: [map()], edges: [map()]},
  keyword()
) :: String.t()

Returns an SVG string for branchial_data.

Options:

  • :width / :height — canvas size in pixels (default 480).
  • :title — optional label at the top.