Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add 4 new examples #3851

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
d45afc0
Add files via upload
avatorl Dec 26, 2023
de223d5
Add new example: table with a scrollbar
avatorl Dec 26, 2023
c98d346
Add new example: table with a scrollbar
avatorl Dec 26, 2023
6797068
Add new example: table with a scrollbar
avatorl Dec 26, 2023
b67a2b4
Delete docs/examples/img/table-scrollbar.png (wrong file)
avatorl Dec 26, 2023
612cddc
Add new example: table with a scrollbar (image)
avatorl Dec 26, 2023
d7cdcc5
Add new example Column Line chart
avatorl Dec 27, 2023
7fec1b2
Add new example Column Line chart (image)
avatorl Dec 27, 2023
c7bc3af
Update examples.json
avatorl Dec 27, 2023
949f1fd
Update column-line-dynamical.md (bug fixed)
avatorl Dec 27, 2023
bcd1885
Update column-line-dynamical.md (bug fixed)
avatorl Dec 27, 2023
6de0431
Update table-scrollbar.json
avatorl Dec 27, 2023
81567ab
Update table-scrollbar.md
avatorl Dec 27, 2023
f81ce09
Add new example - map with a custom tooltip
avatorl Dec 30, 2023
188b068
Add new example - map with a custom tooltip (png)
avatorl Dec 30, 2023
5f7ffd4
Add new example - map with tooltip
avatorl Dec 30, 2023
a5f9ec1
Delete docs/examples/img/column-line-dynamical.png
avatorl Dec 30, 2023
1bab97e
Add new example (image)
avatorl Dec 30, 2023
2d10cd8
Delete docs/examples/img/column-line-dynamical.png
avatorl Dec 30, 2023
5e120f9
Add new example (image)
avatorl Dec 30, 2023
4dfadb0
Update column-line-dynamical.json
avatorl Dec 30, 2023
5c7346a
Add new example - rotating globe
avatorl Dec 31, 2023
67fea42
Add new example - rotating globe
avatorl Dec 31, 2023
bfb429b
Update examples.json
avatorl Dec 31, 2023
48a369b
Update earthquakes-globe.md
avatorl Dec 31, 2023
3005e5f
Update warming-stripes.vg.json
avatorl Dec 31, 2023
9418e4c
Update global-temp.csv
avatorl Dec 31, 2023
568f964
Add new example - table (matrix)
avatorl Jan 1, 2024
04d6b94
Add new example - table (matrix)
avatorl Jan 1, 2024
90ac0ba
Add new example: table-matrix
avatorl Jan 1, 2024
baa92d0
Add new example: table-matrix
avatorl Jan 1, 2024
b50c4f9
Merge branch 'main' into main
avatorl Jan 10, 2024
61e3d36
Update warming-stripes.vg.json
avatorl Jan 10, 2024
9352186
Update earthquakes-globe.json
avatorl Jan 10, 2024
c982371
Update column-line-dynamical.json
avatorl Jan 13, 2024
e965c0c
Update earthquakes-globe.json
avatorl Jan 13, 2024
f145e0d
Update table-matrix.json
avatorl Jan 13, 2024
7a63e41
Update table-scrollbar.json
avatorl Jan 13, 2024
a8b734a
Update map-with-tooltip.json
avatorl Jan 13, 2024
3901e0e
Update and rename column-line-dynamical.json to column-line-dynamical…
avatorl Jan 14, 2024
1477e54
Update and rename earthquakes-globe.json to earthquakes-globe.vg.json
avatorl Jan 14, 2024
673ca7e
Update and rename map-with-tooltip.json to map-with-tooltip.vg.json
avatorl Jan 14, 2024
f748f51
Update and rename table-matrix.json to table-matrix.vg.json
avatorl Jan 14, 2024
b018e2d
Rename table-scrollbar.json to table-scrollbar.vg.json
avatorl Jan 14, 2024
41c10f9
usermeta property removed
avatorl Jan 14, 2024
5448f07
usermeta property removed
avatorl Jan 14, 2024
0926a8b
usermeta property removed
avatorl Jan 14, 2024
5574cfa
usermeta property removed
avatorl Jan 14, 2024
37416d5
Update earthquakes-globe.vg.json
avatorl Jan 14, 2024
63f37b0
Update column-line-dynamical.md
avatorl Jan 15, 2024
574985e
Update map-with-tooltip.vg.json
avatorl Jan 15, 2024
7212fe1
Update table-matrix.vg.json
avatorl Jan 15, 2024
6500acc
Update table-matrix.vg.json
avatorl Jan 15, 2024
f54944f
Update earthquakes-globe.vg.json
avatorl Jan 15, 2024
473cd38
Update earthquakes-globe.vg.json
avatorl Jan 15, 2024
84e7af3
Update earthquakes-globe.md
avatorl Jan 15, 2024
75eb19d
Update earthquakes-globe.vg.json
avatorl Jan 15, 2024
fc0673d
Update earthquakes-globe.md
avatorl Jan 15, 2024
a5ef698
Update global-temp.csv
avatorl Jan 15, 2024
4bcbe9d
Update docs/examples/column-line-dynamical.md
avatorl May 16, 2024
cc7a4cd
Update docs/examples/column-line-dynamical.md
avatorl May 16, 2024
4c00b37
Update and rename column-line-dynamical.md to column-line-toggle.md
avatorl May 16, 2024
4bac7db
Update and rename column-line-dynamical.vg.json to column-line-toggle…
avatorl May 16, 2024
e080c97
bar-line-toggle changes
avatorl May 17, 2024
9b2cf84
Update bar-line-toggle.md
avatorl May 17, 2024
40468a1
Update examples.json
avatorl May 17, 2024
e3a0c9a
Update bar-line-toggle.md
avatorl May 17, 2024
2471dc2
Delete docs/examples/table-matrix.md
avatorl May 17, 2024
f4d94ff
Delete docs/examples/table-matrix.vg.json
avatorl May 17, 2024
4635c63
Delete docs/data/table-matrix-trade.csv
avatorl May 17, 2024
b661e59
Delete docs/data/table-matrix-flags.csv
avatorl May 17, 2024
0abd349
Update examples.json
avatorl May 17, 2024
46ae5ef
Delete table-matrix.png
avatorl May 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/_data/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
{"name": "u-district-cuisine"},
{"name": "clock"},
{"name": "watch"},
{"name": "warming-stripes"},
{"name": "warming-stripes"},
{"name": "earthquakes-globe"},
{"name": "serpentine-timeline"}
],
"Interaction Techniques": [
Expand All @@ -106,6 +107,9 @@
{"name": "stock-index-chart"},
{"name": "pi-monte-carlo"},
{"name": "zoomable-circle-packing"},
{"name": "table-scrollbar"},
{"name": "bar-line-toggle"},
{"name": "map-with-tooltip"},
{"name": "pacman"},
{"name": "platformer"}
]
Expand Down
58 changes: 30 additions & 28 deletions docs/data/global-temp.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
year,temp
1880,-0.16
1881,-0.07
1882,-0.1
1880,-0.17
1881,-0.09
1882,-0.11
1883,-0.17
1884,-0.28
1885,-0.33
Expand All @@ -13,32 +13,32 @@ year,temp
1891,-0.22
1892,-0.27
1893,-0.31
1894,-0.3
1895,-0.22
1894,-0.31
1895,-0.23
1896,-0.11
1897,-0.11
1898,-0.27
1899,-0.17
1900,-0.08
1901,-0.15
1902,-0.27
1903,-0.36
1904,-0.46
1902,-0.28
1903,-0.37
1904,-0.47
1905,-0.26
1906,-0.22
1907,-0.38
1908,-0.42
1907,-0.39
1908,-0.43
1909,-0.48
1910,-0.43
1910,-0.44
1911,-0.44
1912,-0.36
1912,-0.37
1913,-0.34
1914,-0.15
1915,-0.14
1916,-0.36
1917,-0.46
1918,-0.29
1919,-0.28
1919,-0.27
1920,-0.27
1921,-0.19
1922,-0.28
Expand All @@ -52,21 +52,21 @@ year,temp
1930,-0.16
1931,-0.09
1932,-0.16
1933,-0.28
1933,-0.29
1934,-0.12
1935,-0.2
1936,-0.15
1937,-0.03
1938,0
1939,-0.02
1940,0.13
1941,0.19
1942,0.07
1940,0.12
1941,0.18
1942,0.06
1943,0.09
1944,0.21
1944,0.2
1945,0.09
1946,-0.07
1947,-0.02
1947,-0.03
1948,-0.11
1949,-0.11
1950,-0.17
Expand Down Expand Up @@ -110,34 +110,36 @@ year,temp
1988,0.39
1989,0.27
1990,0.45
1991,0.4
1991,0.41
1992,0.22
1993,0.23
1994,0.32
1994,0.31
1995,0.45
1996,0.33
1997,0.46
1998,0.61
1999,0.38
2000,0.39
2001,0.53
2001,0.54
2002,0.63
2003,0.62
2004,0.53
2005,0.67
2006,0.63
2005,0.68
2006,0.64
2007,0.66
2008,0.54
2009,0.65
2009,0.66
2010,0.72
2011,0.61
2012,0.65
2013,0.67
2013,0.68
2014,0.74
2015,0.9
2016,1.01
2017,0.92
2018,0.85
2019,0.98
2020,1.02
2021,0.84
2020,1.01
2021,0.85
2022,0.89
2023,1.17
15 changes: 15 additions & 0 deletions docs/examples/bar-line-toggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
layout: example
title: Bar and Line Chart
permalink: /examples/bar-line-toggle/index.html
spec: bar-line-toggle
image: /examples/img/bar-line-toggle.png
---

