Releases: vega/vega-lite
Releases · vega/vega-lite
v0.9.0
We refactored a number of syntax decisions in this PR as we are moving closer to 1.0
. Please read carefully to make sure that you migrate correctly.
Main APIs
vl.compile
's signature has changed- It no longer requires
stats
- It returns an object with property
spec
contains the vega spec. (We will add warning / errors as additional properties in the future.)
- It no longer requires
Syntax
- CORE SYNTAX CHANGES
- Rename
marktype
tomark
- Rename
name
tofield
in each field definition - Rename
col
tocolumn
for clarity - Replace short name type with full name type by default e.g.,
Q
=>quantitative
,O
=>ordinal
,T
=>temporal
,N
=>nominal
. But short name types are still supported and thetype
property is now case insensitive.
- Rename
- Added vega's scale, axis, and legend properties that should be supported #181
- Added scale property to
row
,column
andshape
- rename / refactor
axis.maxLabelLength
=>axis.labelMaxLength
scale.bandSize
=>scale.bandWidth
- Move
encDef.band
to be a part ofscale
band.size
=>scale.bandWidth
band.padding
=>scale.padding
- revise
useRawDomain
to support only aggregate functions that produces values ranging in the domain of the source data ('mean'
,'average'
,'stdev'
,'stdevp'
,'median'
,'q1'
,'q3'
,'min'
,'max’
) - revised
config
- remove unused
config.gridColor
,config.gridOpacity
- remove
config.bandWidth
,config.padding
andconfig.useRawDomain
as it is redundant withscale.bandWidth
andscale.padding
,scale.useRawDomain
in field definitions- set default values of
scale.bandWidth
,scale.padding
just for X, Y
- set default values of
- group configs of a particular element together
config.cell
- move
cell
configs to be undercell
:width
,height
,padding
,gridColor
,gridOpacity
,gridOffset
- remove
config.singleWidth
,config.singleHeight
,encoding.column.width
,encoding.row.height
and simply always use value fromcell.width
,cell.height
- remove
- add the following group marks properties to
config.cell
:fill
,fillOpacity
,stroke
,strokeWidth
,strokeOpacity
, strokeDash, strokeDashOffset` - added missing properties
- move
config.marks
- move
baseline
,font
,fontStyle
,fontWeight
fromencoding.text
toconfig.marks
encoding.shape.filled
=>config.marks.filled
encoding.color.opacity
=>config.marks.opacity
- move all text properties from
encoding.text
toconfig.marks
except renamingencoding.text.placeholder
toencoding.text.value
config.strokeWidth
=>config.marks.strokeWidth
- added missing properties
- move
- remove unused
Output
- data
- rename Vega’s
data
tables:raw
=>source
andaggregate
=>summary
- added
layout
table for layout calculation and addroot
marks group for bindinglayout
data
- rename Vega’s
- output now describe properties in
update
rather thanenter
- only produces
scales
,axes
,legends
when they are non-empty - removed axis grid for
row
andcolumn
and addedrule
marks (row|column-rules
) instead for drawing rules/grid between rows / columns {field: {group: 'width|height'}}
are used where necessary- removed scales for timeUnit and used template instead
- revised default values
- scale's
nice
,points
andzero
- set axis's
layer: 'back'
only ifgrid
istrue
- fixes #526 - complex rules for determining opacity and color scales removed.
- stack's default order is revised
- simplified rules for automatic opacity
- scale's
Helper APIs
- move
requiredEncodings
andsupportedEncodings
tovl.validate
- add
vl.validate.getEncodingMappingError()
-- this is subject to change. - Include Vega-Lite version in the compiled files. (
vl.version
) - add
encoding.padding()
helper - Add separate methods for properties in scale, axis, and legend
- rename
vl.encDef
=>vl.fieldDef
vl.enc
=>vl.encoding
vl.Encoding
=>vl.spec
for static methodsvl.Encoding
=>vl.compiler.model
for internal model for the compilerscale.sort()
=>scale.domain.sort()
vl.schema.encTypes
=>vl.const.Enctype.LIST
- general utility methods are now moved to
vl.util
- Add namespaces for helpers and constants
vl.type
,vl.channel
,vl.bin
,vl.aggregate
,vl.timeunit
- move shorthand methods to
vl.shorthand
- fixed bug when having array in the schema for
schemautil.subtract
Internal
- Migrated to Typescript & add interfaces for all type
- Break schema into multiple files
- Vega-Lite editor removed, as Vega Editor now supports Vega-Lite
v0.8.3
- Change default value for
axis.grid
for binned field tofalse
- Reimplement bin's scale using linear scale instead (#693)
- Fix missing value problem in stacked area chart using the new Vega's
impute
transform - Remove
sort
transform from output stacked area chart spec asstack
transform already includedsortby
v0.8.2
v0.8.1
v0.8.0 – Migrating to Vega 2
Syntax Change
- axis
- only include
axis.orient
when necessary
- only include
- legends
- set legend's orient to right by default (similar to Vega)
- Vega-lite now supports multiple legends
- filter
- move
filter
todata.filter
and takes Vega expression as parameter instead of a complicated predicate object. - Null filter is added before binning and timeUnit conversion
- move
- scale
scale.reverse
is removed as it is redundant withsort
.
- stack
- add stack control to
color
anddetail
encoding
- add stack control to
- sort — now
sort
property can be eitherundefined
, a String or an Objectundefined
- the field is unsorted.- (as String)
'ascending'
or'descending'
– the field is sort by the field's value in ascending or descending order. - (as Object — for ordinal/nominal fields only) A sort field object - for sorting the field by an aggregate calculation (
sort.op
) over a specified sort field (sort.field
) in a specified order (sort.order
)
Vega 2 Migration Refactor
- ValueRef
- replace
d.data
withdatum
in filter - add
datum.
option to fieldRef and use it in time transform and template - eliminate outdated
fieldRef
options - Replace the eliminated
group
mark properties withfield.group
- Refer to
{group: 'mark.group.width’}
with
- replace
- Transforms
- Aggregation, Bin
- Stack
- Use vega2 stack's parameter and rename it to
<field_name>_start|end
, remove the need to add facet transform before stacking - Make facet comes after stack for stacked area chart (This makes stacked area chart looks almost right but still looks weird due to #307 – see example screenshot)
- Use vega2 stack's parameter and rename it to
- Facet
- use field name reference instead of using
keys.0
(#639)
- use field name reference instead of using
- Aggregation (#621)
avg
=>mean
- add all supported aggregation in Vega 2
- Sorting (#612)
- remove
sort.js
and no longer usesort-<field_name>
tables as data source - modify
scale.domain()
to include DataRef’s.sort
object - modify
sort
property to be consistent with Vega 2 (but still leave it as a top-level vega-lite property)sort.name
=>sort.field
sort.aggregate
=>sort.op
- remove
API Change
vl.field
=>vl.encDef
, field.js => encDef.js
Internal Refactor
Variable Name
fieldName
=>field
field
=>encDef
Other
- update vega dependency in editor and gallery to Vega 2
- removed
_vega2
flag - extract filter non-positive value when log are presented from normal filter
- eliminate
encoding.fieldName()
and just useencoding.field(...).name
- only use
encDef.name
where applicable rather than callingfieldRef
- local variable refactor in
scale.js
- move stack’s stacked data transform to data.stack
- add encoding.stack so we do not have to pass stack around
- remove Encoding.toggleFilterNullO, which should just be a part of vega-lite-ui
Examples
- added Aggregate Bar Chart, Stacked bar chart, Trellis Stacked Bar Chart
- both vl input and vg output are validated in the gallery and editor
v0.7.18
Release v0.7.13
Release v0.7.13.