reorganize files

This commit is contained in:
2025-01-30 16:28:56 +02:00
parent 594a5fc0d5
commit f8bb71a184
94 changed files with 2 additions and 25 deletions

View File

@@ -0,0 +1,167 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Robusta Coffee Price",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"values": [
{
"month": "2018-01",
"price": 0.8865
},
{
"month": "2018-02",
"price": 0.8924
},
{
"month": "2018-03",
"price": 0.8818
},
{
"month": "2018-04",
"price": 0.8831
},
{
"month": "2018-05",
"price": 0.8874
},
{
"month": "2018-06",
"price": 0.8607
},
{
"month": "2018-07",
"price": 0.8442
},
{
"month": "2018-08",
"price": 0.8074
},
{
"month": "2018-09",
"price": 0.7670
},
{
"month": "2018-10",
"price": 0.8532
},
{
"month": "2018-11",
"price": 0.8352
},
{
"month": "2018-12",
"price": 0.7757
},
{
"month": "2019-01",
"price": 0.7824
},
{
"month": "2019-02",
"price": 0.7865
},
{
"month": "2019-03",
"price": 0.7696
},
{
"month": "2019-04",
"price": 0.7328
},
{
"month": "2019-05",
"price": 0.7112
},
{
"month": "2019-06",
"price": 0.7402
},
{
"month": "2019-07",
"price": 0.7393
},
{
"month": "2019-08",
"price": 0.7078
},
{
"month": "2019-09",
"price": 0.7064
},
{
"month": "2019-10",
"price": 0.71
},
{
"month": "2019-11",
"price": 0.7328
},
{
"month": "2019-12",
"price": 0.7322
}
]
},
"mark": {
"type": "area",
"color": "#3182bd",
"opacity": 0.6,
"line": true,
"strokeWidth": 1.5
},
"encoding": {
"x": {
"field": "month",
"type": "temporal",
"title": null,
"axis": {
"grid": true,
"tickCount": 4,
"labelExpr": "timeFormat(datum.value, '%b %Y')"
}
},
"y": {
"field": "price",
"type": "quantitative",
"title": "Coffee Price ($/lb)",
"axis": {
"titleFontWeight": "bold",
"grid": true
},
"stack": null,
"scale": {
"zero": false,
"domainMin": 0.5
}
},
"tooltip": [
{
"field": "month",
"type": "temporal",
"title": "Month"
},
{
"field": "price",
"type": "quantitative",
"title": "Price",
"format": "$.3f"
}
]
},
"config": {
"axis": {
"gridColor": "#ddd",
"gridOpacity": 0.5,
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,167 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Ціна кави Робуста",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"values": [
{
"month": "2018-01",
"price": 0.8865
},
{
"month": "2018-02",
"price": 0.8924
},
{
"month": "2018-03",
"price": 0.8818
},
{
"month": "2018-04",
"price": 0.8831
},
{
"month": "2018-05",
"price": 0.8874
},
{
"month": "2018-06",
"price": 0.8607
},
{
"month": "2018-07",
"price": 0.8442
},
{
"month": "2018-08",
"price": 0.8074
},
{
"month": "2018-09",
"price": 0.7670
},
{
"month": "2018-10",
"price": 0.8532
},
{
"month": "2018-11",
"price": 0.8352
},
{
"month": "2018-12",
"price": 0.7757
},
{
"month": "2019-01",
"price": 0.7824
},
{
"month": "2019-02",
"price": 0.7865
},
{
"month": "2019-03",
"price": 0.7696
},
{
"month": "2019-04",
"price": 0.7328
},
{
"month": "2019-05",
"price": 0.7112
},
{
"month": "2019-06",
"price": 0.7402
},
{
"month": "2019-07",
"price": 0.7393
},
{
"month": "2019-08",
"price": 0.7078
},
{
"month": "2019-09",
"price": 0.7064
},
{
"month": "2019-10",
"price": 0.71
},
{
"month": "2019-11",
"price": 0.7328
},
{
"month": "2019-12",
"price": 0.7322
}
]
},
"mark": {
"type": "area",
"color": "#3182bd",
"opacity": 0.6,
"line": true,
"strokeWidth": 1.5
},
"encoding": {
"x": {
"field": "month",
"type": "temporal",
"title": null,
"axis": {
"grid": true,
"tickCount": 4,
"labelExpr": "timeFormat(datum.value, '%b %Y')"
}
},
"y": {
"field": "price",
"type": "quantitative",
"title": "Ціна кави ($/фунт)",
"axis": {
"titleFontWeight": "bold",
"grid": true
},
"stack": null,
"scale": {
"zero": false,
"domainMin": 0.5
}
},
"tooltip": [
{
"field": "month",
"type": "temporal",
"title": "Month"
},
{
"field": "price",
"type": "quantitative",
"title": "Price",
"format": "$.3f"
}
]
},
"config": {
"axis": {
"gridColor": "#ddd",
"gridOpacity": 0.5,
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,41 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Global Internet Speed (Mbps)",
"fontSize": 16,
"fontWeight": "bold"
},
"data": {
"url": "data/barchart.csv", "format": {"type": "csv"}
},
"width": 600,
"height": 400,
"mark": {
"type": "bar"
},
"encoding": {
"x": {
"field": "Country",
"type": "nominal",
"axis": {
"labelAngle": 40,
"labelAlign": "left",
"title": null,
"labelPadding": 10
},
"sort": {
"field": "index",
"order": "ascending"
}
},
"y": {
"field": "Speed",
"type": "quantitative",
"axis": {
"title": "Internet Speed (Mbps)",
"titleFontWeight": "bold",
"grid": true
}
}
}
}

