Macaw.Builtin.Stat (macaw v0.6.0)

Copy Markdown View Source

The built-in stat (spec/05 §6.3), "macaw.stat": one number from a slot's rows, with its label and unit, of kind :content, :pure.

  • parameters: label (text, "", the field's label from the schema when empty); reduce (Macaw.Builtin.Reading.reduces/0, "latest", bindable); digits ("", or "0" to "6" decimal places; "" for the measure's own) and format ("", or a d3-format specifier over the number, a fault at its name when it's none), as Macaw.Builtin.Reading.writing_parameters/0 gives them;
  • declarations: one slot, rows, with roles value (a :number) and t (the window field, optional, which latest and delta read by); reading load :glance;
  • order and budget: latest and delta ask for the rows newest first, latest for one row;
  • markup: the label as a heading, then the number in a <data>, written by its field's measure (Macaw.Builtin.Reading.writer/3), its unit included. A slot with no readings shows an en dash, never zero. latest or delta with no time field draws invalid. A capped or stale number draws its notice above it, but for a latest that is the whole answer (Macaw.Builtin.Reading.notice/4);
  • stylesheet: stylesheet/0, served at stylesheet_path/0, its content address.

Summary

Functions

The stat's one static stylesheet, every color a theme custom property with the default theme's value as its fallback. It loads and imports nothing.

The stylesheet's path, its content address (Macaw.Component.Stylesheet.path/1).

Functions

stylesheet()

@spec stylesheet() :: String.t()

The stat's one static stylesheet, every color a theme custom property with the default theme's value as its fallback. It loads and imports nothing.

stylesheet_path()

@spec stylesheet_path() :: String.t()

The stylesheet's path, its content address (Macaw.Component.Stylesheet.path/1).