Macaw.Frame.Charts.Waterfall (macaw_frame v0.1.0)

Copy Markdown View Source

charts.waterfall (spec/13 §7.1), a second-cut chart: a bar per category from the running total before it to the running total after it, so the bars step from the first delta to the last, then a total bar from zero. The running totals are macaw_data's cumulative step with before: (macaw_data#336): each row holds the exact sum of the deltas strictly before it and up to it, so a bar's foot is, to the bit, the previous bar's head. The total is macaw_data's sum of the deltas, the same exact sum, folded into one row under the total_label category. The frame computes no statistic.

A rise is the theme's good and a fall its bad (polarity: "higher_is_better", the default), or the reverse when lower is better: two rect layers over macaw_data's filter on the delta's sign, each in its role. An unfilled layer over every step comes first, so the categories lie along x in the rows' order, and labels each bar at its head with its signed delta, so a rise and a fall read apart without their hues. New in the second cut.

iex> Macaw.Frame.Charts.Waterfall.id()
"charts.waterfall"

Summary

Functions

What it draws, for a person and a builder's library.

Its fixtures (spec/14 §1): a quarter's cash flow, from the opening balance.

The fragment: cumulative with before under a rect per step, and the total's rect.

The fragment's id in the catalog store.

What the fragment is: a whole design, or layers placed in one.

Its namespace (spec/13 §2).

Its parameters (spec/13 §3, §7.1).

Its slot: data, a category and its delta, in order.

Functions

doc()

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

What it draws, for a person and a builder's library.

fixtures()

@spec fixtures() :: [map()]

Its fixtures (spec/14 §1): a quarter's cash flow, from the opening balance.

fragment()

@spec fragment() :: map()

The fragment: cumulative with before under a rect per step, and the total's rect.

id()

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

The fragment's id in the catalog store.

kind()

@spec kind() :: :design | :layers

What the fragment is: a whole design, or layers placed in one.

namespace()

@spec namespace() :: :charts | :maps | :diagrams

Its namespace (spec/13 §2).

parameters()

@spec parameters() :: [{String.t(), map()}]

Its parameters (spec/13 §3, §7.1).

slots()

@spec slots() :: %{required(String.t()) => map()}

Its slot: data, a category and its delta, in order.