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

Helper utilities for customizing the plot view.

# `set_background`

```elixir
@spec set_background(vl :: VegaLite.t(), color :: String.t()) :: VegaLite.t()
```

Sets the background color of the visualization canvas.

## Examples

```tucan
Tucan.scatter(:iris, "sepal_width", "sepal_length")
|> Tucan.View.set_background("#fcffde")
```

# `set_view_background`

```elixir
@spec set_view_background(vl :: VegaLite.t(), color :: String.t()) :: VegaLite.t()
```

Sets the background color of the view.

`set_background/2` defines the background of the whole visualization canvas. Meanwhile,
the view property of a single-view or layer specification can define the background of
the view.

## Examples

Two concatenated plots with different view backgrounds and an overall canvas
background.

```tucan
Tucan.hconcat(
  [
    Tucan.scatter(:iris, "sepal_width", "sepal_length")
    |> Tucan.View.set_view_background("#e6fae1"),
    Tucan.scatter(:iris, "petal_width", "petal_length")
    |> Tucan.View.set_view_background("#facbc5"),
  ]
)
|> Tucan.View.set_background("#fcffde")
```

---

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