API

Deneb.CommonPropertiesType

Common properties of all view specifications. https://vega.github.io/vega-lite/docs/spec.html#common The data, transform and params common properties are defined in dedicated Spec types.

source
Deneb.ConcatSpecType

General concatenation specification. https://vega.github.io/vega-lite/docs/concat.html#concat

source
Deneb.ConcatViewType

Concatenation specifications. https://vega.github.io/vega-lite/docs/concat.html

source
Deneb.DataSpecType

Spec containing the data property of viewable specifications. https://vega.github.io/vega-lite/docs/data.html

source
Deneb.EncodingSpecType

Spec containing the encoding property of a Single or Layered view specification. https://vega.github.io/vega-lite/docs/encoding.html

source
Deneb.HConcatSpecType

Horizontal concatenation specification. https://vega.github.io/vega-lite/docs/concat.html#hconcat

source
Deneb.LayoutPropertiesType

Common properties of all layout (facet, repeat, concat) specifications. https://vega.github.io/vega-lite/docs/spec.html#common

source
Deneb.MarkSpecType

Spec containing the mark property of a Single-View spec. https://vega.github.io/vega-lite/docs/mark.html

source
Deneb.ParamsSpecType

Spec containing the params common property to all viewable specifications. https://vega.github.io/vega-lite/docs/parameter.html

source
Deneb.ResolveSpecType

Spec containing the resolve property common to all Multi-View specifications. https://vega.github.io/vega-lite/docs/resolve.html

source
Deneb.SingleSpecType

Single view specification. https://vega.github.io/vega-lite/docs/spec.html#single

source
Deneb.TopLevelPropertiesType

Top-Level specification of a Vega-Lite specification. https://vega.github.io/vega-lite/docs/spec.html#top-level

source
Deneb.TransformSpecType

Spec containing the transform common property to all viewable specifications. https://vega.github.io/vega-lite/docs/transform.html

source
Deneb.VConcatSpecType

Vertical concatenation specification. https://vega.github.io/vega-lite/docs/concat.html#vconcat

source
Base.:*Method
spec1::AbstractSpec * spec2::AbstractSpec

Multiplication of two AbstractSpec creates a new AbstractSpec as a composition of the two specifications. For instance, vlspec(mark=:bar) * vlspec(title="chart") will be equivalent to vlspec(mark=:bar, title="chart"). Properties defined in spec2 have precedence over spec1, meaning that if a given property is specified in both, then the result specification will use the property from spec2. If the types of the two specs are different then the result spec will be a VegaLiteSpec.

source
Base.:+Method
spec1::ConstrainedSpec + spec2::ConstrainedSpec

The addition of two specs will produce a new spec with both specs layered. The order matters as spec1 will appear below spec2. If the specs contain shared properties (e.g. data, encoding, width...), they will be promoted to the top level specification. Multi-view layout specs (facet, repeat, concat) cannot be layered. However, layered specs can be faceted/repeated/concatenated.

source
Base.getpropertyMethod
getproperty(spec::AbstractSpec, property::Symbol)

Returns property property of a specification.

source
Base.hcatMethod
hcat(A::AbstractSpec...)
[spec1 spec2 spec3 ...]

Horizontal concatenation of specs.

source
Base.hvcatMethod
hvcat(A::AbstractSpec...)
[spec1 spec2; spec3 spec4 ...]

General concatenation of specs.

source
Base.vcatMethod
vcat(A::AbstractSpec...)
[spec1; spec2; spec3 ...]

Vertical concatenation of specs.

source
Deneb.DataMethod
Data(table)
Data(; url, [format], [name])
Data(generator::SymbolOrString; properties...)

Creates a DataSpec containing the data property of a viewable specification. Available constructors are:

  • using a table that supports the Tables.jl interface
  • using a url to load the data from, with optional format and name properties.
  • using a generator with specific properties to a use any of the available Vega-Lite data generator

See more in Vega-Lite's and Deneb's documentation.

source
Deneb.EncodingMethod
Encoding(x; channels...)
Encoding(x, y; channels...)
Encoding(; channels...)