View File

@@ -0,0 +1,45 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Світова швидкість інтернету (МБіт/с)",
"fontSize": 16,
"fontWeight": "bold"
},
"data": {
"url": "data/barchart.csv", "format": {"type": "csv"}
},
"width": 600,
"height": 400,
"mark": {
"type": "bar"
},
"encoding": {
"x": {
"field": "Country_UK",
"type": "nominal",
"title": "Країна",
"axis": {
"labelAngle": 40,
"labelAlign": "left",
"title": null,
"labelPadding": 10
},
"sort": {
"field": "index",
"order": "ascending"
}
},
"y": {
"field": "Speed",
"type": "quantitative",
"axis": {
"title": "Швидкість інтернету (МБіт/с)",
"titleFontWeight": "bold",
"grid": true
},
"scale": {
"zero": true
}
}
}
}

View File

@@ -0,0 +1,82 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Metro Systems of the World",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"url": "data/bubblechart.csv"
},
"layer": [
{
"mark": {
"type": "circle",
"opacity": 0.7,
"stroke": "black",
"strokeWidth": 1,
"fill": "#3182bd"
},
"encoding": {
"x": {
"field": "NumberofStations",
"type": "quantitative",
"scale": {"domain": [150, 800]},
"axis": {
"title": "Number of Stations",
"titleFontWeight": "bold",
"grid": true
}
},
"y": {
"field": "Length",
"type": "quantitative",
"scale": {"domain": [150, 500]},
"axis": {
"title": "Total System Length (Km)",
"titleFontWeight": "bold",
"grid": true
}
},
"size": {
"field": "Ridership",
"type": "quantitative",
"scale": {
"domain": [0, 5],
"range": [0, 1500]
},
"legend": {
"title": "Ridership (bn per year)",
"orient": "right",
"symbolType": "circle",
"values": [1.5, 2.5, 3.5]
}
}
}
},
{
"mark": {
"type": "text",
"fontSize": 11,
"dx": 15,
"align": "left"
},
"encoding": {
"x": {"field": "NumberofStations", "type": "quantitative"},
"y": {"field": "Length", "type": "quantitative"},
"text": {"field": "City", "type": "nominal"}
}
}
],
"config": {
"axis": {
"gridColor": "#ddd",
"gridDash": [1, 1],
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {"stroke": null}
}
}

View File

@@ -0,0 +1,82 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Системи метро світу",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"url": "data/bubblechart.csv"
},
"layer": [
{
"mark": {
"type": "circle",
"opacity": 0.7,
"stroke": "black",
"strokeWidth": 1,
"fill": "#3182bd"
},
"encoding": {
"x": {
"field": "NumberofStations",
"type": "quantitative",
"scale": {"domain": [150, 800]},
"axis": {
"title": "Кількість станцій",
"titleFontWeight": "bold",
"grid": true
}
},
"y": {
"field": "Length",
"type": "quantitative",
"scale": {"domain": [150, 500]},
"axis": {
"title": "Загальна довжина системи (км)",
"titleFontWeight": "bold",
"grid": true
}
},
"size": {
"field": "Ridership",
"type": "quantitative",
"scale": {
"domain": [0, 5],
"range": [0, 1500]
},
"legend": {
"title": "Пасажиропотік (млрд на рік)",
"orient": "right",
"symbolType": "circle",
"values": [1.5, 2.5, 3.5]
}
}
}
},
{
"mark": {
"type": "text",
"fontSize": 11,
"dx": 15,
"align": "left"
},
"encoding": {
"x": {"field": "NumberofStations", "type": "quantitative"},
"y": {"field": "Length", "type": "quantitative"},
"text": {"field": "CityUK", "type": "nominal"}
}
}
],
"config": {
"axis": {
"gridColor": "#ddd",
"gridDash": [1, 1],
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {"stroke": null}
}
}

