Helper functions for rendering trees:
import Tree.Build
import Tree.Transform
-- Build the tree from text
tree =
Tree.Build.fromString "?" identity "1\n 2\n 3\n 4\n"
-- Build the graph
graph =
Result.map (Tree.Transform.toGraph preferences identity) tree |> Result.withDefault []
-- Render the graph. The first argument is the label style.
Tree.Svg.render NoLabel (Tree.Svg.transform 280 100 60 60 0.5 graph)Render a graph to SVG
Transform: shift by (dx, dy) and rescale by (sx,sy,sr)