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 May 31, 2024
1 parent 891da8e commit d69f22c
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 0 deletions.
Binary file added examples/compiled/bar_conditional_opacity.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/bar_conditional_opacity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 116 additions & 0 deletions examples/compiled/bar_conditional_opacity.vg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"width": 400,
"height": 400,
"style": "cell",
"data": [
{
"name": "source_0",
"values": [
{"Q1_Null": null, "C2": "a1"},
{"Q1_Null": null, "C2": "b1"},
{"Q1_Null": 82.3, "C2": "c1"},
{"Q1_Null": 41.1, "C2": "a2"},
{"Q1_Null": 31.1, "C2": "a2"},
{"Q1_Null": 15.1, "C2": "c2"},
{"Q1_Null": 48.1, "C2": "c3"},
{"Q1_Null": null, "C2": "c4"}
]
},
{
"name": "data_0",
"source": "source_0",
"transform": [
{
"type": "stack",
"groupby": ["C2"],
"field": "Q1_Null",
"sort": {"field": [], "order": []},
"as": ["Q1_Null_start", "Q1_Null_end"],
"offset": "zero"
},
{
"type": "filter",
"expr": "isValid(datum[\"Q1_Null\"]) && isFinite(+datum[\"Q1_Null\"])"
}
]
}
],
"marks": [
{
"name": "layer_0_marks",
"type": "rect",
"style": ["bar"],
"from": {"data": "data_0"},
"encode": {
"update": {
"fill": {"value": "#4c78a8"},
"opacity": {"test": "true", "value": 0.2},
"ariaRoleDescription": {"value": "bar"},
"description": {
"signal": "\"C2: \" + (isValid(datum[\"C2\"]) ? datum[\"C2\"] : \"\"+datum[\"C2\"]) + \"; Q1_Null: \" + (format(datum[\"Q1_Null\"], \"\"))"
},
"x": {"scale": "x", "field": "C2"},
"width": {"signal": "max(0.25, bandwidth('x'))"},
"y": {"scale": "y", "field": "Q1_Null_end"},
"y2": {"scale": "y", "field": "Q1_Null_start"}
}
}
}
],
"scales": [
{
"name": "x",
"type": "band",
"domain": {"data": "data_0", "field": "C2", "sort": true},
"range": [0, {"signal": "width"}],
"paddingInner": 0.1,
"paddingOuter": 0.05
},
{
"name": "y",
"type": "linear",
"domain": {"data": "data_0", "fields": ["Q1_Null_start", "Q1_Null_end"]},
"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": "C2",
"labelAlign": "right",
"labelAngle": 270,
"labelBaseline": "middle",
"zindex": 0
},
{
"scale": "y",
"orient": "left",
"grid": false,
"title": "Q1_Null",
"labelOverlap": true,
"tickCount": {"signal": "ceil(height/40)"},
"zindex": 0
}
]
}

0 comments on commit d69f22c

Please sign in to comment.