An example of a Vega visualization that automatically switches between a bar chart and a line chart depending on the number of data points.

Use the slider to change the number of data points displayed on the chart. For more than 50 data points, the chart type will be changed from a bar chart to a line chart (with interpolation).

This Vega example made by Andrzej Leszkiewicz [@avatorl](https://github.com/avatorl).

{% include example spec=page.spec %}
152 changes: 152 additions & 0 deletions docs/examples/bar-line-toggle.vg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "An example of Vega visualization that automatically switches between a column chart and a line chart depending on the number of data points",
"width": 800,
"height": 400,
"padding": 35,
"autosize": "pad",
"config": {
"title": {"font": "Tahoma", "fontSize": 18},
"text": {"font": "Tahoma", "fontSize": 14},
"axis": {"labelFont": "Tahoma", "labelFontSize": "12", "labelColor": "gray"}
},
"signals": [
{
"name": "DataPoints",
"description": "Number of data point to display on the chart",
"value": 25,
"bind": {"input": "range", "min": 25, "max": 200, "step": 5}
},
{"name": "colorColumn", "value": "#4682b4"},
{"name": "colorLine", "value": "#4682b4"},
{"name": "colorText", "value": "#000000"},
{"name": "interpolation", "value": "basis"}
],
"data": [
{
"name": "dataset-raw",
"transform": [
{"type": "sequence", "start": 1, "stop": 201, "step": 1, "as": "id"}
]
},
{
"name": "dataset",
"source": "dataset-raw",
"transform": [
{"type": "filter", "expr": "datum.id<=DataPoints"},
{"type": "formula", "expr": "ceil(random()*100)", "as": "value"}
]
},
{
"name": "dataset-rect",
"source": "dataset",
"transform": [
{"type": "filter", "expr": "DataPoints<=50"},
{"type": "collect", "sort": {"field": "id", "order": "ascending"}}
]
},
{
"name": "dataset-line",
"source": "dataset",
"transform": [
{"type": "filter", "expr": "DataPoints>50"},
{"type": "collect", "sort": {"field": "id", "order": "ascending"}}
]
}
],
"scales": [
{
"name": "scaleXRect",
"type": "band",
"domain": {"data": "dataset-rect", "field": "id", "sort": true},
"range": [10, {"signal": "width-10"}],
"padding": 0.05
},
{
"name": "scaleXLine",
"type": "linear",
"domain": {"data": "dataset-line", "field": "id", "sort": true},
"range": [10, {"signal": "width-10"}],
"zero": false
},
{
"name": "scaleYRect",
"domain": {"data": "dataset-rect", "field": "value"},
"domainMax": 100,
"range": [{"signal": "height"}, 0]
},
{
"name": "scaleYLine",
"domain": {"data": "dataset-line", "field": "value"},
"domainMax": 100,
"range": [{"signal": "height"}, 0]
}
],
"axes": [
{
"orient": "bottom",
"scale": "scaleXRect",
"domain": false,
"tickCount": 50
},
{
"orient": "bottom",
"scale": "scaleXLine",
"domain": false,
"tickCount": 10
},
{
"orient": "left",
"scale": "scaleYLine",
"domain": false,
"grid": true,
"ticks": true,
"labels": true
}
],
"marks": [
{
"name": "rect-columns",
"type": "rect",
"from": {"data": "dataset-rect"},
"encode": {
"update": {
"x": {"scale": "scaleXRect", "field": "id"},
"width": {"scale": "scaleXRect", "band": 1},
"y": {"scale": "scaleYRect", "field": "value"},
"y2": {"scale": "scaleYRect", "value": 0},
"fill": {"signal": "colorColumn"},
"strokeWidth": {"value": 0}
}
}
},
{
"type": "text",
"from": {"data": "rect-columns"},
"encode": {
"update": {
"x": {"signal": "datum.x+datum.width/2"},
"y": {"field": "y", "offset": -8},
"align": {"value": "center"},
"baseline": {"value": "middle"},
"fill": {"signal": "colorText"},
"text": {"field": "datum.value"}
}
}
},
{
"type": "line",
"from": {"data": "dataset-line"},
"encode": {
"update": {
"xc": {"scale": "scaleXLine", "field": "id"},
"y": {"scale": "scaleYLine", "field": "value"},
"stroke": {"signal": "colorLine"},
"strokeWidth": {"value": 2},
"interpolate": {"signal": "interpolation"},
"strokeOpacity": {"value": 1}
}
}
}
]
}
15 changes: 15 additions & 0 deletions docs/examples/earthquakes-globe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
layout: example
title: Rotating Globe
permalink: /examples/earthquakes-globe/index.html
spec: earthquakes-globe
image: /examples/img/earthquakes-globe.png
---

A globe visualization of earthquakes. Enhanced and animated version of [Earthquakes](https://vega.github.io/vega/examples/earthquakes/) example.

Background: randomly generated "stars".

This Vega example made by Andrzej Leszkiewicz [@avatorl](https://github.com/avatorl)

{% include example spec=page.spec %}