humio/elm-dashboard/1.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 -> List Widget -> List Widget
String
-> { a | x : Int, y : Int }
-> Config data msg
-> List Widget
-> List Widget

Moves the widget with id to newPoint.

remove : String -> List Widget -> List Widget

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

resize : String -> Rect -> Config data msg -> List Widget -> List Widget

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