humio/elm-dashboard/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

Dashboard

Create and layout dashboards in Elm.

Configuration

config : ConfigProps data msg -> Config data msg

A helper function for creating valid configurations.

Modification

add : String -> Rect -> Config data msg -> Model -> Model
move : String -> { a | x : Int, y : Int } -> Config data msg -> Model -> Model

Moves the widget with id to newPoint.

remove : String -> Model -> Model

Removes the widget with id. If the widget is not found the dashboard is unchanged.

resize : String -> Rect -> Config data msg -> Model -> Model

Changes the size of the widget with widgetId to match newRect. The minimum size is 1x1.

update : Msg -> Config data msg -> Model -> ( Model, Cmd Msg )

The update function

type Msg

View

view : Config data msg -> Model -> Html Msg
subscriptions : Model -> Sub Msg

State

type alias Model =
{ widgets : List Widget
, dragState : DragState
}
init : Model

Creates the state that holds layout and dragging info.

initWithWidgets : List Widget -> Model

An initializer for copying dashboards