# `Macaw.Frame.Layers.Choose`
[🔗](https://github.com/dcoai/macaw_frame/blob/v0.1.0/lib/macaw/frame/layers/choose.ex#L1)

The `choose` kind (spec/04 §4.15), copied from visualize's `Visualize.Chart.Mark`
`:choose`: each row drawn by the case its value names.

| Channel | Role, family | Types | |
|---|---|---|---|
| `x` | position, `x` | time, number, category | req |
| `y` | position, `y` | number, category | req |
| `series` | series | category, text, number | |

Keys of its own: `on` (a field, required), `cases` (a map from a value's spelling to a
**choice**) and `else` (a choice). A choice is a node of `kind` (`circle`, `symbol`,
`text` or `rect`), `channels`, `options`, `style` and `label`: its channels are the choose
layer's with its own over them. A value names a case by its spelling, never made into an
atom; a value no case names draws `else`, and with no `else` nothing. The rows are split
by case, each case's rows drawn by its child kind over exactly those rows, the cases in
the order of their names, then `else`, in one group `class="mw-layer mw-layer-choose"`.
**Coverage** (`coverage/3`): an `on` field whose schema declares `values` needs a case for
each, or an `else`; a missing one is `{:uncovered, values}` at `cases`. Legend: the
declared values, each swatched by its case's style. Budget: `w`. Summary word: the first
case kind's.

# `coverage`

```elixir
@spec coverage(map(), Macaw.Data.Schema.t() | nil, list()) :: [Macaw.Base.Fault.t()]
```

The coverage of a choose layer node by its slot's schema (§4.15): a declared value of
`on` with no case and no `else` is `{path ++ [:cases], {:uncovered, values}}`.

# `keys`

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

The kind's own keys of the layer node: `on`, `cases` and `else` (spec/02 §5.3).

---

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