Creates an EncodingSpec containing the encoding property of a single or layer view specification. The x and y channels can be specified as positional arguments using the shorthad string syntax. See more in Vega-Lite's and Deneb.jl's.

Examples

Encoding("monthdate(date):T", "mean(precipitation):Q", color="year(date):O")
Encoding(
    x=field("bin_min:Q", bin=:binned, title="Maximum Daily Temperature (C)"),
    y=field("value:Q", scale=(range=[20, -20]), axis=nothing),
    fill=field="mean_temp:Q",
)
source
Deneb.FacetMethod
Facet(; [row], , [column], kw...)
Facet(field; columns::Int=nothing, kw...)

Creates a FacetSpec for a facet specification. . A field can be passed as a positional argument, or must be passed in the row/column keyword argument.

Examples

Facet("site:O", columns=2, sort=(op=:median, field=:yield))
Facet(row="Origin:N)
source
Deneb.MarkMethod
Mark(type; kw...)
Mark(; spec...)

Creates a MarkSpec containing the mark property of a single view specification. The type property of the mark can be specified as a positional argument. See more in Vega-Lite's and Deneb's documentation.

source
Deneb.ParamsMethod
Params(; spec...)

Creates a ParamsSpec containing the params property of a viewable specification. See also the more convenient select_* methods and the interactive_scales function.

source
Deneb.RepeatMethod
Repeat(; [row::Vector], [column::Vector], [layer::Vector])
Repeat(field::Vector{SymbolOrString}; columns::Int=nothing)

Creates a RepeatSpec for a repeat specification. . A field can be passed as a positional argument, or must be passed in the row/column/layer keyword argument.

Examples

Repeat([:Horsepower, :Miles_per_Gallon, :Acceleration], columns=2)
Repeat(column=[:distance, :delay, :time])
source
Deneb.TransformMethod
Transform(; spec...)

Creates a TransformSpec containing the transform property of a viewable specification. See also the more convenient transform_* methods.

source
Deneb.concatMethod
concat(A::AbstractSpec...; columns)

General (wrappable) concatenation of specs.

source
Deneb.conditionFunction
condition(param::SymbolOrString, iftrue, iffalse; empty=nothing)
condition_test(test::String, iftrue, iffalse)
condition(param_then_pairs::Vector{Pair}, iffalse; empty::Vector=nothing)
condition_test(ifthen_pairs::Vector{Pair}, iffalse)

If iftrue/iffalse isn't a NamedTuple, then it'll be converted as a NamedTuple with name :value. Nested conditions via a vector of ifthen_pairs.

Examples

condition(:myparam, 1, 2; empty=true)
condition_test("datum.x > 0", field("color:O"), :blue)
condition_test(["datum.x > 5" => field("color:O"), "datum.x < 0" => :blue], :gray)
source
Deneb.exprMethod
expr(expr)

Convenient function to create an expr spec: {"expr": expr}.

source
Deneb.fieldMethod
field(field; kw...)

Shortcut to create an arbitrary encoding channel, the positional argument field can use the shorthand string syntax (e.g. "mean(x):Q").

source
Deneb.htmlMethod
html(spec::VegaLiteSpec)

Creates an HTML string of the VegaLite spec.

source
Deneb.interactive_scalesMethod
interactive_scales(;bindx=true, bindy=true, shift_on_y=false)

Creates a ParamsSpec that can be composed to other specs to create interactive pan (mouse hold and drag) and zoom (mouse wheel) charts. bindx and bindy specify if the x and y channels are to be bound. If shift_on_y is true, then the shift key must be hold to pan and zoom in the y channel.

source
Deneb.layerMethod
layer(specs...)

Layer specs, equivalent to spec1 + spec2 + ....

source
Deneb.layoutMethod
layout(; align, bounds, center, spacing, columns)

Set layout properties. Needs to be composed with a LayoutSpec (Repeat, Facet, Concat).

source
Deneb.paramMethod
param(param)

Convenient function to create a param spec: {"param": param}.

source
Deneb.resolveMethod
resolve(type; channels...)
resolve(type, channel, option)

Creates a ResolveSpec. The type indicates the resolution to be defined: scale, axis, or legend.

For scales, resolution can be specified for every channel. For axes, resolutions can be defined for positional channels (x, y, xOffset, yOffset). For legends, resolutions can be defined for non-positional channels (color, opacity, shape, and size).

There are two options to resolve a scale, axis, or legend: shared and independent. Independent scales imply independent axes and legends.

The defaults are documented in Vega-Lite's documentation.

Example

resolve(:scale, color=:independent)
source
Deneb.saveMethod
save(filename, spec)

Saves the spec as filename. Allowed formats are .json, .html, .png, .svg, .pdf.

source
Deneb.selectMethod
select(type, name; value, bind, select_options...)

Convenient function to create a ParamsSpec with the following structure:

{
  "name": name,
  "value": value,
  "select": {
    "type": type,
    select_options...
  },
  "bind": bind
}
source
Deneb.select_bind_inputMethod
select_bind_input(type, name; value, select, bind_options...)

Convenient function to create a ParamsSpec with the following structure:

{
  "name": name,
  "value": value,
  "select": select,
  "bind": {
    "input": type,
    bind_options...
  }
}
source
Deneb.select_legendMethod
select_legend(name; encodings=:color, fields=nothing, bind_options=nothing)

Creates a ParamSpec named name that can be composed to other specs to create selectable legends bound to the given encoding or field. To customize the events that trigger legend interaction, set bind_options with a property that maps to a Vega event stream (e.g. "dblclick"). More info about legend binding: https://vega.github.io/vega-lite/docs/bind.html#legend-binding

source
Deneb.set_theme!Method
set_theme!(theme::Symbol)

Sets the current theme to be used. The default Deneb's theme (:default) sets the following global config:

{
    "view": {"continuousWidth": 300, "continuousHeight": 300, "step": 25},
    "mark": {"tooltip": true}
}

The :default_no_tooltip theme sets the default size as above, but disables tooltips. The :empty theme uses Vega-Lite default empty configuration.

Other available themes are any of the Vega themes: :dark, :excel, :fivethirtyeight, :ggplot2, :googlecharts, :latimes, :powerbi, :quartz, :urbaninstitute, :vox (see https://vega.github.io/vega-themes for more info). In this case the :default global config will be used.

set_theme!(config_theme::Symbol, vega_theme::Symbol)

Sets the global config theme (:default, :default_no_tooltip, :empty) and the vega theme (use vega_theme = :default for no vega theme).

set_theme!(config::NamedTuple, [vega_theme::Symbol])

Sets a theme with a user-specified config.

source
Deneb.transform_densityMethod
transform_density(field; [groupby], [cumulative], [counts], [bandwith], [extent], [minsteps], [maxsteps], [steps], [as])

Creates a TransformSpec for a density transformation. See more in Vega-Lite's documentation

source
Deneb.transform_foldMethod
transform_fold(fold::Vector; as=(:key, :value))

Creates a TransformSpec for the given fold (wide to long) transformation. See more in Vega-Lite's documentation

source
Deneb.transform_imputeMethod
transform_bin(impute, key; [groupby], [keyvals], [frame], [method], [value])

Creates a TransformSpec for an impute transformation. See more in Vega-Lite's documentation

source
Deneb.transform_pivotMethod
transform_pivot(pivot, value; [groupby], [limit], [op])

Creates a TransformSpec for the given pivot (long to wide) transformation. See more in Vega-Lite's documentation

source
Deneb.transform_windowMethod
transform_window(; [frame], [ignorePeers], [groupby],[ sortby], operations...)

Creates a TransformSpec for the given window operations. If a sortby field starts with '-' then descending order is used. See more in Vega-Lite's documentation

source
Deneb.vlspecMethod
vlspec(s)

Creates a Vega-Lite spec enforcing certain Vega-Lite constrains.

Example

vlspec(
    data=(; url="https://vega.github.io/vega-datasets/data/seattle-weather.csv"),
    mark=:bar,
    encoding=(
        x=(timeUnit=:month, field=:date, type=:ordinal),
        y=(aggregate=:mean, field=:precipitation),
    )
)
source
JSON.Writer.jsonMethod
json(spec::VegaLiteSpec, [indent])

Creates a JSON string with the VegaLite specification of spec.

source