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.Viewer

type alias Model node =
{ zoom : Float
, offset : Offset
, viewportBox : MeasureState
, panning : Bool
, layout : Layout ( String, node )
, transitions : Bool
}
type Msg
{ toId : node -> String
, viewportBox : Maybe Box
}
-> Layout node
-> Model node
update : Msg -> Model node -> Model node
subscriptions : Model node -> (Msg -> msg) -> Maybe (Int -> Int -> Decoder msg) -> Sub msg
focusOn : { id : String } -> Model node -> Model node

Center on a specific node by id. Zoom remains the same.

{ id : String
, onlyHorizontally : Bool
, offsetX : Int
, offsetY : Int
}
-> Model node
-> Model node
seeAll : Model node -> Model node

Center and zoom as much as necessary to fit the whole content if possible.

{ bounded : Bool
, offsetY : Float
}
-> Model node
-> Model node
setOffset : Offset -> Model node -> Model node

Set the viewport offset relative to layout dimensions.

Values are limited to the middle point of the viewport to prevent users from scrolling away completely.

type alias Offset =
{ x : Float
, y : Float
}
zoomCenter : (Float -> Float) -> Model node -> Model node

Set the zoom level while focusing on the center of the viewport.

withTransitions : Model node -> Model node

Transition to new offset or zoom level.

setViewportBox : Box -> Model node -> Model node

Set viewport box explicitly.

Note: Resizes will override this.

{ toId : node -> String
, layout : Layout node
}
-> Model node
-> Model node

Update layout but keep the same zoom and offset.

{ id : String
, model : Model node
, toMsg : Msg -> msg
, viewNode : Lazy4 na nb nc nd (( String, node ) -> Box -> Html msg)
, viewBranchLabel : node -> Bool -> Maybe (BranchLabel msg)
, viewConnection :
Lazy
ca
( ConnectionEnding ( String, node )
-> ConnectionEnding ( String, node )
-> Path
-> Html msg
)
, scaledSvgExtra : Maybe (List (Html msg))
}
-> Html msg
type alias BranchLabel msg =
{ view : Html msg
, offsetY : Int
}
type alias Lazy a r =
{ fn : a -> r
, a : a
}
type alias Lazy4 a b c d r =
{ fn : a -> b -> c -> d -> r
, a : a
, b : b
, c : c
, d : d
}
{ viewerId : String
, nodeId : String
}
-> String

Get the full id of a specific node to target it in a CSS stylesheet.

{ viewerId : String
, nodeId : String
, branch : Bool
}
-> String

Get the full id of a branch label to target it in a CSS stylesheet

Model node
-> Float
-> Float
-> { x : Int
, y : Int
}

Convert page coords to viewport coords according to zoom and offset

resizeMsgBox : Msg -> Maybe Box