jxxcarlson/elm-tree-builder/4.0.2

NOTE: the latest version is 7.0.0

Tree.Render

Functions for transforming a tree or a forest to a string.

toString : Int -> (a -> String) -> Tree a -> String

The first argument is the quantum of indentation. The second is a function for transforming a node of a tree to a string.

forestToString : Int -> (a -> String) -> List (Tree a) -> String

The first argument is the quantum of indentation. The second is a function for transforming a node of a forest to a string.

type alias Preferences =
{ halfAngle : Float
, initialEdgeLength : Float
, scaleFactor : Float
, ballRadius : Float
, ballColor : String
}

Preferences for function toGraph.

defaults : Preferences

Default Preferences

toGraph : Preferences -> (a -> String) -> Tree a -> Graph

Transform a Tree to a Graph: a data structure that can be rendered to SVG.