View File

@@ -0,0 +1,113 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Unemployment Rates for States in 2020",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 500,
"projection": {
"type": "albersUsa"
},
"layer": [
{
"data": {
"url": "data/topo-USA.json",
"format": {
"type": "topojson",
"feature": "states"
}
},
"transform": [
{
"lookup": "id",
"from": {
"data": {
"url": "data/choropleth.csv"
},
"key": "id",
"fields": ["rate"]
}
}
],
"mark": {
"type": "geoshape",
"stroke": "#fff",
"strokeWidth": 0.5
},
"encoding": {
"color": {
"field": "rate",
"type": "quantitative",
"title": "Unemployment Rate (%)",
"scale": {
"scheme": "blues"
},
"legend": {
"title": "Unemployment Rate (%)",
"orient": "top",
"direction": "horizontal"
}
}
}
},
{
"data": {
"url": "data/topo-USA.json",
"format": {
"type": "topojson",
"feature": "states"
}
},
"mark": {
"type": "geoshape",
"filled": false,
"stroke": "#ccc",
"strokeWidth": 0.5
}
},
{
"data": {
"url": "data/choropleth.csv"
},
"transform": [
{
"lookup": "code",
"from": {
"data": {
"url": "data/state-coordinates.json"
},
"key": "code",
"fields": ["latitude", "longitude"]
}
}
],
"mark": {
"type": "text",
"color": "black",
"fontSize": 10,
"fontWeight": "bold"
},
"encoding": {
"longitude": {
"field": "longitude",
"type": "quantitative"
},
"latitude": {
"field": "latitude",
"type": "quantitative"
},
"text": {
"field": "code",
"type": "nominal"
}
}
}
],
"config": {
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,308 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"height": 500,
"width": 600,
"title": "Кількість шлюбів в першому півріччі 2024 р.",
"config": {
"padding": 0,
"legend": {
"orient": "top",
"padding": 20,
"gradientLength": 300,
"titleFontWeight": "normal",
"titleAlign": "center",
"titleAnchor": "middle",
"titleLimit": 1000
}
},
"layer": [
{
"data": {
"url": "https://raw.githubusercontent.com/org-scn-design-studio-community/sdkcommunitymaps/master/geojson/Europe/Ukraine-regions.json",
"format": {
"feature": "UKR_adm1",
"type": "topojson"
}
},
"mark": {
"type": "geoshape",
"stroke": "white",
"strokeOpacity": 0.3,
"strokeWidth": 0.5
},
"encoding": {
"color": {
"field": "value",
"legend": {
"title": null
},
"scale": {
"scheme": "blues",
"reverse": false
},
"type": "quantitative"
}
},
"projection": {
"type": "mercator"
},
"transform": [
{
"lookup": "properties.ID_1",
"from": {
"data": {
"name": "referendum"
},
"key": "id",
"fields": [
"value"
]
}
}
]
},
{
"data": {
"name": "referendum"
},
"mark": {
"type": "text",
"color": "#111"
},
"encoding": {
"latitude": {
"field": "lat",
"type": "quantitative"
},
"longitude": {
"field": "lon",
"type": "quantitative"
},
"text": {
"field": "short_region",
"type": "ordinal"
}
}
}
],
"datasets": {
"referendum": [
{
"region": "Львівська область",
"short_region": "Льв",
"id": 3150,
"value": 4616,
"lat": 49.8397,
"lon": 24.0297
},
{
"region": "Івано-Франківська область",
"short_region": "ІвФ",
"id": 3142,
"value": 2333,
"lat": 48.7226,
"lon": 24.7105
},
{
"region": "Тернопільська область",
"short_region": "Тер",
"id": 3157,
"value": "1512",
"lat": 49.3535,
"lon": 25.5948
},
{
"region": "м.Київ",
"short_region": "м.К",
"id": 3147,
"value": 9392,
"lat": 50.4501,
"lon": 30.5234
},
{
"region": "Волинська область",
"short_region": "Вол",
"id": 3160,
"value": 1791,
"lat": 51.3424,
"lon": 25
},
{
"region": "Рівненська область",
"short_region": "Рів",
"id": 3154,
"value": 2682,
"lat": 51,
"lon": 26.8
},
{
"region": "Закарпатська область",
"short_region": "Зак",
"id": 3158,
"value": 1859,
"lat": 48.4,
"lon": 23
},
{
"region": "Чернівецька область",
"short_region": "Чнц",
"id": 3138,
"value": 1376,
"lat": 48.2915,
"lon": 25.9403
},
{
"region": "Київська область",
"short_region": "К.о",
"id": 3146,
"value": 4848,
"lat": 49.92,
"lon": 30.57
},
{
"region": "Харківська область",
"short_region": "Хар",
"id": 3143,
"value": 4148,
"lat": 49.5935,
"lon": 36.5304
},
{
"region": "Черкаська область",
"short_region": "Чрк",
"id": 3136,
"value": 3001,
"lat": 49.2,
"lon": 31.4
},
{
"region": "Дніпропетровська область",
"short_region": "Дні",
"id": 3140,
"value": 7076,
"lat": 48.4647,
"lon": 35.0462
},
{
"region": "Сумська область",
"short_region": "Сум",
"id": 3156,
"value": 1670,
"lat": 50.8077,
"lon": 34.4981
},
{
"region": "Полтавська область",
"short_region": "Пол",
"id": 3153,
"value": 3065,
"lat": 49.5883,
"lon": 34.0514
},
{
"region": "Запорізька область",
"short_region": "Зап",
"id": 3161,
"value": 2205,
"lat": 47.1388,
"lon": 35.5396
},
{
"region": "Херсонська область",
"short_region": "Хер",
"id": 3144,
"value": 323,
"lat": 46.6354,
"lon": 33.5169
},
{
"region": "Вінницька область",
"short_region": "Він",
"id": 3159,
"value": 3362,
"lat": 49.0331,
"lon": 28.6682
},
{
"region": "Житомирська область",
"short_region": "Жит",
"id": 3162,
"value": 2717,
"lat": 50.2649,
"lon": 28.6767
},
{
"region": "Хмельницька область",
"short_region": "Хме",
"id": 3145,
"value": 2925,
"lat": 49.4228,
"lon": 26.9871
},
{
"region": "Одеська область",
"short_region": "Оде",
"id": 3152,
"value": 4896,
"lat": 46.9825,
"lon": 30.3233
},
{
"region": "Кіровоградська область",
"short_region": "Кір",
"id": 3148,
"value": 1801,
"lat": 48.5079,
"lon": 32.2623
},
{
"region": "м.Севастополь",
"short_region": "Сев",
"id": 3155,
"value": 0,
"lat": 44.58,
"lon": 33.58
},
{
"region": "Чернігівська область",
"short_region": "Чнг",
"id": 3137,
"value": 1776,
"lat": 51.2982,
"lon": 31.8893
},
{
"region": "Донецька область",
"short_region": "Дон",
"id": 3141,
"value": 933,
"lat": 48.0159,
"lon": 37.8028
},
{
"region": "Миколаївська область",
"short_region": "Мик",
"id": 3151,
"value": 2459,
"lat": 47.275,
"lon": 31.9946
},
{
"region": "Луганська область",
"short_region": "Луг",
"id": 3149,
"value": 0,
"lat": 48.974,
"lon": 39.0078
},
{
"region": "Автономна Республіка Крим",
"short_region": "АРК",
"id": 3139,
"value": 0,
"lat": 45.3657,
"lon": 34.4708
}
]
}
}

