Vega-lite: Support Timer Events and Animations

Created on 19 Jul 2018  路  3Comments  路  Source: vega/vega-lite

It would be great if we could create animated charts with Vega-Lite. Note that I do not mean animated transitions during interactions (which need Vega support first https://github.com/vega/vega/issues/641).

Vega has support for timer event streams. These event streams can be used to create animations that play once or repeat.

Use cases

Proposal

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {
    "url": "data.json"
  },
  "mark": "bar",
  "encoding": {
    "x": {"field": "a", "type": "ordinal"},
    "y": {"field": "b", "type": "quantitative"},
    "frame": {"field": "time", "type": "ordinal", "interval": 1000},
    "key": {"field": "a", "type": "ordinal"}
  }
}

frame here defines an animation frame or step. The key channel is used to identify the same mark across frames. This is particularly interesting for points that move through the x/y space. Until we have transitions (needs Vega support), this is less relevant, though.

  • We only support ordinal (iterate through) and quantitative (do we need a step size?).
  • How should users define an interval?

Competing approaches

Expressions

An alternative to the time channel is writing timers in expressions.

Others?

Area - Visual Encoding Enhancement RFC / Discussion

Most helpful comment

Is there any progress on this? Thanks.

All 3 comments

Is timer more like an encoding or more like a selection/interaction?

Is there any progress on this? Thanks.

http://www.ycwu.org/Files/Data-GIF.pdf gives a good overview over the design space.

Screen Shot 2020-10-29 at 10 06 39

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcnuttandrew picture mcnuttandrew  路  3Comments

kanitw picture kanitw  路  3Comments

kanitw picture kanitw  路  3Comments

swanderz picture swanderz  路  4Comments

domoritz picture domoritz  路  4Comments