1
|
{
|
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_big.json",
|
11
|
"transform": [
|
12
|
{
|
13
|
"type": "formula",
|
14
|
"expr": "toDate(datum[\"time_stamp\"])",
|
15
|
"as": "dateTime"
|
16
|
},
|
17
|
{
|
18
|
"type": "timeunit",
|
19
|
"field": "dateTime",
|
20
|
"units": ["year", "month", "date", "hours"]
|
21
|
}
|
22
|
]
|
23
|
}
|
24
|
],
|
25
|
|
26
|
"scales": [
|
27
|
{
|
28
|
"name": "xscale",
|
29
|
"type": "time",
|
30
|
"domain": {"data": "table", "fields": ["unit0", "unit1"]},
|
31
|
"range": "width"
|
32
|
},
|
33
|
{
|
34
|
"name": "yscale",
|
35
|
"type": "linear",
|
36
|
"domain": {"data": "table", "field": "value"},
|
37
|
"nice": true,
|
38
|
"range": "height"
|
39
|
}
|
40
|
],
|
41
|
|
42
|
"axes": [
|
43
|
{ "orient": "bottom", "scale": "xscale", "tickCount": 3 },
|
44
|
{ "orient": "left", "scale": "yscale" }
|
45
|
],
|
46
|
|
47
|
"marks": [
|
48
|
{
|
49
|
"type": "rect",
|
50
|
"from": {"data":"table"},
|
51
|
"encode": {
|
52
|
"enter": {
|
53
|
"x": {"scale": "xscale", "field": "unit0"},
|
54
|
"x2": {"scale": "xscale", "field": "unit1"},
|
55
|
"y": {"scale": "yscale", "field": "value"},
|
56
|
"y2": {"scale": "yscale", "value": 0}
|
57
|
}
|
58
|
}
|
59
|
}
|
60
|
]
|
61
|
}
|