vega v5.12.0 Release Notes

Release Date: 2020-05-15 // almost 4 years ago
  • Notable Additions

    • ๐Ÿ‘ View-specific locale management for number and date formatting. The View constructor accepts a 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.
    • View 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.
    • Initial support for signal-valued axis 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.
    • ๐Ÿ”จ Internal refactoring to support content security policy (CSP) in the future. The Vega parser accepts an 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.
    • ๐Ÿ› Bug fixes! See below...

    ๐Ÿ”„ Changelog

    ๐Ÿš€ Changes from v5.11.1:

    vega

    • โšก๏ธ Update bar-time test specification to test locale config usage.
    • โšก๏ธ Update budget-forecasts test 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 this global 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 this context.
    • โž• 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 size setter input checks.

    vega-loader

    • โž• Add UTC parser parameter to read method.
    • 0๏ธโƒฃ 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 code property.
    • 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 translate property. (Thanks @haldenl!)
    • โž• Add experimental signal support for axis orient property. (Thanks @haldenl!)
    • โž• Add parsing of locale config, include in runtime spec output.
    • โž• Add options argument to parse.
    • โž• Add boolean ast parse 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 externalContext CanvasRenderer option. (Thanks @pixelspark!)
    • โž• Add resetSVGDefIds to 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 translate signal support to schema.
    • โž• Add signal-valued axis orient to 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 Function constructor.
    • โšก๏ธ Update dependencies.

    vega-typings

    • โž• Add externalCanvas render option to typings.
    • โž• Add axis translate signal support to typings.
    • โž• Add signal-valued axis orient to typings.

    vega-util

    • โšก๏ธ Update field, key, and compare methods to no longer use the Function constructor.
    • โž• 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 ViewLayout reflow to ensure group bounds are updated. (#2568)
    • ๐Ÿ›  Fix grid layout calculations with empty grid input. (#2541)

    vega-wordcloud

    • โšก๏ธ Update dependencies.