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.