# `Giggly.Geom.Context`
[🔗](https://github.com/giggleton/giggly/blob/v0.2.0/lib/giggly/geom/context.ex#L1)

What a geom draws with beyond its own rows, handed to `Giggly.Geom.draw_panel/3`, `draw_key/3`
and `key_size/3`: where a panel's rows go and what the panel is like.

A geom asks it where its rows go (`transform/2`, `munch/2`), where the panel ends
(`extents/1`), whether a straight line stays straight (`linear?/1`), whether the panel shows its
marks mirrored (`mirrored?/1`) and where its marks are cut off (`clip/1`). A geom drawing by
delegation hands the context on to the geom it delegates to, as it is. A legend key's context
places nothing, since a key is drawn in no panel.

# `t`

```elixir
@opaque t()
```

# `clip`

```elixir
@spec clip(t()) :: :on | :off | {:outline, [{float(), float()}]}
```

Where what is drawn in the panel is cut off: `:on`, at its edges; `:off`, nowhere; or
`{:outline, points}`, at an outline in the panel's units.

# `extents`

```elixir
@spec extents(t()) :: %{x: {number(), number()}, y: {number(), number()}}
```

Each axis's extent in the panel, `{low, high}`, in the data's positions.

# `linear?`

```elixir
@spec linear?(t()) :: boolean()
```

Whether a straight line in the data stays straight in the panel, so a line's ends may be placed
with `transform/2` alone; where it does not, a line is drawn through `munch/2`.

# `mirrored?`

```elixir
@spec mirrored?(t()) :: boolean()
```

Whether the panel shows its marks mirrored, exactly one of its axes running backwards.

# `munch`

```elixir
@spec munch(t(), Giggly.DataFrame.t()) :: Giggly.DataFrame.t()
```

`frame`'s lines placed in the panel, each cut into steps short enough to follow the panel's
curves: its rows are the lines' points in order, a change of `group` ending one line. Where
straight lines stay straight it places them as `transform/2` does.

# `transform`

```elixir
@spec transform(t(), Giggly.DataFrame.t()) :: Giggly.DataFrame.t()
```

`frame` with its positions placed in the panel, each from 0 at one edge to 1 at the other; its
other columns are left as they are.

---

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