# `Macaw.Frame.Charts.Waterfall`
[🔗](https://github.com/dcoai/macaw_frame/blob/v0.1.0/lib/macaw/frame/charts/waterfall.ex#L1)

`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"

# `doc`

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

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

# `fixtures`

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

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

# `fragment`

```elixir
@spec fragment() :: map()
```

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

# `id`

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

The fragment's id in the catalog store.

# `kind`

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

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

# `namespace`

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

Its namespace (spec/13 §2).

# `parameters`

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

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

# `slots`

```elixir
@spec slots() :: %{required(String.t()) =&gt; map()}
```

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
