Skip to content

Releases: vega/vega-lite

v1.0.9

18 May 05:24
Compare
Choose a tag to compare

Features

Fixes

  • Fix broken legend stroke color #1203
  • Fix bug tick orient inverted #1348
  • Disable default strokeDash for legend #1344
  • Make CellConfig.strokeDash an array #1313 – Thanks @mprudhom
  • Add tickSizeRange #1299 – Thanks @mprudhom
  • Make size channel stackable #1312
  • Read bandSize config if the scale does not exist #1286
  • Axis and legend properties should not be set if empty – Fix #1221 #1223

Internal

  • Refactor internal compile to treat facet as a compositional operator in preparation for other composition support
  • Export timeunit.format() for VgTooltip #1240
  • Export config #1227 – Thanks @mprudhom

Docs

Examples

  • bubble_health_income
  • github_punchcard
  • trellis_anscombe – Thanks @mcorrell

Experimental

  • Layer operator for creating layered charts.

v1.0.8

01 Mar 21:41
Compare
Choose a tag to compare

Syntax

  • Support yearmonthdayhoursminutesseconds

Fixes

  • Fix vl2png and vl2svg – Thanks @sampsyo
  • Correct strokeDashOffset schema – Thanks @mprudhom
  • Ensure that all output are valid Vega specifications based on Vega Schema – Thanks @mprudhom

