v2.0.0-alpha.0
Pre-release
Pre-release
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 arbitraryrect
and for creating table heat map - Most mark types (except
rect
) can now be stacked. (For example,point
s can be stacked to serve as markers forline
andarea
.)
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 useas
property to specify output fields name instead offield
.
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
, andband
scales. - A new
sequential
scale for color is added for mapping continuous data to a sequential color scheme.
- Ordinal scale type is now replaced with the new
Scale Padding
- Facet (
row
andcolumn
)'s scale renamed tospacing
as it represents pixel spacing/padding between different faceted cell/plot whilepadding
is a padding ratio between[0, 1]
for other channels padding
now has no effect onrow
andcolumn
whilespacing
has no effect on other channels besidesrow
andcolumn
.paddingOuter
andpaddingInner
added.
Other Scale Properties
- Similar to Vega 3,
"bandSize"
is now renamed to"rangeStep"
"rangeStep": null
now makesrangeStep
fits the width or height. The original value"fit"
for"rangeStep"
(formerly"bandSize"
) is removed.config.scale.round
is now only supported forx
,y
,row
,column
(and ignored for other channels).scale
'szero
is nowtrue
by default when using aquantitative
field withsize
.- 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
anddomain
properties added for enabling / disabling parts of an axis.ticks
renamed totickCount
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 theencode
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
toconfig.mark
to map with default non-mapped property value. For example:config.scale.opacityRange
=>config.mark.min/maxOpacity
(as a companion toconfig.mark.opacity
)config.scale.barSizeRange
=>config.bar.min/maxBandSize
(as a companion toconfig.bar.bandSize
)config.scale.shapeRange
=>config.point.shapes
(as a companion toconfig.point.shape
)
API
- Now
vl.compile
takes logger that implementsLoggerInterface
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