View Source Luminous.Dashboard (luminous v2.3.0)
A dashboard is the highest-level luminous component and contains all
the necessary dashboard attributes such as the panels, variables and
the time range selector. It also stores the state of the panels
(query results). The dashboard is initialized in Luminous.Live
and populated at runtime using populate/2
.
Link to this section Summary
Functions
Parse the supplied parameters and return the dashboard map structure. The following options are supported
return the panel data for the specified panel
Returns the LV path for the specific dashboard based on its configuration.
Populate the dashboard's dynamic properties (e.g. variable values, time range etc.) at runtime.
Update the dashboard's current time range
Update the dashboard's panel data
Update the dashboard's variables
Link to this section Types
@type t() :: map()
Link to this section Functions
Parse the supplied parameters and return the dashboard map structure. The following options are supported:
:title
(String.t/0
) - Required.:path
(function of arity 3) - Required.:action
(atom/0
) - Required.:panels
(list ofmap/0
) - The default value is[]
.:variables
(list ofmap/0
) - The default value is[]
.:time_range_selector
(struct of type Luminous.TimeRangeSelector) - The default value is%Luminous.TimeRangeSelector{id: nil, current_time_range: nil}
.:time_zone
(String.t/0
) - The default value is"Europe/Athens"
.
return the panel data for the specified panel
@spec path(t(), Phoenix.LiveView.Socket.t(), Keyword.t()) :: binary()
Returns the LV path for the specific dashboard based on its configuration.
Populate the dashboard's dynamic properties (e.g. variable values, time range etc.) at runtime.
@spec update_current_time_range(t(), Luminous.TimeRange.t()) :: t()
Update the dashboard's current time range
Update the dashboard's panel data
@spec update_variables(t(), [Luminous.Variable.t()]) :: t()
Update the dashboard's variables