View Source Luminous.Panel behaviour (luminous v1.3.0)

A panel represents a single visual element (chart) in a dashboard contains many queries.

Link to this section Summary

Callbacks

transform a query result to view data acc. to the panel type

Functions

Initialize a panel at compile time.

Returns the DOM id of the given panel.

Refresh all panel queries.

Link to this section Types

@type panel_type() :: :chart | :stat | :table
@type t() :: %Luminous.Panel{
  description: binary(),
  hook: binary(),
  id: atom(),
  queries: [Luminous.Query.t()],
  stacked_x: boolean(),
  stacked_y: boolean(),
  title: binary(),
  type: panel_type(),
  unit: binary(),
  xlabel: binary(),
  y_max_value: number(),
  y_min_value: number(),
  ylabel: binary()
}

Link to this section Callbacks

@callback transform(Luminous.Query.Result.t()) :: any()

transform a query result to view data acc. to the panel type

Link to this section Functions

Link to this function

define(id, title, type, queries, opts \\ [])

View Source
@spec define(atom(), binary(), panel_type(), [Luminous.Query.t()], Keyword.t()) :: t()

Initialize a panel at compile time.

@spec dom_id(t()) :: binary()

Returns the DOM id of the given panel.

Link to this macro

is_panel(type)

View Source (macro)
Link to this function

refresh(panel, variables, time_range)

View Source

Refresh all panel queries.