View File

@@ -0,0 +1,54 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Trip Distance and Customers",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"url": "data/histogram.csv"
},
"mark": {
"type": "bar",
"fill": "#3182bd",
"tooltip": true
},
"encoding": {
"x": {
"field": "Trip_Distance",
"type": "quantitative",
"bin": {
"step": 10
},
"axis": {
"title": "Distance (in Km)",
"titleFontWeight": "bold",
"grid": false
}
},
"y": {
"aggregate": "count",
"axis": {
"title": "Number of Customers",
"titleFontWeight": "bold",
"grid": true
}
}
},
"config": {
"axis": {
"grid": true,
"gridColor": "#ddd",
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {
"stroke": null
},
"bar": {
"binSpacing": 1
}
}
}

View File

@@ -0,0 +1,54 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Відстань поїздки та клієнти",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"url": "data/histogram.csv"
},
"mark": {
"type": "bar",
"fill": "#3182bd",
"tooltip": true
},
"encoding": {
"x": {
"field": "Trip_Distance",
"type": "quantitative",
"bin": {
"step": 10
},
"axis": {
"title": "Відстань (км)",
"titleFontWeight": "bold",
"grid": false
}
},
"y": {
"aggregate": "count",
"axis": {
"title": "Кількість клієнтів",
"titleFontWeight": "bold",
"grid": true
}
}
},
"config": {
"axis": {
"grid": true,
"gridColor": "#ddd",
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {
"stroke": null
},
"bar": {
"binSpacing": 1
}
}
}

