View Source Tucan.View (tucan v0.4.0)
Helper utilities for customizing the plot view.
Summary
Functions
Sets the background color of the visualization canvas.
Sets the background color of the view.
Functions
@spec set_background(vl :: VegaLite.t(), color :: String.t()) :: VegaLite.t()
Sets the background color of the visualization canvas.
Examples
Tucan.scatter(:iris, "sepal_width", "sepal_length")
|> Tucan.View.set_background("#fcffde")
@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.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")