humio/elm-dashboard/4.0.0

NOTE: this package is not compatible with Elm 0.19.1

Dashboard

A dashboard library for moving and resizing widgets.

Lifecycle

type alias Model =
DashboardConfig
{ dragState : Maybe DragState
, windowWidth : Int
}
init : DashboardConfig {} -> Task Never Model

a Task that will give you the initial dashboard model.

subscriptions : Model -> Sub Msg
type Msg
Config { toMsg : Msg -> msg }
-> List (Widget data msg)
-> Msg
-> Model
-> ( Model
, Cmd Msg
, Maybe
(List
( String
, { x : Int
, y : Int
, height : Int
, width : Int
}
)
)
)
Config { toMsg : Msg -> msg }
-> Model
-> List (Widget data msg)
-> data
-> Html msg

Widgets

type Widget data msg
widget : String -> Frame -> (data -> Size -> Html 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.