mirror of
https://github.com/olehomelchenko/minivlat-local-ua.git
synced 2025-12-21 21:22:24 +00:00
Update chart dimensions for responsive design and enhance quiz completion alert localization
This commit is contained in:
@@ -5,8 +5,8 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": 500,
|
"width": "container",
|
||||||
"height": 300,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,9 @@
|
|||||||
"type": "temporal",
|
"type": "temporal",
|
||||||
"title": null,
|
"title": null,
|
||||||
"axis": {
|
"axis": {
|
||||||
"grid": true
|
"grid": true,
|
||||||
|
"tickCount": 4,
|
||||||
|
"labelExpr": "timeFormat(datum.value, '%b %Y')"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"y": {
|
"y": {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": 500,
|
"width": "container",
|
||||||
"height": 300,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,9 @@
|
|||||||
"type": "temporal",
|
"type": "temporal",
|
||||||
"title": null,
|
"title": null,
|
||||||
"axis": {
|
"axis": {
|
||||||
"grid": true
|
"grid": true,
|
||||||
|
"tickCount": 4,
|
||||||
|
"labelExpr": "timeFormat(datum.value, '%b %Y')"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"y": {
|
"y": {
|
||||||
@@ -130,6 +132,11 @@
|
|||||||
"axis": {
|
"axis": {
|
||||||
"titleFontWeight": "bold",
|
"titleFontWeight": "bold",
|
||||||
"grid": true
|
"grid": true
|
||||||
|
},
|
||||||
|
"stack": null,
|
||||||
|
"scale": {
|
||||||
|
"zero": false,
|
||||||
|
"domainMin": 0.5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tooltip": [
|
"tooltip": [
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"url": "data/barchart.csv", "format": {"type": "csv"}
|
"url": "data/barchart.csv", "format": {"type": "csv"}
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": "container",
|
||||||
"height": "container",
|
"height": 400,
|
||||||
"mark": {
|
"mark": {
|
||||||
"type": "bar"
|
"type": "bar"
|
||||||
},
|
},
|
||||||
@@ -32,6 +32,9 @@
|
|||||||
"title": "Швидкість інтернету (МБіт/с)",
|
"title": "Швидкість інтернету (МБіт/с)",
|
||||||
"titleFontWeight": "bold",
|
"titleFontWeight": "bold",
|
||||||
"grid": true
|
"grid": true
|
||||||
|
},
|
||||||
|
"scale": {
|
||||||
|
"zero": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": 400,
|
"width": "container",
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/bubblechart.csv"
|
"url": "data/bubblechart.csv"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": 400,
|
"width": "container",
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/bubblechart.csv"
|
"url": "data/bubblechart.csv"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
"height": 300,
|
"height": 500,
|
||||||
"width": 600,
|
"width": "container",
|
||||||
"title": "Кількість шлюбів в першому півріччі 2024 р.",
|
"title": "Кількість шлюбів в першому півріччі 2024 р.",
|
||||||
"config": {
|
"config": {
|
||||||
"padding": 0,
|
"padding": 0,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": "container",
|
||||||
"height": 300,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/histogram.csv"
|
"url": "data/histogram.csv"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": 500,
|
"width": "container",
|
||||||
"height": 300,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/histogram.csv"
|
"url": "data/histogram.csv"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
"width": 600,
|
"width": "container",
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"title": "Ціни на нафту",
|
"title": "Ціни на нафту",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"titleFontWeight": "bold"
|
"titleFontWeight": "bold"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"width": "container", "height": 300,
|
"width": "container", "height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
{"brand": "Samsung", "share": 17.6},
|
{"brand": "Samsung", "share": 17.6},
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"titleFontWeight": "bold"
|
"titleFontWeight": "bold"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"width": 500, "height": 300,
|
"width": "container", "height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
{"brand": "Samsung", "share": 17.6},
|
{"brand": "Samsung", "share": 17.6},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": 400,
|
"width": "container",
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/scatterplot.csv"
|
"url": "data/scatterplot.csv"
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"url": "data/stacked100.csv"
|
"url": "data/stacked100.csv"
|
||||||
},
|
},
|
||||||
"width": 500,
|
"width": "container",
|
||||||
"height": 300,
|
"height": 400,
|
||||||
"encoding": {
|
"encoding": {
|
||||||
"y": {
|
"y": {
|
||||||
"field": "value",
|
"field": "value",
|
||||||
@@ -49,6 +49,11 @@
|
|||||||
"title": "Медалі",
|
"title": "Медалі",
|
||||||
"orient": "right"
|
"orient": "right"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"field": "order",
|
||||||
|
"type": "quantitative",
|
||||||
|
"sort": "ascending"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mark": "bar",
|
"mark": "bar",
|
||||||
@@ -69,9 +74,8 @@
|
|||||||
"as": "category"
|
"as": "category"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sort": [
|
"calculate": "datum.category === 'Gold' ? 1 : datum.category === 'Silver' ? 2 : 3",
|
||||||
{"field": "category", "order": "descending"}
|
"as": "order"
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": "container",
|
||||||
"height": 500,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": 400,
|
"width": "container",
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"url": "data/stackedbarchart.csv"
|
"url": "data/stackedbarchart.csv"
|
||||||
},
|
},
|
||||||
"width": 500,
|
"width": "container",
|
||||||
"height": 300,
|
"height": 400,
|
||||||
"encoding": {
|
"encoding": {
|
||||||
"x": {
|
"x": {
|
||||||
"field": "CityUK",
|
"field": "CityUK",
|
||||||
@@ -24,7 +24,9 @@
|
|||||||
"axis": {
|
"axis": {
|
||||||
"title": "Ціна ($)",
|
"title": "Ціна ($)",
|
||||||
"titleFontWeight": "bold",
|
"titleFontWeight": "bold",
|
||||||
"grid": true
|
"grid": true,
|
||||||
|
"gridDash": [1, 0],
|
||||||
|
"tickCount": 15
|
||||||
},
|
},
|
||||||
"scale": {
|
"scale": {
|
||||||
"domain": [
|
"domain": [
|
||||||
@@ -38,18 +40,18 @@
|
|||||||
"type": "nominal",
|
"type": "nominal",
|
||||||
"scale": {
|
"scale": {
|
||||||
"domain": [
|
"domain": [
|
||||||
"Sandwich",
|
"Vodka",
|
||||||
"Water",
|
|
||||||
"Peanut",
|
|
||||||
"Soda",
|
"Soda",
|
||||||
"Vodka"
|
"Peanut",
|
||||||
|
"Water",
|
||||||
|
"Sandwich"
|
||||||
],
|
],
|
||||||
"range": [
|
"range": [
|
||||||
|
"#386cb0",
|
||||||
"#7fc97f",
|
"#7fc97f",
|
||||||
"#beaed4",
|
"#beaed4",
|
||||||
"#fdc086",
|
"#fdc086",
|
||||||
"#fb9a99",
|
"#fb9a99"
|
||||||
"#386cb0"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"legend": {
|
"legend": {
|
||||||
@@ -57,6 +59,11 @@
|
|||||||
"orient": "right",
|
"orient": "right",
|
||||||
"labelExpr": "datum.label == 'Sandwich' ? 'Сендвіч' : datum.label == 'Water' ? 'Вода' : datum.label == 'Peanut' ? 'Арахіс' : datum.label == 'Soda' ? 'Газована вода' : 'Горілка'"
|
"labelExpr": "datum.label == 'Sandwich' ? 'Сендвіч' : datum.label == 'Water' ? 'Вода' : datum.label == 'Peanut' ? 'Арахіс' : datum.label == 'Soda' ? 'Газована вода' : 'Горілка'"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"field": "order",
|
||||||
|
"type": "quantitative",
|
||||||
|
"sort": "descending"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mark": "bar",
|
"mark": "bar",
|
||||||
@@ -73,6 +80,10 @@
|
|||||||
"category",
|
"category",
|
||||||
"value"
|
"value"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"calculate": "datum.category === 'Vodka' ? 1 : datum.category === 'Soda' ? 2 : datum.category === 'Peanut' ? 3 : datum.category === 'Water' ? 4 : 5",
|
||||||
|
"as": "order"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
// Check if there is a completed quiz
|
// Check if there is a completed quiz
|
||||||
const allQuizzes = JSON.parse(localStorage.getItem('allQuizzes') || '{}');
|
const allQuizzes = JSON.parse(localStorage.getItem('allQuizzes') || '{}');
|
||||||
if (allQuizzes[quizId] && allQuizzes[quizId].completed) {
|
if (allQuizzes[quizId] && allQuizzes[quizId].completed) {
|
||||||
alert("You have already completed the quiz. Redirecting to the questionnaire.");
|
alert("Ви вже пройшли дослідження. Дякуємо! Перенаправлення на головну сторінку тесту.");
|
||||||
window.location.href = 'index.html';
|
window.location.href = 'index.html';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user