Skip to content

Commit

Permalink
chore: update examples [CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions Bot committed Nov 15, 2024
1 parent b3872ad commit 27b1cbc
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 3 deletions.
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}
}
}
}
}
]
}
2 changes: 1 addition & 1 deletion examples/compiled/dynamic_color_legend.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"width": 600,
"title": {"text": "Seattle Weather, 2012-2015", "anchor": "start"},
"data": [
{"name": "brush_store"},
{"name": "click_store"},
{"name": "brush_store"},
{
"name": "source_0",
"url": "data/seattle-weather.csv",
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/interactive_seattle_weather.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"width": 600,
"title": {"text": "Seattle Weather, 2012-2015", "anchor": "start"},
"data": [
{"name": "brush_store"},
{"name": "click_store"},
{"name": "brush_store"},
{
"name": "source_0",
"url": "data/seattle-weather.csv",
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/selection_concat.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"padding": 5,
"width": 200,
"data": [
{"name": "brush_store"},
{"name": "grid_store"},
{"name": "brush_store"},
{"name": "source_0", "url": "data/cars.json", "format": {"type": "json"}},
{
"name": "data_0",
Expand Down

0 comments on commit 27b1cbc

Please sign in to comment.