Internal

  • Move interfaces from src/schema to src/
  • Move all compile/mark-*.ts to compile/mark/*.ts

v0.9.3

27 Jan 20:30
Compare
Choose a tag to compare

Syntax

  • Scale
    • remove scale and sort from detail and make sure there is no scale for detail in the output
    • remove points from ordinal scale #924
  • Axis
    • Add axis properties: labels, tickSizeMajor, tickSizeMinor, tickSizeEnd, values
    • rename shortTimeName => shortTimeLabel
    • allow hiding axis by setting axis to false
  • Mark
    • revised rules for bar and area
  • Channel
    • add path channel for line and remove config.sortLineBy
    • support multiple detail fields (as array) #904 -
  • Time Unit
    • Adds additional time units such as yearmonth, yearmonthday, hoursminutes, ...
    • Allow customization of time format.
  • Config
    • add config.scene
    • make config.nullFilter a boolean property
    • config.mark
      • rename config.marks => config.mark
      • add fill, fillOpacity, stroke, and strokeOpacity
      • add rules for config.marks.orient
      • make config.marks.filled applicable for bar and area #886
      • add thickness for tick mark and set to 1 by default #922, #933
    • Support config.stack.offset = ’normalize
    • Add properties for hiding facet’s grid and docs for all cell.grid properties

API

  • Change the main file to vl.js instead of the compiled file.
  • vl.schema.util.merge => vl.schema.util.mergeDeep

Output

  • Data
    • Rename STACKED to STACKED_SCALE to 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.
  • Faceting
    • Replace facet transform with aggregate transform for axes group
    • Apply axis.grid of row and column to our customized grid built by a rule mark group instead of passing it to the row’s scale. Also remove the redundant config.cell.gridShow. Fixes #943
    • Apply scale.padding of row and column to our cell padding layout calculation & remove the redundant config.cell.padding. Fixes #917
    • Set ROW and COLUMN’s padding to 0 if Y and X are not mapped respectively. Fixes #822
  • Time Unit
    • Use timestamps internally for temporal data even if the data is being aggregated.
    • When time unit is month, day, hours, minutes, or seconds, 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 from comes before properties)
  • Add spec.name as 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 xc and yc for ticks so we don’t have to add offset

Bug Fixes

  • Ensure that transform in 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.value works with tick and bar mark – fixes #931
  • avoid outputting both bandWidth and range #953

v0.9.2

07 Dec 23:28
Compare
Choose a tag to compare

Include typings/ which contains type declarations for imported modules.

v0.9.1

07 Dec 23:18
Compare
Choose a tag to compare

Syntax

Output

  • Fix layout bug for bin and time unit

Internal

  • update + remove outdated dependencies
  • update build scripts
  • add utility methods
    • bin/vl2png, bin/vl2svg and methods for producing image from vega-lite spec
    • npm run x-compile and npm run x-diff for visual test

v0.9.0

04 Dec 20:51
Compare
Choose a tag to compare

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.)

Syntax

  • CORE SYNTAX CHANGES
    • Rename marktype to mark
    • Rename name to field in each field definition
    • Rename col to column 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 the type property is now case insensitive.
  • Added vega's scale, axis, and legend properties that should be supported #181
  • Added scale property to row, column and shape
  • rename / refactor
    • axis.maxLabelLength => axis.labelMaxLength
    • scale.bandSize => scale.bandWidth
    • Move encDef.band to be a part of scale
      • 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 and config.useRawDomain as it is redundant with scale.bandWidth and scale.padding, scale.useRawDomain in field definitions
      • set default values of scale.bandWidth, scale.padding just for X, Y
    • group configs of a particular element together
      • config.cell
        • move cell configs to be under cell: width, height, padding, gridColor, gridOpacity, gridOffset
          • remove config.singleWidth, config.singleHeight, encoding.column.width, encoding.row.height and simply always use value from cell.width, cell.height
        • add the following group marks properties to config.cell: fill, fillOpacity, stroke, strokeWidth, strokeOpacity, strokeDash, strokeDashOffset`
        • added missing properties
      • config.marks
        • move baseline, font, fontStyle, fontWeight from encoding.text to config.marks
        • encoding.shape.filled => config.marks.filled
        • encoding.color.opacity => config.marks.opacity
        • move all text properties from encoding.text to config.marks except renaming encoding.text.placeholder to encoding.text.value
        • config.strokeWidth => config.marks.strokeWidth
        • added missing properties

Output

  • data
    • rename Vega’s data tables: raw => source and aggregate => summary
    • added layout table for layout calculation and add root marks group for binding layout data
  • output now describe properties in update rather than enter
  • only produces scales, axes, legends when they are non-empty
  • removed axis grid for row and column and added rule 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 and zero
    • set axis's layer: 'back' only if grid is true - fixes #526
    • complex rules for determining opacity and color scales removed.
    • stack's default order is revised
    • simplified rules for automatic opacity

Helper APIs

  • move requiredEncodings and supportedEncodings to vl.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 methods
    • vl.Encoding => vl.compiler.model for internal model for the compiler
    • scale.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

24 Oct 05:18
Compare
Choose a tag to compare
  • Change default value for axis.grid for binned field to false
  • 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 as stack transform already included sortby

v0.8.2

22 Oct 23:02
Compare
Choose a tag to compare
  • Make encoding definition sort=‘ascending’ by default

Change Vega Output

  • No longer add ’-‘ to sortby in the output stack transform by default
  • Change bin transform to produce start instead of bin to reflect the Vega 2.3.0's syntax change.

v0.8.1

18 Oct 20:40
Compare
Choose a tag to compare
  • schema file is now vega-lite-schema.json rather than spec.json
  • axis.grid is automatically determined. If grid is unspecified, the default value is true for ROW and COL. For X
    and Y, the default value is true for quantitative fields and false
    otherwise.

v0.8.0 – Migrating to Vega 2

18 Oct 18:41
Compare
Choose a tag to compare

Syntax Change

  • axis
    • only include axis.orient when necessary
  • legends
    • set legend's orient to right by default (similar to Vega)
    • Vega-lite now supports multiple legends
  • filter
    • move filter to data.filter and takes Vega expression as parameter instead of a complicated predicate object.
    • Null filter is added before binning and timeUnit conversion
  • scale
    • scale.reverse is removed as it is redundant with sort.
  • stack
    • add stack control to color and detail encoding
  • sort — now sort property can be either undefined, a String or an Object
    • undefined - 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 with datum 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 with field.group
    • Refer to {group: 'mark.group.width’} with
  • 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)
    • Facet
      • use field name reference instead of using keys.0 (#639)
  • Aggregation (#621)
    • avg => mean
    • add all supported aggregation in Vega 2
  • Sorting (#612)
    • remove sort.js and no longer use sort-<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

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 use encoding.field(...).name
  • only use encDef.name where applicable rather than calling fieldRef
  • 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