Raxol.UI.Components.Dashboard.Dashboard (Raxol v0.5.0)
View SourceA component responsible for rendering a grid-based dashboard layout. Manages widget placement, drag/drop, and resizing.
Summary
Functions
Initializes the Dashboard state from a saved layout. If no saved layout exists, returns default widgets with the given grid configuration.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Validates a list of widget configurations to ensure they can be properly rendered. Returns true if widgets are valid, false otherwise.
Functions
@spec init_from_saved_layout(list(), map()) :: {:ok, Raxol.UI.Components.Dashboard.Dashboard.Model.t()} | {:error, any()}
Initializes the Dashboard state from a saved layout. If no saved layout exists, returns default widgets with the given grid configuration.
This function loads widget configurations using LayoutPersistence.load_layout/0
and initializes
the dashboard model with those widgets and the provided grid_config.
Returns {:ok, model} on success, or {:error, reason} on failure.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Validates a list of widget configurations to ensure they can be properly rendered. Returns true if widgets are valid, false otherwise.