Releases: vega/vega-lite
Releases · vega/vega-lite
v1.0.8
Syntax
- Support
yearmonthdayhoursminutesseconds
Fixes
- Fix
vl2pngandvl2svg– Thanks @sampsyo - Correct
strokeDashOffsetschema – Thanks @mprudhom - Ensure that all output are valid Vega specifications based on Vega Schema – Thanks @mprudhom
Internal
- Move interfaces from
src/schematosrc/ - Move all
compile/mark-*.tstocompile/mark/*.ts
v0.9.3
Syntax
- Scale
- remove scale and sort from detail and make sure there is no scale for detail in the output
- remove
pointsfrom ordinal scale #924
- Axis
- Add axis properties:
labels,tickSizeMajor,tickSizeMinor,tickSizeEnd,values - rename
shortTimeName=>shortTimeLabel - allow hiding
axisby settingaxistofalse
- Add axis properties:
- Mark
- revised rules for
barandarea
- revised rules for
- Channel
- add
pathchannel forlineand removeconfig.sortLineBy - support multiple
detailfields (as array) #904 -
- add
- Time Unit
- Adds additional time units such as
yearmonth,yearmonthday,hoursminutes, ... - Allow customization of time format.
- Adds additional time units such as
- Config
- add
config.scene - make
config.nullFiltera boolean property config.mark- Support
config.stack.offset=’normalize - Add properties for hiding facet’s grid and docs for all
cell.gridproperties
- add
API
- Change the main file to
vl.jsinstead of the compiled file. vl.schema.util.merge=>vl.schema.util.mergeDeep
Output
- Data
- Rename
STACKEDtoSTACKED_SCALEto avoid confusion since the data source sums data for scale while the actual stack layout is applied inline. - Remove the unnecessary max calculation in STACKED_SCALE since scale would automatically calculate max anyway.
- Rename
- Faceting
- Replace
facettransform withaggregatetransform for axes group - Apply
axis.gridofrowandcolumnto our customized grid built by a rule mark group instead of passing it to the row’s scale. Also remove the redundantconfig.cell.gridShow. Fixes #943 - Apply
scale.paddingofrowandcolumnto our cell padding layout calculation & remove the redundantconfig.cell.padding. Fixes #917 - Set ROW and COLUMN’s padding to 0 if Y and X are not mapped respectively. Fixes #822
- Replace
- Time Unit
- Use timestamps internally for temporal data even if the data is being aggregated.
- When time unit is
month,day,hours,minutes, orseconds, vl automatically adds missing points to the domain. Previously the domain was set directly. Now, vl creates a new data source.
- Optimize order of Vega output (make sure that
fromcomes beforeproperties) - Add
spec.nameas prefix to mark group and scale’s name - Auto drop unsupported channel from the output spec
- Make bin_range for bin_scale #879
- Determine date, year, second, minute's scale type based on mark type and orientation.
(For dimension channel of bar or tick mark, use ordinal scale. Otherwise, use linear scale.) #912 - Add offset for vertical dot plot with tick
- Use
xcandycfor ticks so we don’t have to add offset
Bug Fixes
- Ensure that
transformin axes group are arrays + refactor - Support stacked charts with both detail and color #878
- Correctly calculate total width/height and offset for trellis plot #880
- Fix broken legend color + add stroke transparent #916
- Apply mark config to legend as well #913
- Make
size.valueworks withtickandbarmark – fixes #931 - avoid outputting both
bandWidthandrange#953
v0.9.2
v0.9.1
Syntax
- bin
- Support more
binproperties
- Support more
Output
- Fix layout bug for bin and time unit
Internal
- update + remove outdated dependencies
- update build scripts
- add utility methods
bin/vl2png,bin/vl2svgand methods for producing image from vega-lite specnpm run x-compileandnpm run x-difffor visual test
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
speccontains the vega spec. (We will add warning / errors as additional properties in the future.)
- It no longer requires
Syntax
- CORE SYNTAX CHANGES
- Rename
marktypetomark - Rename
nametofieldin each field definition - Rename
coltocolumnfor 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 thetypeproperty is now case insensitive.
- Rename
- Added vega's scale, axis, and legend properties that should be supported #181
- Added scale property to
row,columnandshape - rename / refactor
axis.maxLabelLength=>axis.labelMaxLengthscale.bandSize=>scale.bandWidth- Move
encDef.bandto be a part ofscaleband.size=>scale.bandWidthband.padding=>scale.padding
- revise
useRawDomainto 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.paddingandconfig.useRawDomainas it is redundant withscale.bandWidthandscale.padding,scale.useRawDomainin field definitions- set default values of
scale.bandWidth,scale.paddingjust for X, Y
- set default values of
- group configs of a particular element together
config.cell- move
cellconfigs to be undercell:width,height,padding,gridColor,gridOpacity,gridOffset- remove
config.singleWidth,config.singleHeight,encoding.column.width,encoding.row.heightand 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,fontWeightfromencoding.texttoconfig.marks encoding.shape.filled=>config.marks.filledencoding.color.opacity=>config.marks.opacity- move all text properties from
encoding.texttoconfig.marksexcept renamingencoding.text.placeholdertoencoding.text.value config.strokeWidth=>config.marks.strokeWidth- added missing properties
- move
- remove unused
Output
- data
- rename Vega’s
datatables:raw=>sourceandaggregate=>summary - added
layouttable for layout calculation and addrootmarks group for bindinglayoutdata
- rename Vega’s
- output now describe properties in
updaterather thanenter - only produces
scales,axes,legendswhen they are non-empty - removed axis grid for
rowandcolumnand addedrulemarks (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,pointsandzero - set axis's
layer: 'back'only ifgridistrue- 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
requiredEncodingsandsupportedEncodingstovl.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.fieldDefvl.enc=>vl.encodingvl.Encoding=>vl.specfor static methodsvl.Encoding=>vl.compiler.modelfor 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.gridfor 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
imputetransform - Remove
sorttransform from output stacked area chart spec asstacktransform already includedsortby
v0.8.2
v0.8.1
v0.8.0 – Migrating to Vega 2
Syntax Change
- axis
- only include
axis.orientwhen necessary
- only include
- legends
- set legend's orient to right by default (similar to Vega)
- Vega-lite now supports multiple legends
- filter
- move
filtertodata.filterand takes Vega expression as parameter instead of a complicated predicate object. - Null filter is added before binning and timeUnit conversion
- move
- scale
scale.reverseis removed as it is redundant withsort.
- stack
- add stack control to
coloranddetailencoding
- add stack control to
- sort — now
sortproperty 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.datawithdatumin filter - add
datum.option to fieldRef and use it in time transform and template - eliminate outdated
fieldRefoptions - Replace the eliminated
groupmark 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.jsand no longer usesort-<field_name>tables as data source - modify
scale.domain()to include DataRef’s.sortobject - modify
sortproperty to be consistent with Vega 2 (but still leave it as a top-level vega-lite property)sort.name=>sort.fieldsort.aggregate=>sort.op
- remove
API Change
vl.field=>vl.encDef, field.js => encDef.js
Internal Refactor
Variable Name
fieldName=>fieldfield=>encDef
Other
- update vega dependency in editor and gallery to Vega 2
- removed
_vega2flag - extract filter non-positive value when log are presented from normal filter
- eliminate
encoding.fieldName()and just useencoding.field(...).name - only use
encDef.namewhere 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