API
Deneb.CommonPropertiesDeneb.ConcatSpecDeneb.ConcatViewDeneb.ConstrainedSpecDeneb.DataSpecDeneb.EncodingSpecDeneb.FacetSpecDeneb.HConcatSpecDeneb.LayerSpecDeneb.LayoutPropertiesDeneb.LayoutSpecDeneb.MarkSpecDeneb.MultiViewSpecDeneb.ParamsSpecDeneb.PropertiesSpecDeneb.RepeatSpecDeneb.ResolveSpecDeneb.SingleSpecDeneb.TopLevelPropertiesDeneb.TransformSpecDeneb.VConcatSpecDeneb.VegaLiteSpecDeneb.ViewableSpecBase.:*Base.:+Base.getpropertyBase.hcatBase.hvcatBase.propertynamesBase.vcatDeneb.DataDeneb.DatasetsDeneb.EncodingDeneb.FacetDeneb.MarkDeneb.ParamsDeneb.RepeatDeneb.TransformDeneb.concatDeneb.conditionDeneb.configDeneb.exprDeneb.fieldDeneb.graph_dataDeneb.htmlDeneb.interactive_scalesDeneb.layerDeneb.layoutDeneb.paramDeneb.plotgraphDeneb.print_themeDeneb.projectionDeneb.resolveDeneb.resolve_axisDeneb.resolve_legendDeneb.resolve_scaleDeneb.saveDeneb.selectDeneb.select_bind_inputDeneb.select_checkboxDeneb.select_dropdownDeneb.select_intervalDeneb.select_legendDeneb.select_pointDeneb.select_radioDeneb.select_rangeDeneb.set_theme!Deneb.specDeneb.titleDeneb.transform_aggregateDeneb.transform_binDeneb.transform_calculateDeneb.transform_densityDeneb.transform_filterDeneb.transform_foldDeneb.transform_imputeDeneb.transform_joinaggregateDeneb.transform_loessDeneb.transform_lookupDeneb.transform_pivotDeneb.transform_regressionDeneb.transform_timeunitDeneb.transform_windowDeneb.vlspecJSON.Writer.json
Deneb.CommonProperties — TypeCommon 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.
Deneb.ConcatSpec — TypeGeneral concatenation specification. https://vega.github.io/vega-lite/docs/concat.html#concat
Deneb.ConcatView — TypeConcatenation specifications. https://vega.github.io/vega-lite/docs/concat.html
Deneb.ConstrainedSpec — TypeSpecifications that impose certain constrains in their properties
Deneb.DataSpec — TypeSpec containing the data property of viewable specifications. https://vega.github.io/vega-lite/docs/data.html
Deneb.EncodingSpec — TypeSpec containing the encoding property of a Single or Layered view specification. https://vega.github.io/vega-lite/docs/encoding.html
Deneb.FacetSpec — TypeFacet specification. https://vega.github.io/vega-lite/docs/facet.html
Deneb.HConcatSpec — TypeHorizontal concatenation specification. https://vega.github.io/vega-lite/docs/concat.html#hconcat
Deneb.LayerSpec — TypeLayer specification. https://vega.github.io/vega-lite/docs/layer.html
Deneb.LayoutProperties — TypeCommon properties of all layout (facet, repeat, concat) specifications. https://vega.github.io/vega-lite/docs/spec.html#common
Deneb.LayoutSpec — TypeFacet, Repeat and Concat specifications
Deneb.MarkSpec — TypeSpec containing the mark property of a Single-View spec. https://vega.github.io/vega-lite/docs/mark.html
Deneb.MultiViewSpec — TypeLayered and Layout specifications. https://vega.github.io/vega-lite/docs/composition.html
Deneb.ParamsSpec — TypeSpec containing the params common property to all viewable specifications. https://vega.github.io/vega-lite/docs/parameter.html
Deneb.PropertiesSpec — TypeSpecifications containing a specific set of properties
Deneb.RepeatSpec — TypeRepeat specification. https://vega.github.io/vega-lite/docs/repeat.html
Deneb.ResolveSpec — TypeSpec containing the resolve property common to all Multi-View specifications. https://vega.github.io/vega-lite/docs/resolve.html
Deneb.SingleSpec — TypeSingle view specification. https://vega.github.io/vega-lite/docs/spec.html#single
Deneb.TopLevelProperties — TypeTop-Level specification of a Vega-Lite specification. https://vega.github.io/vega-lite/docs/spec.html#top-level
Deneb.TransformSpec — TypeSpec containing the transform common property to all viewable specifications. https://vega.github.io/vega-lite/docs/transform.html
Deneb.VConcatSpec — TypeVertical concatenation specification. https://vega.github.io/vega-lite/docs/concat.html#vconcat
Deneb.VegaLiteSpec — TypeVega-Lite specification. https://vega.github.io/vega-lite/docs/spec.html
Deneb.ViewableSpec — TypeSingle and Multi-view specifications
Base.:* — Methodspec1::AbstractSpec * spec2::AbstractSpecMultiplication 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.
Base.:+ — Methodspec1::ConstrainedSpec + spec2::ConstrainedSpecThe 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.
Base.getproperty — Methodgetproperty(spec::AbstractSpec, property::Symbol)Returns property property of a specification.
Base.hcat — Methodhcat(A::AbstractSpec...)
[spec1 spec2 spec3 ...]Horizontal concatenation of specs.
Base.hvcat — Methodhvcat(A::AbstractSpec...)
[spec1 spec2; spec3 spec4 ...]General concatenation of specs.
Base.propertynames — Methodpropertynames(::AbstractSpec)Return the top-level properties of a specification.
Base.vcat — Methodvcat(A::AbstractSpec...)
[spec1; spec2; spec3 ...]Vertical concatenation of specs.
Deneb.Data — MethodData(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
tablethat supports the Tables.jl interface - using a
urlto load the data from, with optionalformatandnameproperties. - using a
generatorwith specificpropertiesto a use any of the available Vega-Lite data generator
See more in Vega-Lite's and Deneb's documentation.
Examples
# table format
data = (a=[1, 2], b=["potato", "tomato"])
Data(data)
# data from url
Data(
url="https://vega.github.io/vega-datasets/data/us-10m.json",
format=(type=:topojson, feature=:states),
)
# Vega-Lite gererator
Data(:graticule, step=[15, 15])Deneb.Datasets — MethodDatasets(; datasets...)Creates a top-level dataspec with the given datasets (values) and names (keywords). The datasets can be given as tables that supports the Tables.jl interface.
Deneb.Encoding — MethodEncoding(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",
)Deneb.Facet — MethodFacet(; [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)Deneb.Mark — MethodMark(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.
Deneb.Params — MethodParams(; spec...)Creates a ParamsSpec containing the params property of a viewable specification. See also the more convenient select_* methods and the interactive_scales function.
Deneb.Repeat — MethodRepeat(; [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])Deneb.Transform — MethodTransform(; spec...)Creates a TransformSpec containing the transform property of a viewable specification. See also the more convenient transform_* methods.
Deneb.concat — Methodconcat(A::AbstractSpec...; columns)General (wrappable) concatenation of specs.
Deneb.condition — Functioncondition(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)Deneb.config — Methodconfig(; properties...)
config(type; properties...)Deneb.expr — Methodexpr(expr)Convenient function to create an expr spec: {"expr": expr}.
Deneb.field — Methodfield(field; kw...)Shortcut to create an arbitrary encoding channel, the positional argument field can use the shorthand string syntax (e.g. "mean(x):Q").
Deneb.graph_data — Functiongraph_dataMethod from GraphsExt, requires Graphs and NetworkLayout
Deneb.html — Methodhtml(spec::VegaLiteSpec)Creates an HTML string of the VegaLite spec.
Deneb.interactive_scales — Methodinteractive_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.
Deneb.layer — Methodlayer(specs...)Layer specs, equivalent to spec1 + spec2 + ....
Deneb.layout — Methodlayout(; align, bounds, center, spacing, columns)Set layout properties. Needs to be composed with a LayoutSpec (Repeat, Facet, Concat).
Deneb.param — Methodparam(param)Convenient function to create a param spec: {"param": param}.
Deneb.plotgraph — FunctionplotgraphMethod from GraphsExt, requires Graphs and NetworkLayout
Deneb.print_theme — Functionprint_theme()Prints the specification of the current theme.
Deneb.projection — Methodprojection(type; kw...)Sets the projection properties.
Deneb.resolve — Methodresolve(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)Deneb.resolve_axis — Methodresolve_axis(; channels...)Alias to resolve(:axis; channels...)
Deneb.resolve_legend — Methodresolve_legend(; channels...)Alias to resolve(:legend; channels...)
Deneb.resolve_scale — Methodresolve_scale(; channels...)Alias to resolve(:scale; channels...)
Deneb.save — Methodsave(filename, spec)Saves the spec as filename. Allowed formats are .json, .html, .png, .svg, .pdf, .jpeg/jpg, .vg/vega.
Deneb.select — Methodselect(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
}Deneb.select_bind_input — Methodselect_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...
}
}Deneb.select_checkbox — Methodselect_checkbox(type, name; value, select, bind_options...)Deneb.select_dropdown — Methodselect_dropdown(type, name; options, value, select, bind_options...)options is required
Deneb.select_interval — Methodselect_interval()Deneb.select_legend — Methodselect_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
Deneb.select_point — Methodselect_point()Deneb.select_radio — Methodselect_radio(type, name; options, value, select, bind_options...)options is required
Deneb.select_range — Methodselect_range(type, name; value, select, bind_options...)Deneb.set_theme! — Methodset_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.
Deneb.spec — Methodspec(s)Creates an arbitrary Vega-Lite spec.
Deneb.title — Methodtitle(title)Deneb.transform_aggregate — Methodtransform_aggregate(; [groupby], aggregations...)Creates a TransformSpec for the given aggregations. See more in Vega-Lite's documentation
Deneb.transform_bin — Methodtransform_bin(field, as; [bin])Creates a TransformSpec for a bin transformation. See more in Vega-Lite's documentation
Deneb.transform_calculate — Methodtransform_calculate(; expressions...)Creates a TransformSpec for the given calculate expressions. See more in Vega-Lite's documentation
Deneb.transform_density — Methodtransform_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
Deneb.transform_filter — Methodtransform_filter(predicate)Creates a TransformSpec for the given predicate filter. See more in Vega-Lite's documentation
Deneb.transform_fold — Methodtransform_fold(fold::Vector; as=(:key, :value))Creates a TransformSpec for the given fold (wide to long) transformation. See more in Vega-Lite's documentation
Deneb.transform_impute — Methodtransform_bin(impute, key; [groupby], [keyvals], [frame], [method], [value])Creates a TransformSpec for an impute transformation. See more in Vega-Lite's documentation
Deneb.transform_joinaggregate — Methodtransform_joinaggregate(; [groupby], aggregations...)Creates a TransformSpec for the given join aggregations. See more in Vega-Lite's documentation
Deneb.transform_loess — Methodtransform_loess(x, y; [groupby], [bandwith], [as])Creates a TransformSpec for a Loess transformation. See more in Vega-Lite's documentation
Deneb.transform_lookup — Methodtransform_lookup(lookup, from; [as], [default])Creates a TransformSpec for a lookup transformation. See more in Vega-Lite's documentation
Deneb.transform_pivot — Methodtransform_pivot(pivot, value; [groupby], [limit], [op])Creates a TransformSpec for the given pivot (long to wide) transformation. See more in Vega-Lite's documentation
Deneb.transform_regression — Methodtransform_loess(x, y; [groupby], [method], [order], [extent], [params], [as])Creates a TransformSpec for a regression model transformation. See more in Vega-Lite's documentation
Deneb.transform_timeunit — Methodtransform_timeunit(; transformations...)Creates a TransformSpec for the given timeUnit transformations. See more in Vega-Lite's documentation
Deneb.transform_window — Methodtransform_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
Deneb.vlspec — Methodvlspec(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),
)
)JSON.Writer.json — Methodjson(spec::VegaLiteSpec, [indent])Creates a JSON string with the VegaLite specification of spec.