A visualization grammar.
label
transform automatically positions labels without overlapping other marks. (Thanks @chanwutk!)Changes from v5.15.0:
docs
monorepo
vega
vega-canvas
vega-crossfilter
vega-dataflow
vega-encode
vega-event-selector
vega-expression
vega-functions
vega-force
vega-format
vega-geo
vega-hierarchy
vega-interpreter
vega-label
vega-loader
vega-parser
vega-projection
vega-projection-extended
vega-regression
vega-runtime
vega-scale
vega-scenegraph
vega-schema
vega-selections
vega-statistics
vega-time
vega-transforms
vega-typings
vega-util
vega-view-transforms
vega-view
vega-voronoi
vega-wordcloud
Changes from v5.14.0:
monorepo
vega
vega-core
build to use D3 v6.vega-scale
turbo
and cividis
color palettes. (thanks @mcnuttandrew!)function
declarations where appropriate.let
and const
to var
.Changes from v5.13.0:
vega-cli
vega-canvas
vega-crossfilter
vega-dataflow
addAll
to clear rem set when applicable. This prevents tuple removal from being invoked on newly instantiated operators that never observed those tuples in the first place. (#2605)vega-encode
vega-event-selector
vega-expression
vega-force
vega-format
vega-functions
vega-geo
vega-hierarchy
vega-label
vega-loader
vega-parser
vega-projection
vega-regression
vega-scale
vega-scenegraph
markup
and serializeXML
utilities for SVG string output. Ensure proper XML output. (#2672)xmllint
checks to test conformance of SVG output.SVGStringRenderer
class methods to use markup utility.openTag
, closeTag
utilities.vega-statistics
vega-time
vega-transforms
vega-view-transforms
vega-view
vega-util
members
argument to inherits
utility.ascending
comparator utility.vega-voronoi
vega-wordcloud
Improved Streaming Performance.
For performance, Vega caches a lot of internal data structures, including calculated tuples, scenegraph items, and SVG DOM nodes. Previously, nested scopes (such as those created for facetted data) that result in vega-runtime subcontexts were never cleaned. If no external View API calls are made, this is fine, and actually improves performance for interaction-driven dynamic filtering. However, when providing streaming data to Vega through the View API, uncleaned caches and subcontexts can result in substantial memory leaks that also eventually degrade performance.
This version adds mechanisms for clearing caches and detaching subflows to support streaming data within nested specifications. When input data is removed via a View API call or via signal-valued URL, Vega will now by default trigger garbage collection to reclaim resources. This behavior can be disabled by calling clean(false)
on a constructed ChangeSet passed to the View API.
Improved Cursor Performance.
Previously Vega updated the cursor
style on the HTML document body. This persists cursor settings even during interactions (such as drags) that may leave the Vega View component. However, it also can result in large performance penalties in Chrome, which re-evaluates CSS styles in response. This version changes the default behavior to set the cursor locally on the Vega View component. If a global cursor is desired, the boolean config property events.globalCursor
can be set true
or the View method globalCursor
can be invoked to change the setting at runtime.
Optional Expression Interpreter.
This release adds interpreter support for Vega expressions that is Content Security Policy (CSP) compliant. By default, the Vega parser performs code generation for parsed Vega expressions, and the Vega runtime uses the Function constructor to create JavaScript functions from the generated code. Although the Vega parser includes its own security checks, the runtime generation of functions from source code nevertheless violates security policies designed to prevent cross-site scripting.
This release provides an interpreter plug-in (the new vega-interpreter
package) that evaluates expressions by traversing an Abstract Syntax Tree (AST) for an expression and performing each operation in turn. Use of the interpreter enables compliance with CSP, but can incur a performance penalty. In tests of initial parse and dataflow evaluation times, the interpreter is on average ~10% slower. Interactive updates may incur higher penalties, as they are often more expression-heavy and amortize the one-time cost of Function constructor parsing.
Changes from v5.12.3:
vega
stream.html
and stream-nested.html
performance test pages.vega-dataflow
detach
method to Operator
to remove adjacent edges (listeners) from the dataflow graph.clean
setter to ChangeSet
, set to true
by default if any tuples are removed.clean
getter/setter to Pulse, propagate value to forked pulses if they share a data source
.vega-encode
DataJoin
transform to clean internal map when pulse.clean()
is true.Scale
to include domainMid
as an extrema if it exceeds the domain min or max. (#2656)vega-functions
undefined
input. This ensures identical semantics with the internal _scale
helper function used by code-generated encoders.vega-geo
vega-interpreter
vega-projection
vega-projection-extended
vega-runtime
detach
method to remove subcontexts. Export as detachSubflow
on the head operator of a generated subflow.vega-statistics
numbers
utility to exclude empty string.vega-transforms
Aggregate
transform to clean internal map when pulse.clean()
is true.Facet
, PreFacet
, and Subflow
transforms to prune subflows in response to pulse.clean()
.Load
transform to set pulse.clean(true)
when removing loaded data.Bin
and Extent
to treat empty string as a missing value. (thanks @domoritz!)vega-typings
eventConfig.globalCursor
to config typings.vega-util
fastmap
and visitArray
utilities.vega-view
expr
to pass in a custom expression evaluator.globalCursor
method and event configuration.The previous Vega v5.12.0 release introduced changes to how SVG was generated, including the addition of an internal stylesheet. However, this leads to integration issues with downstream tools (including at least one popular SVG optimizer) that do not support stylesheet parsing. In addition, local performance tests indicate faster rendering in Chrome when using presentation attributes instead of CSS styling. This version (v5.12.3) now changes the SVG output to favor presentation attributes (fill="blue"
) over CSS style (style="fill: blue;"
).
CSS styles have been removed in all but one case: the use of image-rendering
for non-smoothed images, where browser differences require multiple style definitions to appease both Chrome and Firefox, something we can't express with presentation attributes alone. If and when Firefox properly supports image-rendering: pixelated
we can consider dropping this last use of CSS.
Note that external stylesheets can still be used to style Vega SVG content, and may now have higher specificity due to the use of attributes.
Changes from v5.12.2:
monorepo
vega
vega-cli
vega-format
vega-geo
vega-hierarchy
vega-parser
vega-projections-extended
vega-scenegraph
vega-schema
vega-time
vega-transforms
Changes from v5.12.1:
vega-scenegraph
vega-typings
Changes from v5.12.0:
monorepo
vega-cli
vega-parser
vega-scenegraph
vega-transforms
vega-typings
vega-view
locale
option, and Vega specs support a config.locale
property. Locale objects should have number
and/or time
properties that map to valid d3-format or d3-time-format locale definitions.toCanvas
now accepts an externalContext
option to draw into a separately managed canvas instance. For example, one could draw multiple Vega views into the same node-canvas instance for server-side PDF document generation.orient
properties. This addition allows the position of an axis (e.g., left versus right) to be dynamically updated at runtime. The feature should be considered experimental; subtle bugs may still arise.ast
option flag to include generated abstract syntax trees for expressions in the parser output. All Function
constructor use for generated code is now consolidated into a single file in the vega-runtime package and could be overridden if an expression AST interpreter is implemented.Changes from v5.11.1:
vega
bar-time
test specification to test locale config usage.budget-forecasts
test specification.vega-cli
vega-dataflow
vega-encode
vega-expression
this
global variable.vega-format
vega-functions
this
context.vega-geo
size
setter input checks.vega-loader
read
method.vega-parser
code
property.translate
property. (Thanks @haldenl!)orient
property. (Thanks @haldenl!)parse
.ast
parse option to enable AST output from expression parser.vega-runtime
vega-scale
vega-scenegraph
externalContext
CanvasRenderer option. (Thanks @pixelspark!)resetSVGDefIds
to reset gradient and clip id counter. (Thanks @kanitw!)vega-schema
translate
signal support to schema.orient
to schema.vega-time
vega-transforms
Function
constructor.vega-typings
externalCanvas
render option to typings.translate
signal support to typings.orient
to typings.vega-util
field
, key
, and compare
methods to no longer use the Function
constructor.vega-view
vega-view-transforms
ViewLayout
reflow to ensure group bounds are updated. (#2568)vega-wordcloud