View File

@@ -0,0 +1,35 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 600,
"height": 400,
"title": "Oil Prices",
"data": {
"url": "data/linechart.json"
},
"mark": {
"type": "line",
"point": true
},
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"title": "Month",
"axis": {
"format": "%b %Y",
"labelOverlap": false,
"labelAngle": -25,
"labelAlign": "right",
"tickCount": "month"
}
},
"y": {
"field": "value",
"type": "quantitative",
"title": "Oil Price (USD)",
"scale": {
"zero": true
}
}
}
}

View File

@@ -0,0 +1,35 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 600,
"height": 400,
"title": "Ціни на нафту",
"data": {
"url": "data/linechart.json"
},
"mark": {
"type": "line",
"point": true
},
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"title": "Місяць",
"axis": {
"format": "%b %Y",
"labelOverlap": false,
"labelAngle": -25,
"labelAlign": "right",
"tickCount": "month"
}
},
"y": {
"field": "value",
"type": "quantitative",
"title": "Ціна за барель нафти ($)",
"scale": {
"zero": true
}
}
}
}

View File

@@ -0,0 +1,53 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Global Smartphone Market Share in 2021",
"fontSize": 16,
"fontWeight": "bold"
},
"config": {
"legend": {
"labelFontSize": 11,
"titleFontSize": 12,
"titleFontWeight": "bold"
}
},
"width": 600, "height": 400,
"data": {
"values": [
{"index": 1, "brand": "Samsung", "share": 17.6},
{"index": 2, "brand": "Xiaomi", "share": 15.5},
{"index": 3, "brand": "Apple", "share": 15.0},
{"index": 4, "brand": "Oppo", "share": 10.2},
{"index": 5, "brand": "Vivo", "share": 9.8},
{"index": 6, "brand": "Others", "share": 31.9}
]
},
"encoding": {
"theta": {
"field": "share",
"type": "quantitative",
"stack": true,
"sort": {"field": "index", "order": "ascending"}
},
"color": {
"field": "brand",
"type": "nominal",
"legend": null,
"sort": {"field": "index", "order": "ascending"}
},
"order": {
"field": "index",
"type": "quantitative"
}
},
"layer": [{
"mark": {"type": "arc", "outerRadius": 120}
}, {
"mark": {"type": "text", "radius": 90},
"encoding": {
"text": {"field": "brand", "type": "nominal"},
"color": {"value": "black"}
}
}]
}

View File

@@ -0,0 +1,53 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Розподіл світового ринку смартфонів у 2021 році",
"fontSize": 16,
"fontWeight": "bold"
},
"config": {
"legend": {
"labelFontSize": 11,
"titleFontSize": 12,
"titleFontWeight": "bold"
}
},
"width": 600, "height": 400,
"data": {
"values": [
{"index": 1, "brand": "Samsung", "share": 17.6},
{"index": 2, "brand": "Xiaomi", "share": 15.5},
{"index": 3, "brand": "Apple", "share": 15.0},
{"index": 4, "brand": "Oppo", "share": 10.2},
{"index": 5, "brand": "Vivo", "share": 9.8},
{"index": 6, "brand": "Інші", "share": 31.9}
]
},
"encoding": {
"theta": {
"field": "share",
"type": "quantitative",
"stack": true,
"sort": {"field": "index", "order": "ascending"}
},
"color": {
"field": "brand",
"type": "nominal",
"legend": null,
"sort": {"field": "index", "order": "ascending"}
},
"order": {
"field": "index",
"type": "quantitative"
}
},
"layer": [{
"mark": {"type": "arc", "outerRadius": 120}
}, {
"mark": {"type": "text", "radius": 90},
"encoding": {
"text": {"field": "brand", "type": "nominal"},
"color": {"value": "black"}
}
}]
}

