Skip to content

Commit

Permalink
Merge branch 'main' into kw/vega-TimeFormatSpecifier
Browse files Browse the repository at this point in the history
# Conflicts:
#	build/vega-lite-schema.json
  • Loading branch information
domoritz committed Feb 11, 2025
2 parents e97812c + ad6be29 commit 4b37a81
Show file tree
Hide file tree
Showing 151 changed files with 4,026 additions and 3,059 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

runtime-lint-coverage:
name: Runtime, Linting, and Coverage
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
run: yarn jest test/ --collectCoverage=true

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.6.0
uses: codecov/codecov-action@v5.3.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@


# [5.23.0](https://github.com/vega/vega-lite/compare/v5.21.0...v5.23.0) (2024-12-10)


### Bug Fixes

* **#9480:** apply proper quote escapes for the datum access expression ([#9479](https://github.com/vega/vega-lite/issues/9479)) ([6a73892](https://github.com/vega/vega-lite/commit/6a7389272e179fadc3d502bf2f80e319241029c6)), closes [#9480](https://github.com/vega/vega-lite/issues/9480)
* links in docs ([#9450](https://github.com/vega/vega-lite/issues/9450)) ([4098609](https://github.com/vega/vega-lite/commit/409860957c46d07f9fe449aaeb6d86ef50c89ec9))


### Features

* frame animations with time encoding and timer param ([#8921](https://github.com/vega/vega-lite/issues/8921)) ([e3f9620](https://github.com/vega/vega-lite/commit/e3f9620ed3d3284bb4acd66cc39074d579b80903))

# [5.21.0](https://github.com/vega/vega-lite/compare/v5.20.1...v5.21.0) (2024-08-28)


Expand Down
4 changes: 2 additions & 2 deletions bin/vl2vg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

const {createWriteStream} = require('fs');
const vegaLite = require('..');
const compactStringify = require('json-stringify-pretty-compact');
const read = require('./read');
const args = require('./args');

Expand All @@ -13,13 +12,14 @@ const arg = args('vega');
// load spec, compile vg spec
read(arg._[0]).then(text => compile(JSON.parse(text)));

function compile(vlSpec) {
async function compile(vlSpec) {
// @ts-ignore
const vgSpec = vegaLite.compile(vlSpec).spec;

const file = arg._[1] || null;
const out = file ? createWriteStream(file) : process.stdout;
if (arg.p) {
const compactStringify = (await import('json-stringify-pretty-compact')).default;
out.write(compactStringify(vgSpec) + '\n');
} else {
out.write(JSON.stringify(vgSpec) + '\n');
Expand Down
297 changes: 293 additions & 4 deletions build/vega-lite-schema.json

Large diffs are not rendered by default.

Binary file added examples/compiled/animated_gapminder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/compiled/animated_gapminder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
210 changes: 210 additions & 0 deletions examples/compiled/animated_gapminder.vg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"width": 200,
"height": 200,
"style": "cell",
"data": [
{"name": "animation_frame_store"},
{
"name": "source_0",
"url": "data/gapminder.json",
"format": {"type": "json"},
"transform": [
{
"type": "filter",
"expr": "isValid(datum[\"fertility\"]) && isFinite(+datum[\"fertility\"]) && isValid(datum[\"life_expect\"]) && isFinite(+datum[\"life_expect\"])"
}
]
},
{
"name": "source_0_curr",
"source": "source_0",
"transform": [
{
"type": "filter",
"expr": "!length(data(\"animation_frame_store\")) || vlSelectionTest(\"animation_frame_store\", datum)"
}
]
}
],
"signals": [
{
"name": "unit",
"value": {},
"on": [
{"events": "pointermove", "update": "isTuple(group()) ? group() : unit"}
]
},
{
"name": "animation_frame",
"update": "vlSelectionResolve(\"animation_frame_store\", \"union\", true, true)"
},
{
"name": "anim_clock",
"init": "0",
"on": [
{
"events": {"type": "timer", "throttle": 16.666666666666668},
"update": "is_playing ? (anim_clock + (now() - last_tick_at) > max_range_extent ? 0 : anim_clock + (now() - last_tick_at)) : anim_clock"
}
]
},
{
"name": "last_tick_at",
"init": "now()",
"on": [
{
"events": [{"signal": "anim_clock"}, {"signal": "is_playing"}],
"update": "now()"
}
]
},
{"name": "is_playing", "init": "true"},
{"name": "eased_anim_clock", "update": "anim_clock"},
{"name": "animation_frame_domain", "init": "domain('time')"},
{"name": "min_extent", "init": "extent(animation_frame_domain)[0]"},
{"name": "max_range_extent", "init": "extent(range('time'))[1]"},
{"name": "anim_value", "update": "invert('time', eased_anim_clock)"},
{
"name": "animation_frame_tuple",
"on": [
{
"events": [{"signal": "eased_anim_clock"}, {"signal": "anim_value"}],
"update": "{unit: \"\", fields: animation_frame_tuple_fields, values: [anim_value ? anim_value : min_extent]}",
"force": true
}
]
},
{
"name": "animation_frame_tuple_fields",
"value": [{"type": "E", "field": "year"}]
},
{
"name": "animation_frame_modify",
"on": [
{
"events": {"signal": "animation_frame_tuple"},
"update": "modify(\"animation_frame_store\", animation_frame_tuple, true)"
}
]
}
],
"marks": [
{
"name": "marks",
"type": "symbol",
"style": ["point"],
"interactive": true,
"from": {"data": "source_0_curr"},
"encode": {
"update": {
"opacity": {"value": 0.7},
"fill": {"value": "transparent"},
"stroke": {"scale": "color", "field": "country"},
"ariaRoleDescription": {"value": "point"},
"description": {
"signal": "\"fertility: \" + (format(datum[\"fertility\"], \"\")) + \"; life_expect: \" + (format(datum[\"life_expect\"], \"\")) + \"; country: \" + (isValid(datum[\"country\"]) ? datum[\"country\"] : \"\"+datum[\"country\"]) + \"; year: \" + (isValid(datum[\"year\"]) ? datum[\"year\"] : \"\"+datum[\"year\"])"
},
"x": {"scale": "x", "field": "fertility"},
"y": {"scale": "y", "field": "life_expect"}
}
}
}
],
"scales": [
{
"name": "x",
"type": "linear",
"domain": {"data": "source_0", "field": "fertility"},
"range": [0, {"signal": "width"}],
"nice": true,
"zero": true
},
{
"name": "y",
"type": "linear",
"domain": {"data": "source_0", "field": "life_expect"},
"range": [{"signal": "height"}, 0],
"nice": true,
"zero": true
},
{
"name": "color",
"type": "ordinal",
"domain": {"data": "source_0", "field": "country", "sort": true},
"range": "category"
},
{
"name": "time",
"type": "band",
"domain": {"data": "source_0", "field": "year", "sort": true},
"range": {"step": 500}
}
],
"axes": [
{
"scale": "x",
"orient": "bottom",
"gridScale": "y",
"grid": true,
"tickCount": {"signal": "ceil(width/40)"},
"domain": false,
"labels": false,
"aria": false,
"maxExtent": 0,
"minExtent": 0,
"ticks": false,
"zindex": 0
},
{
"scale": "y",
"orient": "left",
"gridScale": "x",
"grid": true,
"tickCount": {"signal": "ceil(height/40)"},
"domain": false,
"labels": false,
"aria": false,
"maxExtent": 0,
"minExtent": 0,
"ticks": false,
"zindex": 0
},
{
"scale": "x",
"orient": "bottom",
"grid": false,
"title": "fertility",
"labelFlush": true,
"labelOverlap": true,
"tickCount": {"signal": "ceil(width/40)"},
"zindex": 0
},
{
"scale": "y",
"orient": "left",
"grid": false,
"title": "life_expect",
"labelOverlap": true,
"tickCount": {"signal": "ceil(height/40)"},
"zindex": 0
}
],
"legends": [
{
"stroke": "color",
"symbolType": "circle",
"title": "country",
"encode": {
"symbols": {
"update": {
"fill": {"value": "transparent"},
"opacity": {"value": 0.7}
}
}
}
}
]
}
Binary file added examples/compiled/animated_hop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/compiled/animated_hop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4b37a81

Please sign in to comment.