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 Jun 13, 2022
1 parent 2caa793 commit e9de04b
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 0 deletions.
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/interactive_bar_full_height_hover.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
228 changes: 228 additions & 0 deletions examples/compiled/interactive_bar_full_height_hover.vg.json
@@ -0,0 +1,228 @@
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"width": 200,
"height": 200,
"style": "cell",
"data": [
{
"name": "hover_store",
"transform": [{"type": "collect", "sort": {"field": "_vgsid_"}}]
},
{
"name": "source_0",
"url": "data/movies.json",
"format": {"type": "json"},
"transform": [
{"type": "identifier", "as": "_vgsid_"},
{
"type": "extent",
"field": "IMDB Rating",
"signal": "layer_1_bin_maxbins_10_IMDB_Rating_extent"
},
{
"type": "bin",
"field": "IMDB Rating",
"as": [
"bin_maxbins_10_IMDB Rating",
"bin_maxbins_10_IMDB Rating_end"
],
"signal": "layer_1_bin_maxbins_10_IMDB_Rating_bins",
"extent": {"signal": "layer_1_bin_maxbins_10_IMDB_Rating_extent"},
"maxbins": 10
},
{
"type": "aggregate",
"groupby": [
"bin_maxbins_10_IMDB Rating",
"bin_maxbins_10_IMDB Rating_end"
],
"ops": ["count"],
"fields": [null],
"as": ["__count"]
}
]
},
{
"name": "data_0",
"source": "source_0",
"transform": [
{"type": "identifier", "as": "_vgsid_"},
{
"type": "filter",
"expr": "isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"])"
}
]
},
{
"name": "data_1",
"source": "source_0",
"transform": [
{
"type": "filter",
"expr": "isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) && isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"])"
}
]
}
],
"signals": [
{
"name": "unit",
"value": {},
"on": [
{"events": "mousemove", "update": "isTuple(group()) ? group() : unit"}
]
},
{
"name": "hover",
"update": "vlSelectionResolve(\"hover_store\", \"union\", true, true)"
},
{
"name": "hover_tuple",
"on": [
{
"events": [{"source": "scope", "type": "mouseover"}],
"update": "datum && item().mark.marktype !== 'group' ? {unit: \"layer_0\", _vgsid_: (item().isVoronoi ? datum.datum : datum)[\"_vgsid_\"]} : null",
"force": true
},
{"events": [{"source": "view", "type": "mouseout"}], "update": "null"}
]
},
{
"name": "hover_toggle",
"value": false,
"on": [
{
"events": [{"source": "scope", "type": "mouseover"}],
"update": "event.shiftKey"
},
{"events": [{"source": "view", "type": "mouseout"}], "update": "false"}
]
},
{
"name": "hover_modify",
"on": [
{
"events": {"signal": "hover_tuple"},
"update": "modify(\"hover_store\", hover_toggle ? null : hover_tuple, hover_toggle ? null : true, hover_toggle ? hover_tuple : null)"
}
]
}
],
"marks": [
{
"name": "layer_0_marks",
"type": "rect",
"style": ["bar"],
"interactive": true,
"from": {"data": "data_0"},
"encode": {
"update": {
"tooltip": {
"signal": "{\"IMDB Rating (binned)\": !isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \"\" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\"), \"Count of Records\": format(datum[\"__count\"], \"\")}"
},
"fill": {"value": "#eee"},
"opacity": [
{
"test": "length(data(\"hover_store\")) && vlSelectionIdTest(\"hover_store\", datum)",
"value": 0.5
},
{"value": 0}
],
"ariaRoleDescription": {"value": "bar"},
"description": {
"signal": "\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \"\" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
"x2": {
"scale": "x",
"field": "bin_maxbins_10_IMDB Rating",
"offset": 1
},
"x": {"scale": "x", "field": "bin_maxbins_10_IMDB Rating_end"},
"y": {"value": 0},
"y2": {"field": {"group": "height"}}
}
}
},
{
"name": "layer_1_marks",
"type": "rect",
"style": ["bar"],
"interactive": false,
"from": {"data": "data_1"},
"encode": {
"update": {
"fill": {"value": "#4c78a8"},
"ariaRoleDescription": {"value": "bar"},
"description": {
"signal": "\"IMDB Rating (binned): \" + (!isValid(datum[\"bin_maxbins_10_IMDB Rating\"]) || !isFinite(+datum[\"bin_maxbins_10_IMDB Rating\"]) ? \"null\" : format(datum[\"bin_maxbins_10_IMDB Rating\"], \"\") + \"\" + format(datum[\"bin_maxbins_10_IMDB Rating_end\"], \"\")) + \"; Count of Records: \" + (format(datum[\"__count\"], \"\"))"
},
"x2": {
"scale": "x",
"field": "bin_maxbins_10_IMDB Rating",
"offset": 1
},
"x": {"scale": "x", "field": "bin_maxbins_10_IMDB Rating_end"},
"y": {"scale": "y", "field": "__count"},
"y2": {"scale": "y", "value": 0}
}
}
}
],
"scales": [
{
"name": "x",
"type": "linear",
"domain": {
"signal": "[layer_1_bin_maxbins_10_IMDB_Rating_bins.start, layer_1_bin_maxbins_10_IMDB_Rating_bins.stop]"
},
"range": [0, {"signal": "width"}],
"bins": {"signal": "layer_1_bin_maxbins_10_IMDB_Rating_bins"},
"zero": false
},
{
"name": "y",
"type": "linear",
"domain": {"data": "data_1", "field": "__count"},
"range": [{"signal": "height"}, 0],
"nice": true,
"zero": true
}
],
"axes": [
{
"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": "IMDB Rating (binned)",
"labelFlush": true,
"labelOverlap": true,
"tickCount": {"signal": "ceil(width/10)"},
"zindex": 0
},
{
"scale": "y",
"orient": "left",
"grid": false,
"title": "Count of Records",
"labelOverlap": true,
"tickCount": {"signal": "ceil(height/40)"},
"zindex": 0
}
]
}

0 comments on commit e9de04b

Please sign in to comment.