shamansir / elm-graph-render / Graph.Geometry

Geometry


type alias Geometry a =
( AreaSize
, Graph.Tree.Forest ( Position
, a ) 
)

Geometry is used to store previously-calculated positions of items in Tree.Forest as well as the items themselves.

To build up Geometry a from Tree.Forest a, use one of:


type alias Position =
{ x : Basics.Float, y : Basics.Float }

Position of the item on the area

fold : (Position -> a -> acc -> acc) -> acc -> Geometry a -> List acc

Fold Geometry into list using items' positions.

forest : Geometry a -> Graph.Tree.Forest ( Position, a )

Get Forest with positions from Geometry

Sizes

none : AreaSize

Empty area.

areaSize : Geometry a -> { width : Basics.Float, height : Basics.Float }

Get size of the geometry area.


type ItemSize
    = ItemSize ({ width : Basics.Float, height : Basics.Float })

The size of the item in the Tree, to differ it from AreaSize.


type AreaSize
    = AreaSize ({ width : Basics.Float, height : Basics.Float })

The size of the complete area taken by Geometry, to differ it from ItemSize.