Releases: vega/vega
v5.13.0
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
cursorstyle 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 propertyevents.globalCursorcan be settrueor the View methodglobalCursorcan 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-interpreterpackage) 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.htmlandstream-nested.htmlperformance test pages.
vega-dataflow
- Add
detachmethod toOperatorto remove adjacent edges (listeners) from the dataflow graph. - Add
cleansetter toChangeSet, set totrueby default if any tuples are removed. - Add
cleangetter/setter to Pulse, propagate value to forked pulses if they share a datasource. - Update logging calls during Dataflow evaluation.
vega-encode
- Update
DataJointransform to clean internal map whenpulse.clean()is true. - Update
Scaleto includedomainMidas an extrema if it exceeds the domain min or max. (#2656)
vega-functions
- Fix scale function to not special case
undefinedinput. This ensures identical semantics with the internal_scalehelper 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
detachmethod to remove subcontexts. Export asdetachSubflowon the head operator of a generated subflow. - Add pluggable expression evaluators.
vega-statistics
- Fix
numbersutility to exclude empty string.
vega-transforms
- Update
Aggregatetransform to clean internal map whenpulse.clean()is true. - Update
Facet,PreFacet, andSubflowtransforms to prune subflows in response topulse.clean(). - Update
Loadtransform to setpulse.clean(true)when removing loaded data. - Fix
BinandExtentto treat empty string as a missing value. (thanks @domoritz!) - Fix aggregate ops to treat empty string as a missing value.
vega-typings
- Add
eventConfig.globalCursorto config typings. - Add dataflow logger to typings.
- Add parse options to typings.
vega-util
- Refactor code for
fastmapandvisitArrayutilities.
vega-view
- Add View constructor option
exprto pass in a custom expression evaluator. - Add
globalCursormethod and event configuration. - Update to make the Vega view container the default cursor target.
v5.12.3
Notable Changes
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.
Changelog
Changes from v5.12.2:
monorepo
- Update eslint config to flag trailing commas.
vega
- Add initialization timing to test spec viewer page.
- Remove dangling commas.
- Update dev dependencies.
vega-cli
- Update SVG test cases.
vega-format
- Remove dangling commas.
vega-geo
- Remove dangling commas.
vega-hierarchy
- Remove dangling commas.
vega-parser
- Fix trailing function argument commas in axis utils. (#2645, thanks @armanozak!)
- Remove dangling commas.
vega-projections-extended
- Update dev dependencies.
vega-scenegraph
- Favor SVG presentation attributes over CSS style. (#2640)
- Fix clipped group picking for canvas. (#2600)
- Remove dangling commas, other code clean-up.
vega-schema
- Remove dangling commas.
vega-time
- Remove dangling commas.
vega-transforms
- Remove dangling commas.
v5.12.2
v5.12.1
Changes from v5.12.0:
monorepo
- Switch from Travis CI to GitHub Actions. (thanks @domoritz!)
vega-cli
- Add tests for vega-cli.
vega-parser
- Update code style for config constants.
vega-scenegraph
- Add class to svg root group, localize SVG stylesheet to that class. (#2618)
- Lazily register CanvasHandler event listeners. By avoiding unneeded listeners, this change avoids a number of passive listener violation warnings. (#2621)
vega-transforms
- Fix regression of string to number conversion in aggregate sum op. (thanks @haldenl!)
vega-typings
- Update View typings.
- Fix missing color schemes in typings. (thanks @domortiz!)
vega-view
- Code clean up.
v5.12.0
Notable Additions
- View-specific locale management for number and date formatting. The View constructor accepts a
localeoption, and Vega specs support aconfig.localeproperty. Locale objects should havenumberand/ortimeproperties that map to valid d3-format or d3-time-format locale definitions. - View
toCanvasnow accepts anexternalContextoption 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. - Initial support for signal-valued axis
orientproperties. 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. - Internal refactoring to support content security policy (CSP) in the future. The Vega parser accepts an
astoption flag to include generated abstract syntax trees for expressions in the parser output. AllFunctionconstructor 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. - Bug fixes! See below...
Changelog
Changes from v5.11.1:
vega
- Update
bar-timetest specification to test locale config usage. - Update
budget-forecaststest specification. - Update to use refactored runtime context.
vega-cli
- Update to use locale view constructor option.
vega-dataflow
- Add locale property to set a dataflow-specific locale for number and date formatting.
vega-encode
- Update to use centralized locale management. Transforms now access the dataflow-specific locale via the input pulse.
vega-expression
- Fix handling of
thisglobal variable.
vega-format
- New package for format methods that centralizes locale management.
vega-functions
- Add centralized locale management. Format functions now access the dataflow-specific locale via the runtime context object, available to expression functions via the
thiscontext. - Add and export expression parser, support AST export option.
- Add internal scale functions for use by encoders.
- Fix scale dependencies: non-literal scale references should depend on all scales.
vega-geo
- Fix contour, density2D
sizesetter input checks.
vega-loader
- Add UTC parser parameter to
readmethod. - Use the default locale when custom time format parsers are not provided.
vega-parser
- Internal breaking change: Output runtime specification has changed the encoding of parsed expression functions. Generated code is now wrapped in an object and stored in the
codeproperty. - Internal breaking change: Generated expression code no longer includes method variable definitions or additional logic. These have been moved to vega-runtime.
- Add signal support for axis
translateproperty. (Thanks @haldenl!) - Add experimental signal support for axis
orientproperty. (Thanks @haldenl!) - Add parsing of locale config, include in runtime spec output.
- Add options argument to
parse. - Add boolean
astparse option to enable AST output from expression parser. - Refactor to use expression parser for synthesized encoder logic.
- Fix circular dependencies.
vega-runtime
- Internal breaking change: The runtime now assumes the updated vega-parser output format. All code generation beyond standard expression parser output has now been consolidated into the runtime parsing process.
- Propagate locale config to runtime context object.
- Refactor code, add optimized code generation for accessors and comparators.
- Refactor all non-standard code generation to the runtime context.
- Fix circular dependencies.
vega-scale
- Internal breaking change: Update to use centralized locale management. Formatting methods now require a locale parameter as the first argument.
- Fix valid tick method to sort ticks based on scale range values. (#2579)
vega-scenegraph
- Add
externalContextCanvasRenderer option. (Thanks @pixelspark!) - Add
resetSVGDefIdsto reset gradient and clip id counter. (Thanks @kanitw!) - Add SVG style block, set default fill and miter limit values. (#2498)
- Update SVG test outputs.
- Update to use centralized locale management. The ARIA caption generators access the dataflow-specific locale via the runtime context object.
- Update reference to axis orient.
- Fix SVG radial gradient pattern fill to use style, not fill attribute.
- Fix ampersand escape in SVG attributes. (#2608)
- Fix CSS fill inherit for tspan.
vega-schema
- Add axis
translatesignal support to schema. - Add signal-valued axis
orientto schema.
vega-time
- Internal breaking change: Remove formatting methods, which are now part of vega-format.
vega-transforms
- Update aggregation ops to no longer use the
Functionconstructor. - Update dependencies.
vega-typings
- Add
externalCanvasrender option to typings. - Add axis
translatesignal support to typings. - Add signal-valued axis
orientto typings.
vega-util
- Update
field,key, andcomparemethods to no longer use theFunctionconstructor. - Add optional arguments to inject optimized code generators for accessors and comparators.
vega-view
- Add locale input options and config handling.
- Update to use refactored runtime context.
vega-view-transforms
- Add signal support for axis translate property.
- Update reference to axis orient.
- Fix
ViewLayoutreflow to ensure group bounds are updated. (#2568) - Fix grid layout calculations with empty grid input. (#2541)
vega-wordcloud
- Update dependencies.
v5.11.1
Changes from v5.11.0:
monorepo
- Update dev dependencies.
vega-hierarchy
- Update tests for tape 5.0.
vega-scenegraph
- Use single quotes for generated aria-label captions. (Thanks @sprmn!)
- Escape double quotes in SVG attributes, add test case.
vega-statistics
- Update tests for tape 5.0.
vega-view-transforms
- Update tests for tape 5.0.
v5.11.0
Notable Additions
- Preliminary support for ARIA accessibility attributes in SVG output. Mark and guide definitions now include automatically-generated roles and labels, which can be customized using
descriptionandariaproperties. Individual mark items do not include ARIA attributes by default (which helps prevent bloat of both the scenegraph and output SVG), but these can be added usingdescriptionandariaencoding channels. - Improve generated HTML form elements for signal bindings. Deployments that use custom CSS for styling bound elements may wish to make minor adjustments.
dayofyeartime unit support for thetimeunittransform.dayofyear,week,utcdayofyear, andutcweekexpression functions.- Axis
domainCap,gridCap, andtickCapproperties.
Changelog
Changes from v5.10.1:
monorepo
- Add ARIA attribute generation documentation.
- Update eslint setup, consolidate configuration.
- Update dev dependencies.
vega
- Add
calendartest specification. - Add
overview-detail-binstest spec to test suite. - Update crossfilter test scenes to include
descriptionproperty output.
vega-encode
- Move internal tick, label utilities to vega-scale.
- Fix valid tick check calculation. (#2531)
vega-functions
- Add
dayofyear,week,utcdayofyear,utcweekexpression functions.
vega-geo
- Fix density utility size input checking bug.
vega-parser
- Add ARIA attribute generation for marks and guides via
ariaanddescriptionproperties. - Add backing scale names to axis, legend datum objects.
- Add
zindexsupport for guide config. - Add axis
domainCap,gridCap, andtickCapproperties. (Thanks @kanitw!)
vega-scale
- Add tick, label guide utilities from vega-encode.
- Add
domainCaptionutility. - Fix overflow with large domain and small
tickMinStep(#2550, thanks @rwoollen!)
vega-scenegraph
- Add ARIA attribute generation to SVG renderers:
- Parent
<g>tags for mark items include automaticroleandaria-roleDescriptionattributes. - Parent
<g>tags for axes and legends include automaticaria-labelcaptions. - Attribute generation for mark and guide definitions can be customized using the
ariaanddescriptionproperties. Ifariaisfalse, the content is hidden from the accessibility tree by settingaria-hiddenSVG attribute. Thedescriptionproperty determines thearia-labelSVG attribute. - Individual mark items do not include ARIA attributes by default, but these can be added using the encoding channels
ariaanddescription. If adescriptionis provided andaria !== false, then Vega will generate accompanyingroleandaria-roledescriptionattributes for a mark item.
- Parent
- Provide experimental
ariaRoleandariaRoleDescriptionencoding channels for individual marks, which override the defaultroleandaria-roledescriptionattributes generated by Vega. However, note that these are experimental features and so may change at a later date.
vega-schema
- Add ARIA accessibility properties to mark, guide, and encode schemas.
- Add axis
domainCap,gridCap, andtickCapproperties.
vega-time
- Add
dayofyeartime unit support and corresponding tests. - Add
dayofyear,week,utcdayofyear,utcweekutility functions. - Add export for
TIME_UNITSarray of valid time unit strings.
vega-transforms
- Update
TimeUnittransform parameter schema to enforce valid time unit strings.
vega-typings
- Add ARIA accessibility properties to mark, guide, and encode typings.
- Add
dayofyearoption toTimeUnittransform typings. - Add
zindexsupport for guide config. - Add axis
domainCap,gridCap, andtickCapproperties.
vega-view
- Improved semantic HTML for generated signal bindings to form input elements.
v5.10.1
Changes from v5.10.0:
vega-encode
- Update default guide label format to support multi-line arrays. (#2456)
vega-loader
- Use
startsWithrather thanindexOffor string prefix checks.
vega-parser
- Use
startsWithrather thanindexOffor string prefix checks. - Set default
fillandsizefortrailmark config.
vega-transforms
- Fix
windowoperator init state forprev_valueandnext_value. (#2475.)
vega-typings
- Update mark config for arc mark.
vega-view-transforms
- Fix
Overlaptransform to early exit when there are no items (#2449).
v5.10.0
Notable Additions
- The Vega parser now generates a built-in
backgroundsignal which the view uses to set the background color. While not technically a breaking change (specs will still parse and evaluate successfully), existing specs that use a signal named"background"may not render the same as before, in which case a different signal name should be used. - Top-level properties (
autosize,background,padding,width,height) accept signal references, such as{"signal": "<expr>"}, which map to a signal definition'supdateproperty. If the top-levelsignalsarray contains an entry that matches one of these properties, the definitions will be merged, with precedence given to the properties defined in thesignalsarray. - Vega views now include ARIA attributes on the view container DOM element. The
roleattribute is set to"figure", and thearia-labelattribute is set to the specificationdescriptionproperty. - The
aggregateandwindowtransforms support theproductoperation to multiply values. - The config supports a top-level
lineBreakoption for setting a global default for text line breaks. This property should be a string or regexp value, or a corresponding signal reference. - Support for text
baselinevaluesline-topandline-bottom. These values are similar totopandbottombaselines, but calculated relative to thelineHeightrather thanfontSizealone. - Support for color blend modes via the new
blendencoding channel. The allowed values are:multiply,screen,overlay,darken,lighten,color-dodge,color-burn,hard-light,soft-light,difference,exclusion,hue,saturation,color,luminosity. For Canvas rendering, the blend is set via the context 2DglobalCompositeOperationproperty. For SVG rendering, the blend is set via the CSSmix-blend-modestyle. The default Vega value isnull(orundefined), which maps to the default values"source-over"(for Canvas) and"normal"(for SVG). For more, see the CanvasglobalCompositeOperationand CSSmix-blend-modedocumentation, including limitations in cross-browser support. - Support for configuration of cross-origin image handling. Vega uses
crossOrigin="anonymous"by default for loaded images, which allows images loaded from a different host to be included in exported visualization images (and thereby avoid "tainted canvas errors"), so long as the server provides permission via proper CORS headers. This default can be overridden by providing loader options to the Vega view that include acrossOriginproperty. If this property is defined and maps to a value ofnullorundefined, then ano-corsfetch will be performed instead. - Add axis
labelOffsetproperty to adjust axis label position in addition totickOffset, andlabelLineHeightto set the line height for multi-line axis labels.
Changelog
Changes from v5.9.2:
docs
- Add
descriptionentries to all specifications in the example gallery. - Update documentation for all new features.
vega
- Update test specifications to avoid use of signals named
"background".
vega-loader
- Add
crossOriginURI sanitization configuration for images. (#2238)
vega-parser
- Add built-in
backgroundsignal to drive view background. - Add support for top-level properties to take signal-values.
- Add application of
lineBreakconfig option to text marks. (#2370) - Add axis
labelOffsetproperty. (thanks @kanitw! #2317) - Add axis
labelLineHeightproperty. (thanks @kanitw! #2437) - Add description support to parser output and config.
vega-scenegraph
- Add
crossOriginimage handling support. (#2238) - Add
blendencoding channel support. (#2311) - Add
line-top,line-bottomtext baseline options. (#2395) - Add text trimming to ensure consistent output. (#2418)
- Fix linear gradient to use normalized bounding box coordinates. (#2365)
- Fix canvas damage/redraw: Align to base pixel grid in case of non-integer scaling. (#2425)
vega-schema
- Add
blendencoding to schema. - Add
line-top,line-bottomtext baseline options. (#2395) - Add top-level signal-valued properties to schema.
- Add axis
labelOffsetandlabelLineHeightproperties to schema.
vega-transforms
- Add
productaggregate operation. (#2307)
vega-typings
- Add
blendencoding to typings. - Add
line-top,line-bottomtext baseline options. (#2395) - Add top-level signal-valued properties to typings.
- Add
lineBreakconfig typing. (#2370) - Add axis
labelOffsetandlabelLineHeighttypings.
vega-util
- Fix prototype pollution vulnerability.
vega-view
- Add ARIA attributes and View
descriptionmethod. - Use
backgroundsignal to control the view background color. - Update
paddingmethod to handle numeric values.
vega-view-transforms
- Fix axis title layout bounds to avoid improper padding offset. (#2368)
- Fix view layout resize code to avoid invocation of padding until needed.
v5.9.2
Changes from v5.9.1:
docs
- Add clock, watch, and pacman examples. (Thanks @mathiastiberghien and @domoritz!)
monorepo
- Update dev dependencies.
vega
- Allow patch updates for Vega packages.
- Add
images-inlinetest specification.
vega-loader
- Fix URI sanitization to accept
data:prefix URIs. (#2407)
vega-parser
- Fix legend
columnsvalue handling. (#2268)
vega-scenegraph
- Add memoization to speed up text width measurements. (Thanks @domoritz!)
vega-schema
- Fix
date-type transform parameter support.
vega-statistics
- Fix exponential regression robustness, mean-center x-values. (#2378)
vega-transforms
- Fix TimeUnit
maxbins,extentparameter support. (Thanks @haldenl!)
vega-typings
- Fix missing
zindexmark encoding typing. (#2341) - Update typings. (Thanks @danmarshall, @domoritz, @kanitw!)
vega-util
- Add
lruCachedata structure, tests, and documentation.