Tucan.Layers (tucan v0.5.0)

View Source

Utility functions for working with layered plots.

Summary

Functions

Appends the given layer or layers to the input specification.

Prepends the given layer or layers to the input specification.

Converts a single view plot to a layered plot.

Functions

append(vl, layers)

@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(vl, layers)

@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(vl)

@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.