Skip to content

v2.0.0-alpha.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@kanitw kanitw released this 26 Jan 20:44
· 5565 commits to master since this release

This first alpha release supports all features from Vega-Lite 1, but renders charts using Vega 3 instead of Vega 2. Since this is a pre-release, we will further revise syntax (schema) of the language and likely introduce some breaking changes prior to the official 2.0 release.

Syntax Change

Marks

  • Add rect mark for creating arbitrary rect and for creating table heat map
  • Most mark types (except rect) can now be stacked. (For example, points can be stacked to serve as markers for line and area.)

Channels

  • Remove path channel and useorder channel for sorting line orders instead.
  • The order channel no longer affects layer order for marks.

Transform

  • Similar to Vega 3, formula definition for calculate now use as property to specify output fields name instead of field.

Scale

Scale Type

  • Scale types are updated to match Vega 3 and D3 4.0.
    • Ordinal scale type is now replaced with the new ordinal (for lookup table), point, and band scales.
    • A new sequential scale for color is added for mapping continuous data to a sequential color scheme.

Scale Padding

  • Facet (row and column)'s scale renamed to spacing as it represents pixel spacing/padding between different faceted cell/plot while padding is a padding ratio between [0, 1] for other channels
  • padding now has no effect on row and column while spacing has no effect on other channels besides row and column.
  • paddingOuter and paddingInner added.

Other Scale Properties

  • Similar to Vega 3, "bandSize" is now renamed to "rangeStep"
  • "rangeStep": null now makes rangeStep fits the width or height. The original value "fit" for "rangeStep" (formerly "bandSize") is removed.
  • config.scale.round is now only supported for x, y, row, column (and ignored for other channels).
  • scale's zero is now true by default when using a quantitative field with size.
  • A new scheme property is added for specifying scheme as scale range

Sort

  • "sort": "none" is no longer supported. Instead, please use "sort": null.

Axis

  • tick and domain properties added for enabling / disabling parts of an axis.
  • ticks renamed to tickCount
  • characterWidth removed.
  • Axis now no longer has layer property. Instead, there is a "zindex" property (default 0). By default, axes should be drawn behind all chart elements. To put them in front, use "zindex": 1.

Axis / legend

  • properties directive for custom axis and legend style are removed. Instead please use the encode directive.

Config

  • Add mark specific config for all marks. Basically, each mark config (e.g., config.bar.*) has all properties similar to mark config. This way you can make line's default color be green while bar's default is blue if desired.
  • Remove old mark specific config from config.mark
    • config.mark.barBinSpacing/barThinSize/barSize => config.bar.binSpacing/continuousBandSize/discreteBandSize
    • config.mark.lineSize => config.line.strokeWidth
    • config.mark.shape => config.point.shape
    • config.mark.size => config.point/circle/square.size
    • config.mark.ruleSize => config.rule.strokeWidth
    • config.mark.tickSize,tickThickness => config.tick.bandSize/thickness
    • config.mark.* (text properties) => config.text.*
  • Move each scale range config from config.scale to config.mark to map with default non-mapped property value. For example:
    • config.scale.opacityRange => config.mark.min/maxOpacity (as a companion to config.mark.opacity)
    • config.scale.barSizeRange => config.bar.min/maxBandSize (as a companion to config.bar.bandSize)
    • config.scale.shapeRange => config.point.shapes (as a companion to config.point.shape)

API

  • Now vl.compile takes logger that implements LoggerInterface as input, allow redirecting warning, info, and debug log to other locations besides the console.
  • More warnings:
    • If a scale type does not support any specified scale properties

Output

  • Include vega's $schema in the output

Internal

  • Eliminate vl.shorthand helper (#1509)
  • Remove auto imputed time unit domain (#1605)
  • Enable noImplicitAny