View Source Luminous.Dashboard behaviour (luminous v2.6.1)
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
Get the dashboard's current time range
return the panel data for the specified panel
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
Returns the dashboard's URL parameters as a keyword list based on the supplied params and the dashboard's current state
Link to this section Types
Link to this section Callbacks
@callback dashboard_path(Phoenix.LiveView.Socket.t(), url_params()) :: binary()
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.: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"
.
@spec get_current_time_range(t()) :: Luminous.TimeRange.t() | nil
Get the dashboard's current time range
return the panel data for the specified panel
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
@spec url_params(t(), Keyword.t()) :: url_params()
Returns the dashboard's URL parameters as a keyword list based on the supplied params and the dashboard's current state