A dashboard library for moving and resizing widgets.
{ dragState : Maybe DragState
, windowWidth : Basics.Int
}
init : Task Basics.Never Model
a Task that will give you the initial dashboard model.
subscriptions : Model -> Platform.Sub.Sub Msg
update : DashboardConfig {} -> Internal.Layout.Config { toMsg : Msg -> msg } -> List (Widget data msg) -> Msg -> Model -> ( Model, Platform.Cmd.Cmd Msg, Maybe (List ( String, { x : Basics.Int, y : Basics.Int, height : Basics.Int, width : Basics.Int } )) )
view : DashboardConfig {} -> Internal.Layout.Config { toMsg : Msg -> msg } -> Model -> List (Widget data msg) -> data -> Html msg
widget : String -> Frame -> (data -> Size -> Html msg) -> (data -> List (Html.Attribute msg)) -> Widget data msg
Creates a widget.
the id
must be unique. frame
in the size of the widget in grid dimensions.
toContent
is a function that produces the widget's content. It is passed
the actual size of the widget so you can adjust the content.