View File

@@ -0,0 +1,64 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Weight and Height of 85 Individuals",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"url": "data/scatterplot.csv"
},
"mark": {
"type": "circle",
"size": 40,
"fill": "#3182bd",
"opacity": 1
},
"encoding": {
"x": {
"field": "Height",
"type": "quantitative",
"scale": {
"domain": [155, 190]
},
"axis": {
"title": "Height (cm)",
"titleFontWeight": "bold",
"grid": true,
"gridDash": [1, 1],
"ticks": 5
}
},
"y": {
"field": "Weight",
"type": "quantitative",
"scale": {
"domain": [40, 75]
},
"axis": {
"title": "Weight (kg)",
"titleFontWeight": "bold",
"grid": true,
"gridDash": [1, 1],
"ticks": 8
}
},
"tooltip": [
{"field": "Height", "title": "Height", "format": ".1f"},
{"field": "Weight", "title": "Weight", "format": ".1f"}
]
},
"config": {
"axis": {
"gridColor": "#ddd",
"gridOpacity": 0.5,
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,64 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Вага та зріст 85 осіб",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"url": "data/scatterplot.csv"
},
"mark": {
"type": "circle",
"size": 40,
"fill": "#3182bd",
"opacity": 1
},
"encoding": {
"x": {
"field": "Height",
"type": "quantitative",
"scale": {
"domain": [155, 190]
},
"axis": {
"title": "Зріст (см)",
"titleFontWeight": "bold",
"grid": true,
"gridDash": [1, 1],
"ticks": 5
}
},
"y": {
"field": "Weight",
"type": "quantitative",
"scale": {
"domain": [40, 75]
},
"axis": {
"title": "Вага (кг)",
"titleFontWeight": "bold",
"grid": true,
"gridDash": [1, 1],
"ticks": 8
}
},
"tooltip": [
{"field": "Height", "title": "Зріст", "format": ".1f"},
{"field": "Weight", "title": "Вага", "format": ".1f"}
]
},
"config": {
"axis": {
"gridColor": "#ddd",
"gridOpacity": 0.5,
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,86 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Olympic Medal Distribution by Country",
"fontSize": 16,
"fontWeight": "bold"
},
"data": {
"url": "data/stacked100.csv"
},
"width": 600,
"height": 400,
"encoding": {
"y": {
"field": "value",
"type": "quantitative",
"axis": {
"title": "Percentage",
"format": ".0%",
"grid": true
},
"stack": "normalize"
},
"x": {
"field": "Countries",
"type": "nominal",
"axis": {
"title": null,
"labelAngle": 40,
"titleFontWeight": "bold"
}
},
"color": {
"field": "category",
"type": "nominal",
"scale": {
"domain": [
"Gold",
"Silver",
"Bronze"
],
"range": [
"#FFD700",
"#C0C0C0",
"#CD7F32"
]
},
"legend": {
"title": "Medals",
"orient": "right"
}
},
"order": {
"field": "order",
"type": "quantitative",
"sort": "ascending"
}
},
"mark": "bar",
"transform": [
{
"fold": [
"Gold",
"Silver",
"Bronze"
],
"as": [
"category",
"value"
]
},
{
"calculate": "datum.category === 'Gold' ? 1 : datum.category === 'Silver' ? 2 : 3",
"as": "order"
}
],
"config": {
"axis": {
"grid": true,
"gridColor": "#ddd"
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,90 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Розподіл олімпійських медалей за країною",
"fontSize": 16,
"fontWeight": "bold"
},
"data": {
"url": "data/stacked100.csv"
},
"width": 600,
"height": 400,
"encoding": {
"y": {
"field": "value",
"type": "quantitative",
"axis": {
"title": "Відсоток",
"format": ".0%",
"grid": true
},
"stack": "normalize"
},
"x": {
"field": "CountriesUK",
"type": "nominal",
"axis": {
"title": null,
"labelAngle": 40,
"titleFontWeight": "bold"
}
},
"color": {
"field": "category",
"type": "nominal",
"scale": {
"domain": [
"Золото",
"Срібло",
"Бронза"
],
"range": [
"#FFD700",
"#C0C0C0",
"#CD7F32"
]
},
"legend": {
"title": "Медалі",
"orient": "right"
}
},
"order": {
"field": "order",
"type": "quantitative",
"sort": "ascending"
}
},
"mark": "bar",
"transform": [
{
"fold": [
"Gold",
"Silver",
"Bronze"
],
"as": [
"category",
"value"
]
},
{
"calculate": "datum.category === 'Gold' ? 'Золото' : datum.category === 'Silver' ? 'Срібло' : 'Бронза'",
"as": "category"
},
{
"calculate": "datum.category === 'Gold' ? 1 : datum.category === 'Silver' ? 2 : 3",
"as": "order"
}
],
"config": {
"axis": {
"grid": true,
"gridColor": "#ddd"
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,133 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Popular Girls' names in the UK",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"values": [
{
"Year": "2009-01-01",
"Amelia": 3625,
"Isla": 1908,
"Olivia": 5201
},
{
"Year": "2010-01-01",
"Amelia": 4227,
"Isla": 2384,
"Olivia": 5279
},
{
"Year": "2011-01-01",
"Amelia": 5054,
"Isla": 2849,
"Olivia": 4938
},
{
"Year": "2012-01-01",
"Amelia": 7061,
"Isla": 3501,
"Olivia": 4585
},
{
"Year": "2013-01-01",
"Amelia": 5570,
"Isla": 3526,
"Olivia": 4598
},
{
"Year": "2014-01-01",
"Amelia": 5327,
"Isla": 4012,
"Olivia": 4724
}
]
},
"encoding": {
"x": {
"field": "Year",
"type": "temporal",
"timeUnit": "year",
"axis": {
"title": "Year",
"titleFontWeight": "bold",
"grid": true
}
},
"y": {
"field": "value",
"type": "quantitative",
"axis": {
"title": "Number of Girls",
"titleFontWeight": "bold",
"grid": true
}
},
"color": {
"field": "name",
"type": "nominal",
"scale": {
"domain": [
"Amelia",
"Isla",
"Olivia"
],
"range": [
"#3182bd",
"#9ecae1",
"#deebf7"
]
},
"legend": {
"title": null,
"orient": "right"
}
}
},
"layer": [
{
"mark": {
"type": "area",
"opacity": 0.7
},
"transform": [
{
"fold": [
"Amelia",
"Isla",
"Olivia"
],
"as": [
"name",
"value"
]
},
{
"calculate": "datum.name === 'Amelia' ? 1 : datum.name === 'Isla' ? 2 : 3",
"as": "order"
}
],
"encoding": {
"order": {
"field": "order",
"type": "quantitative"
}
}
}
],
"config": {
"axis": {
"gridColor": "#ddd",
"gridOpacity": 0.5,
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,123 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Популярність виробництва сортів меду",
"fontSize": 16,
"fontWeight": "bold"
},
"width": 600,
"height": 400,
"data": {
"values": [
{
"Year": "2009-01-01",
"Липовий": 3625,
"Гречаний": 1908,
"Акацієвий": 5201
},
{
"Year": "2010-01-01",
"Липовий": 4227,
"Гречаний": 2384,
"Акацієвий": 5279
},
{
"Year": "2011-01-01",
"Липовий": 5054,
"Гречаний": 2849,
"Акацієвий": 4938
},
{
"Year": "2012-01-01",
"Липовий": 7061,
"Гречаний": 3501,
"Акацієвий": 4585
},
{
"Year": "2013-01-01",
"Липовий": 5570,
"Гречаний": 3526,
"Акацієвий": 4598
},
{
"Year": "2014-01-01",
"Липовий": 5327,
"Гречаний": 4012,
"Акацієвий": 4724
}
]
},
"encoding": {
"x": {
"field": "Year",
"type": "temporal",
"timeUnit": "year",
"axis": {
"title": "Year",
"titleFontWeight": "bold",
"grid": true
}
},
"y": {
"field": "value",
"type": "quantitative",
"axis": {
"title": "Кількість тонн",
"titleFontWeight": "bold",
"grid": true
}
},
"color": {
"field": "name",
"type": "nominal",
"scale": {
"domain": [
"Липовий",
"Гречаний",
"Акацієвий"
],
"range": [
"#3182bd",
"#9ecae1",
"#deebf7"
]
},
"legend": {
"title": null,
"orient": "right"
}
}
},
"layer": [
{
"mark": {
"type": "area",
"opacity": 0.7
},
"transform": [
{
"fold": [
"Липовий",
"Гречаний",
"Акацієвий"
],
"as": [
"name",
"value"
]
}
]
}
],
"config": {
"axis": {
"gridColor": "#ddd",
"gridOpacity": 0.5,
"labelFontSize": 11,
"titleFontSize": 12
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,97 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Room Service Prices"
},
"data": {
"url": "data/stackedbarchart.csv"
},
"width": 600,
"height": 400,
"encoding": {
"x": {
"field": "City",
"type": "nominal",
"axis": {
"title": "Cities",
"labelAngle": 40,
"titleFontWeight": "bold"
}
},
"y": {
"field": "value",
"type": "quantitative",
"axis": {
"title": "Cost ($)",
"titleFontWeight": "bold",
"grid": true,
"gridDash": [1, 0],
"tickCount": 15
},
"scale": {
"domain": [
0,
70
]
}
},
"color": {
"field": "category",
"type": "nominal",
"scale": {
"domain": [
"Vodka",
"Soda",
"Peanut",
"Water",
"Sandwich"
],
"range": [
"#386cb0",
"#7fc97f",
"#beaed4",
"#fdc086",
"#fb9a99"
]
},
"legend": {
"title": null,
"orient": "right"
}
},
"order": {
"field": "order",
"type": "quantitative",
"sort": "descending"
}
},
"mark": "bar",
"transform": [
{
"fold": [
"Sandwich",
"Water",
"Peanut",
"Soda",
"Vodka"
],
"as": [
"category",
"value"
]
},
{
"calculate": "datum.category === 'Vodka' ? 1 : datum.category === 'Soda' ? 2 : datum.category === 'Peanut' ? 3 : datum.category === 'Water' ? 4 : 5",
"as": "order"
}
],
"config": {
"axis": {
"grid": true,
"gridColor": "#ddd"
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,98 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Ціни на обслуговування в номері"
},
"data": {
"url": "data/stackedbarchart.csv"
},
"width": 600,
"height": 400,
"encoding": {
"x": {
"field": "CityUK",
"type": "nominal",
"axis": {
"title": "Місто",
"labelAngle": 40,
"titleFontWeight": "bold"
}
},
"y": {
"field": "value",
"type": "quantitative",
"axis": {
"title": "Ціна ($)",
"titleFontWeight": "bold",
"grid": true,
"gridDash": [1, 0],
"tickCount": 15
},
"scale": {
"domain": [
0,
70
]
}
},
"color": {
"field": "category",
"type": "nominal",
"scale": {
"domain": [
"Vodka",
"Soda",
"Peanut",
"Water",
"Sandwich"
],
"range": [
"#386cb0",
"#7fc97f",
"#beaed4",
"#fdc086",
"#fb9a99"
]
},
"legend": {
"title": null,
"orient": "right",
"labelExpr": "datum.label == 'Sandwich' ? 'Сендвіч' : datum.label == 'Water' ? 'Вода' : datum.label == 'Peanut' ? 'Арахіс' : datum.label == 'Soda' ? 'Газована вода' : 'Горілка'"
}
},
"order": {
"field": "order",
"type": "quantitative",
"sort": "descending"
}
},
"mark": "bar",
"transform": [
{
"fold": [
"Sandwich",
"Water",
"Peanut",
"Soda",
"Vodka"
],
"as": [
"category",
"value"
]
},
{
"calculate": "datum.category === 'Vodka' ? 1 : datum.category === 'Soda' ? 2 : datum.category === 'Peanut' ? 3 : datum.category === 'Water' ? 4 : 5",
"as": "order"
}
],
"config": {
"axis": {
"grid": true,
"gridColor": "#ddd"
},
"view": {
"stroke": null
}
}
}

View File

@@ -0,0 +1,38 @@
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 500,
"height": 500,
"marks": [
{
"type": "image",
"encode": {
"enter": {
"url": {
"value": "data/treemap-en.png"
},
"x": {
"value": 0
},
"y": {
"value": 0
},
"width": {
"value": 500
},
"height": {
"value": 500
},
"aspect": {
"value": true
},
"align": {
"value": "left"
},
"baseline": {
"value": "top"
}
}
}
}
]
}

View File

@@ -0,0 +1,38 @@
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 500,
"height": 500,
"marks": [
{
"type": "image",
"encode": {
"enter": {
"url": {
"value": "data/treemap-uk.png"
},
"x": {
"value": 0
},
"y": {
"value": 0
},
"width": {
"value": 500
},
"height": {
"value": 500
},
"aspect": {
"value": true
},
"align": {
"value": "left"
},
"baseline": {
"value": "top"
}
}
}
}
]
}