Fude.Layer (Fude v0.1.0)

Copy Markdown View Source

One layer of a chart: a kind (:bar, :line...), its channels and its options. A chart has one layer, or several drawn one over the other (Fude.layers/2).

Summary

Functions

A layer of a kind, from the keyword list that the functions of Fude take: channels and options. Raises an ArgumentError that says what is wrong: an unknown key names the keys of the kind.

Types

kind()

@type kind() ::
  :bar
  | :line
  | :area
  | :scatter
  | :bubble
  | :pie
  | :donut
  | :histogram
  | :heatmap
  | :rule
  | :text
  | :sparkline
  | :number
  | :trend
  | :progress
  | :waterfall
  | :funnel
  | :gauge
  | :choropleth
  | :bubble_map

t()

@type t() :: %Fude.Layer{
  channels: %{required(atom()) => Fude.Channel.t()},
  id: String.t() | nil,
  kind: kind(),
  options: map()
}

Functions

new(kind, opts)

@spec new(kind(), keyword()) :: t()

A layer of a kind, from the keyword list that the functions of Fude take: channels and options. Raises an ArgumentError that says what is wrong: an unknown key names the keys of the kind.