1 |
532db909
|
Štěpán Červenka
|
{
|
2 |
|
|
"$schema": "https://vega.github.io/schema/vega/v5.json",
|
3 |
|
|
"width": 1200,
|
4 |
|
|
"height": 200,
|
5 |
|
|
"padding": 5,
|
6 |
|
|
|
7 |
|
|
"data": [
|
8 |
|
|
{
|
9 |
|
|
"name": "table",
|
10 |
|
|
"url": "data.json",
|
11 |
|
|
"transform": [
|
12 |
|
|
{
|
13 |
|
|
"type": "formula",
|
14 |
|
|
"expr": "toDate(datum[\"time_stamp\"])",
|
15 |
|
|
"as": "dateTime"
|
16 |
|
|
}
|
17 |
|
|
]
|
18 |
|
|
}
|
19 |
|
|
],
|
20 |
|
|
|
21 |
|
|
"scales": [
|
22 |
|
|
{
|
23 |
|
|
"name": "xscale",
|
24 |
|
|
"type": "time",
|
25 |
|
|
"domain": {"data": "table", "field": "dateTime"},
|
26 |
|
|
"range": "width"
|
27 |
|
|
},
|
28 |
|
|
{
|
29 |
|
|
"name": "yscale",
|
30 |
|
|
"type": "linear",
|
31 |
|
|
"domain": {"data": "table", "field": "sensors[0].value"},
|
32 |
|
|
"nice": true,
|
33 |
|
|
"range": "height"
|
34 |
|
|
}
|
35 |
|
|
],
|
36 |
|
|
|
37 |
|
|
"axes": [
|
38 |
|
|
{ "orient": "bottom", "scale": "xscale", "tickCount": 3 },
|
39 |
|
|
{ "orient": "left", "scale": "yscale" }
|
40 |
|
|
],
|
41 |
|
|
|
42 |
|
|
"marks": [
|
43 |
|
|
{
|
44 |
|
|
"type": "symbol",
|
45 |
|
|
"from": {"data":"table"},
|
46 |
|
|
"encode": {
|
47 |
|
|
"enter": {
|
48 |
|
|
"shape": {"value": "circle"},
|
49 |
|
|
"size": {"value": 10},
|
50 |
|
|
"x": {"scale": "xscale", "field": "dateTime"},
|
51 |
|
|
"y": {"scale": "yscale", "field": "sensors[0].value"},
|
52 |
|
|
"color": {"value": "both"},
|
53 |
|
|
"strokeWidth": {"value": 1}
|
54 |
|
|
}
|
55 |
|
|
}
|
56 |
|
|
}
|
57 |
|
|
]
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
}
|