vendrinc/elm-flow-layout/1.0.0

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/vendrinc/elm-flow-layout is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 1.0.0 found (1 same-name repos checked); no cached copy. Use another version.

Details

Flow.Layout

type alias Layout node =
{ nodes : List ( node, Box )
, connections :
List ( ConnectionEnding node, Path, ConnectionEnding node )
, conditionRoots : List (ConditionRoot node)
, size : Size
, left : List ( ConnectionEnding node, Box )
, right : List ( ConnectionEnding node, Box )
}
layout : Pos -> Config node -> Flow node -> Layout node

Compute a Layout from a Flow tree.

type alias Pos =
{ x : Int
, y : Int
}
type alias Config node =
{ nodeProperties : node -> NodeProperties
, connectionY : ConnectionEnding node -> Int
, gapX : Int
, gapY : Int
, conditionBranchGapX : Int
, conditionBranchGapY : Int
, isConditionRoot : node -> Bool
}
type alias NodeProperties =
{ width : Int
, height : Int
, marginLeft : Int
, marginRight : Int
}
= BranchStart
| BranchEnd
| CNode node

Connections are not only drawn between nodes but also branch endings.

If a branch starts or ends with a parallel, we do not want each of the tracks to connect to the condition node directly:

              True
Condition ──╮────── A
            │
            │ False
            ├────── B
            │
            ╰────── C

Instead we want the condition to connect to an "ending" that represents the start of the branch and from which each parallel track starts:

              True
Condition ──╮────── A
            │
            │ False
            ╰──┬─── B
               │
               ╰─── C

This step is only necessary if either of the branch endings are parallel.

type alias Box =
{ x : Int
, y : Int
, width : Int
, height : Int
, connectionY : Int
, marginBoxX : Int
}
type alias ConditionRoot node =
{ condition : node
, branch : Bool
, box : Box
}
mapNodes : (a -> b) -> Layout a -> Layout b

Apply a function to every node in the layout.

type alias Size =
{ width : Int
, height : Int
}