View Source Luminous.Query.Result (luminous v0.9.1)

A query Result wraps a columnar data frame with multiple variables. attrs is a map where keys are variable labels (as specified in the query's select statement) and values are keyword lists with visualization properties for the corresponding DataSet. See Luminous.Query.DataSet.new/3 for details.

Link to this section Summary

Functions

This function can be called in the following ways

Transform the query Result (multiple variables as columns) to a list of Datasets timestamps are converted to unix time in milliseconds (JS-compatible).

Link to this section Types

@type label() :: atom() | binary()
@type point() :: {label(), value()}
@type row() :: [point()]
@type t() :: %Luminous.Query.Result{
  attrs: %{required(binary()) => Luminous.Query.Attributes.t()},
  rows: row()
}
@type value() :: number() | Decimal.t() | binary()

Link to this section Functions

@spec new([row()] | row() | point() | value(), Keyword.t()) :: t()

This function can be called in the following ways:

  • with a list of rows, i.e. a list of lists containing 2-tuples {label, value}
  • with a single row, i.e. a list of 2-tuples of the form {label, value} (e.g. in the case of single- or multi- stats)
  • with a single value (for use in a single-valued stat panel with no label)
@spec transform(t()) :: [Luminous.Query.DataSet.t()]

Transform the query Result (multiple variables as columns) to a list of Datasets timestamps are converted to unix time in milliseconds (JS-compatible).