View Source Luminous.Dashboard behaviour (luminous v2.0.0)

A dashboard is the highest-level Luminous 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 by use Luminous.Live 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 behaviour). Those parameters can be used to scope the callback results.

Functions

Parse the supplied parameters according to the @attributes schema and return the dashboard map structure

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

Link to this section Callbacks

Link to this callback

default_time_range(binary)

View Source
@callback default_time_range(binary()) :: Luminous.TimeRange.t()

The dashboard uses a TimeRangeSelector and a default time range must be defined.

Link to this callback

parameters(t)

View Source (optional)
@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 behaviour). Those parameters can be used to scope the callback results.

Link to this section Functions

@spec define!(keyword()) :: t()

Parse the supplied parameters according to the @attributes schema and return the dashboard map structure

Link to this function

path(dashboard, socket, params)

View Source
@spec path(t(), Phoenix.LiveView.Socket.t(), Keyword.t()) :: binary()

Returns the LV path for the specific dashboard based on its configuration.

Link to this function

populate(dashboard, params)

View Source
@spec populate(t(), map()) :: t()

Populate the dashboard's dynamic properties (e.g. variable values, time range etc.) at runtime.

Link to this function

update_current_time_range(dashboard, time_range)

View Source
@spec update_current_time_range(t(), Luminous.TimeRange.t()) :: t()

Update the dashboard's current time range with a new one.

Link to this function

update_variables(dashboard, new_variables)

View Source
@spec update_variables(t(), [Luminous.Variable.t()]) :: t()

Update the dashboard's variables with a new list.