humio/elm-dashboard/6.0.1

Dashboard

A dashboard library for moving and resizing widgets.

Lifecycle

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

a Task that will give you the initial dashboard model.

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

Widgets

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