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 Jul 19, 2023
1 parent 98e0ebe commit d073d29
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 51 deletions.
Binary file modified examples/compiled/area_cumulative_freq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/compiled/area_cumulative_freq.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 12 additions & 5 deletions examples/compiled/area_cumulative_freq.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
"fields": ["count"],
"sort": {"field": ["IMDB Rating"], "order": ["ascending"]},
"frame": [null, 0]
},
{
"type": "aggregate",
"groupby": ["IMDB Rating"],
"ops": ["max"],
"fields": ["Cumulative Count"],
"as": ["max_Cumulative Count"]
}
]
}
Expand All @@ -35,13 +42,13 @@
"orient": {"value": "vertical"},
"fill": {"value": "#4c78a8"},
"description": {
"signal": "\"IMDB Rating: \" + (format(datum[\"IMDB Rating\"], \"\")) + \"; Cumulative Count: \" + (format(datum[\"Cumulative Count\"], \"\"))"
"signal": "\"IMDB Rating: \" + (format(datum[\"IMDB Rating\"], \"\")) + \"; Max of Cumulative Count: \" + (format(datum[\"max_Cumulative Count\"], \"\"))"
},
"x": {"scale": "x", "field": "IMDB Rating"},
"y": {"scale": "y", "field": "Cumulative Count"},
"y": {"scale": "y", "field": "max_Cumulative Count"},
"y2": {"scale": "y", "value": 0},
"defined": {
"signal": "isValid(datum[\"IMDB Rating\"]) && isFinite(+datum[\"IMDB Rating\"]) && isValid(datum[\"Cumulative Count\"]) && isFinite(+datum[\"Cumulative Count\"])"
"signal": "isValid(datum[\"IMDB Rating\"]) && isFinite(+datum[\"IMDB Rating\"]) && isValid(datum[\"max_Cumulative Count\"]) && isFinite(+datum[\"max_Cumulative Count\"])"
}
}
}
Expand All @@ -59,7 +66,7 @@
{
"name": "y",
"type": "linear",
"domain": {"data": "source_0", "field": "Cumulative Count"},
"domain": {"data": "source_0", "field": "max_Cumulative Count"},
"range": [{"signal": "height"}, 0],
"nice": true,
"zero": true
Expand Down Expand Up @@ -108,7 +115,7 @@
"scale": "y",
"orient": "left",
"grid": false,
"title": "Cumulative Count",
"title": "Max of Cumulative Count",
"labelOverlap": true,
"tickCount": {"signal": "ceil(height/40)"},
"zindex": 0
Expand Down
25 changes: 22 additions & 3 deletions examples/compiled/area_density.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@
"field": "IMDB Rating",
"bandwidth": 0.3,
"as": ["value", "density"]
},
{
"type": "impute",
"field": "density",
"groupby": [],
"key": "value",
"method": "value",
"value": 0
},
{
"type": "stack",
"groupby": ["value"],
"field": "density",
"sort": {"field": [], "order": []},
"as": ["density_start", "density_end"],
"offset": "zero"
}
]
}
Expand All @@ -35,8 +51,8 @@
"signal": "\"IMDB Rating: \" + (format(datum[\"value\"], \"\")) + \"; density: \" + (format(datum[\"density\"], \"\"))"
},
"x": {"scale": "x", "field": "value"},
"y": {"scale": "y", "field": "density"},
"y2": {"scale": "y", "value": 0},
"y": {"scale": "y", "field": "density_end"},
"y2": {"scale": "y", "field": "density_start"},
"defined": {
"signal": "isValid(datum[\"value\"]) && isFinite(+datum[\"value\"]) && isValid(datum[\"density\"]) && isFinite(+datum[\"density\"])"
}
Expand All @@ -56,7 +72,10 @@
{
"name": "y",
"type": "linear",
"domain": {"data": "source_0", "field": "density"},
"domain": {
"data": "source_0",
"fields": ["density_start", "density_end"]
},
"range": [{"signal": "height"}, 0],
"nice": true,
"zero": true
Expand Down
58 changes: 49 additions & 9 deletions examples/compiled/area_horizon.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,47 @@
{
"name": "data_1",
"source": "data_0",
"transform": [{"type": "formula", "expr": "datum.y - 50", "as": "ny"}]
"transform": [
{
"type": "impute",
"field": "y",
"groupby": [],
"key": "x",
"method": "value",
"value": 0
},
{
"type": "stack",
"groupby": ["x"],
"field": "y",
"sort": {"field": [], "order": []},
"as": ["y_start", "y_end"],
"offset": "zero"
}
]
},
{
"name": "data_2",
"source": "data_0",
"transform": [
{"type": "formula", "expr": "datum.y - 50", "as": "ny"},
{
"type": "impute",
"field": "ny",
"groupby": [],
"key": "x",
"method": "value",
"value": 0
},
{
"type": "stack",
"groupby": ["x"],
"field": "ny",
"sort": {"field": [], "order": []},
"as": ["ny_start", "ny_end"],
"offset": "zero"
}
]
}
],
"marks": [
Expand All @@ -52,7 +92,7 @@
"clip": true,
"style": ["area"],
"sort": {"field": "datum[\"x\"]"},
"from": {"data": "data_0"},
"from": {"data": "data_1"},
"encode": {
"update": {
"opacity": {"value": 0.6},
Expand All @@ -62,8 +102,8 @@
"signal": "\"x: \" + (format(datum[\"x\"], \"\")) + \"; y: \" + (format(datum[\"y\"], \"\"))"
},
"x": {"scale": "x", "field": "x"},
"y": {"scale": "y", "field": "y"},
"y2": {"scale": "y", "value": 0},
"y": {"scale": "y", "field": "y_end"},
"y2": {"scale": "y", "field": "y_start"},
"defined": {
"signal": "isValid(datum[\"x\"]) && isFinite(+datum[\"x\"]) && isValid(datum[\"y\"]) && isFinite(+datum[\"y\"])"
}
Expand All @@ -76,7 +116,7 @@
"clip": true,
"style": ["area"],
"sort": {"field": "datum[\"x\"]"},
"from": {"data": "data_1"},
"from": {"data": "data_2"},
"encode": {
"update": {
"orient": {"value": "vertical"},
Expand All @@ -86,8 +126,8 @@
"signal": "\"x: \" + (format(datum[\"x\"], \"\")) + \"; ny: \" + (format(datum[\"ny\"], \"\"))"
},
"x": {"scale": "x", "field": "x"},
"y": {"scale": "y", "field": "ny"},
"y2": {"scale": "y", "value": 0},
"y": {"scale": "y", "field": "ny_end"},
"y2": {"scale": "y", "field": "ny_start"},
"defined": {
"signal": "isValid(datum[\"x\"]) && isFinite(+datum[\"x\"]) && isValid(datum[\"ny\"]) && isFinite(+datum[\"ny\"])"
}
Expand All @@ -101,8 +141,8 @@
"type": "linear",
"domain": {
"fields": [
{"data": "data_0", "field": "x"},
{"data": "data_1", "field": "x"}
{"data": "data_1", "field": "x"},
{"data": "data_2", "field": "x"}
]
},
"range": [0, {"signal": "width"}],
Expand Down
24 changes: 20 additions & 4 deletions examples/compiled/area_params.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,23 @@
"name": "data_0",
"source": "source_0",
"transform": [
{"type": "formula", "expr": "toNumber(datum[\"u\"])", "as": "u"}
{"type": "formula", "expr": "toNumber(datum[\"u\"])", "as": "u"},
{
"type": "impute",
"field": "v",
"groupby": [],
"key": "u",
"method": "value",
"value": 0
},
{
"type": "stack",
"groupby": ["u"],
"field": "v",
"sort": {"field": [], "order": []},
"as": ["v_start", "v_end"],
"offset": "zero"
}
]
}
],
Expand Down Expand Up @@ -67,8 +83,8 @@
"signal": "\"u: \" + (format(datum[\"u\"], \"\")) + \"; v: \" + (format(datum[\"v\"], \"\"))"
},
"x": {"scale": "x", "field": "u"},
"y": {"scale": "y", "field": "v"},
"y2": {"scale": "y", "value": 0},
"y": {"scale": "y", "field": "v_end"},
"y2": {"scale": "y", "field": "v_start"},
"defined": {
"signal": "isValid(datum[\"u\"]) && isFinite(+datum[\"u\"]) && isValid(datum[\"v\"]) && isFinite(+datum[\"v\"])"
}
Expand All @@ -88,7 +104,7 @@
{
"name": "y",
"type": "linear",
"domain": {"data": "data_0", "field": "v"},
"domain": {"data": "data_0", "fields": ["v_start", "v_end"]},
"range": [{"signal": "height"}, 0],
"nice": true,
"zero": true
Expand Down
Binary file modified examples/compiled/stacked_area_without_agg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/compiled/stacked_area_without_agg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 21 additions & 5 deletions examples/compiled/stacked_area_without_agg.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,23 @@
"name": "data_0",
"source": "source_0",
"transform": [
{"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"}
{"type": "formula", "expr": "toNumber(datum[\"a\"])", "as": "a"},
{
"type": "impute",
"field": "b",
"groupby": ["c"],
"key": "a",
"method": "value",
"value": 0
},
{
"type": "stack",
"groupby": ["a"],
"field": "b",
"sort": {"field": ["c"], "order": ["descending"]},
"as": ["b_start", "b_end"],
"offset": "zero"
}
]
}
],
Expand Down Expand Up @@ -58,8 +74,8 @@
"signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (isValid(datum[\"c\"]) ? datum[\"c\"] : \"\"+datum[\"c\"])"
},
"x": {"scale": "x", "field": "a"},
"y": {"scale": "y", "field": "b"},
"y2": {"scale": "y", "value": 0},
"y": {"scale": "y", "field": "b_end"},
"y2": {"scale": "y", "field": "b_start"},
"defined": {
"signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])"
}
Expand Down Expand Up @@ -98,7 +114,7 @@
"signal": "\"a: \" + (format(datum[\"a\"], \"\")) + \"; b: \" + (format(datum[\"b\"], \"\")) + \"; c: \" + (isValid(datum[\"c\"]) ? datum[\"c\"] : \"\"+datum[\"c\"])"
},
"x": {"scale": "x", "field": "a"},
"y": {"scale": "y", "field": "b"},
"y": {"scale": "y", "field": "b_end"},
"defined": {
"signal": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])"
}
Expand All @@ -120,7 +136,7 @@
{
"name": "y",
"type": "linear",
"domain": {"data": "data_0", "field": "b"},
"domain": {"data": "data_0", "fields": ["b_start", "b_end"]},
"range": [{"signal": "height"}, 0],
"nice": true,
"zero": true
Expand Down
Loading

0 comments on commit d073d29

Please sign in to comment.