npm vega 5.13.0
v5.13.0

latest releases: 5.30.0, 5.29.0, 5.28.0...
4 years ago

Notable Changes

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

Changelog

Changes from v5.12.3:

vega

  • Update stream.html and stream-nested.html performance test pages.

vega-dataflow

  • Add detach method to Operator to remove adjacent edges (listeners) from the dataflow graph.
  • Add clean setter to ChangeSet, set to true by default if any tuples are removed.
  • Add clean getter/setter to Pulse, propagate value to forked pulses if they share a data source.
  • Update logging calls during Dataflow evaluation.

vega-encode

  • Update DataJoin transform to clean internal map when pulse.clean() is true.
  • Update Scale to include domainMid as an extrema if it exceeds the domain min or max. (#2656)

vega-functions

  • Fix scale function to not special case undefined input. This ensures identical semantics with the internal _scale helper function used by code-generated encoders.

vega-geo

  • Update d3-geo dependency.

vega-interpreter

  • Add new vega-interpreter package.

vega-projection

  • Update d3-geo dependency.

vega-projection-extended

  • Update vega-projection dependency.

vega-runtime

  • Add runtime detach method to remove subcontexts. Export as detachSubflow on the head operator of a generated subflow.
  • Add pluggable expression evaluators.

vega-statistics

  • Fix numbers utility to exclude empty string.

vega-transforms

  • Update Aggregate transform to clean internal map when pulse.clean() is true.
  • Update Facet, PreFacet, and Subflow transforms to prune subflows in response to pulse.clean().
  • Update Load transform to set pulse.clean(true) when removing loaded data.
  • Fix Bin and Extent to treat empty string as a missing value. (thanks @domoritz!)
  • Fix aggregate ops to treat empty string as a missing value.

vega-typings

  • Add eventConfig.globalCursor to config typings.
  • Add dataflow logger to typings.
  • Add parse options to typings.

vega-util

  • Refactor code for fastmap and visitArray utilities.

vega-view

  • Add View constructor option expr to pass in a custom expression evaluator.
  • Add globalCursor method and event configuration.
  • Update to make the Vega view container the default cursor target.

Don't miss a new vega release

NewReleases is sending notifications on new releases.