View Source Luminous.Dashboard behaviour (luminous v1.3.2)
A dashboard is a high-level component initialized by the dashboard
live view. It contains all the necessary dashboard attributes such as the
panels, variables and the time range selector. It is initialized at
compile time using define/3
and populated at runtime using populate/1
.
Link to this section Summary
Callbacks
The dashboard uses a TimeRangeSelector and a default time range must be defined.
The consumer can optionally implement this callback, in case they want to
inject custom parameters in other callbacks (e.g. Luminous.Variable.variable/2
).
Those parameters can be used to scope the callback results.
Functions
Initialize and return a dashboard at compile time.
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 with a new one.
Update the dashboard's variables with a new list.
Link to this section Types
@type t() :: %Luminous.Dashboard{ action: atom(), panels: [Luminous.Panel.t()], path: (... -> binary()), time_range_selector: Luminous.TimeRangeSelector.t(), time_zone: binary(), title: binary(), variables: [Luminous.Variable.t()] }
Link to this section Callbacks
@callback default_time_range(binary()) :: Luminous.TimeRange.t()
The dashboard uses a TimeRangeSelector and a default time range must be defined.
@callback parameters(Phoenix.LiveView.Socket.t()) :: map()
The consumer can optionally implement this callback, in case they want to
inject custom parameters in other callbacks (e.g. Luminous.Variable.variable/2
).
Those parameters can be used to scope the callback results.
Link to this section Functions
Initialize and return a dashboard at compile time.
@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 with a new one.
@spec update_variables(t(), [Luminous.Variable.t()]) :: t()
Update the dashboard's variables with a new list.