# `Tucan.Layers`
[🔗](https://github.com/pnezis/tucan/blob/v0.6.0/lib/tucan/layers.ex#L1)

Utility functions for working with layered plots.

# `append`

```elixir
@spec append(vl :: VegaLite.t(), VegaLite.t() | [VegaLite.t()]) :: VegaLite.t()
```

Appends the given layer or layers to the input specification.

If no `layer` exists in the input spec, a new layer object will be added
with the `encoding` and `mark` options of the input spec.

Raises if the input `vl` is not a single view or layered specification.

# `prepend`

```elixir
@spec prepend(vl :: VegaLite.t(), VegaLite.t() | [VegaLite.t()]) :: VegaLite.t()
```

Prepends the given layer or layers to the input specification.

If no `layer` exists in the input spec, a new layer object will be added
with the `encoding` and `mark` options of the input spec.

Raises if the input `vl` is not a single view or layered specification.

# `to_layered`

```elixir
@spec to_layered(vl :: VegaLite.t()) :: VegaLite.t()
```

Converts a single view plot to a layered plot.

`encoding`, `mark` and `data` will be extracted and added to a new layer.

---

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