/
interactive_geo_earthquakes_normalized.vl.json
77 lines (77 loc) · 2.23 KB
/
interactive_geo_earthquakes_normalized.vl.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 300,
"height": 300,
"params": [
{
"name": "rotate0",
"value": 100,
"bind": {"input": "range", "min": -180, "max": 180, "step": 1}
},
{
"name": "rotate1",
"value": 0,
"bind": {"input": "range", "min": -180, "max": 180, "step": 1}
},
{
"name": "earthquakeSize",
"value": 6,
"bind": {"input": "range", "min": 0, "max": 12, "step": 1}
}
],
"layer": [
{
"data": {"sphere": true},
"mark": {"type": "geoshape", "fill": "aliceblue"},
"projection": {
"type": "orthographic",
"rotate": [{"signal": "rotate0"}, {"signal": "rotate1"}, 0]
}
},
{
"data": {
"name": "world",
"url": "data/world-110m.json",
"format": {"type": "topojson", "feature": "countries"}
},
"mark": {"type": "geoshape", "fill": "mintcream", "stroke": "black"},
"projection": {
"type": "orthographic",
"rotate": [{"signal": "rotate0"}, {"signal": "rotate1"}, 0]
}
},
{
"data": {
"name": "earthquakes",
"url": "data/earthquakes.json",
"format": {"type": "json", "property": "features"}
},
"mark": {"type": "circle", "color": "red", "opacity": 0.25},
"encoding": {
"longitude": {"field": "longitude", "type": "quantitative"},
"latitude": {"field": "latitude", "type": "quantitative"},
"size": {
"field": "properties.mag",
"type": "quantitative",
"scale": {
"type": "pow",
"range": [0, 1000],
"exponent": {"expr": "12-earthquakeSize"}
}
}
},
"transform": [
{"calculate": "datum.geometry.coordinates[0]", "as": "longitude"},
{"calculate": "datum.geometry.coordinates[1]", "as": "latitude"},
{
"filter": "(rotate0 * -1) - 90 < datum.longitude && datum.longitude < (rotate0 * -1) + 90 && (rotate1 * -1) - 90 < datum.latitude && datum.latitude < (rotate1 * -1) + 90"
}
],
"projection": {
"type": "orthographic",
"rotate": [{"signal": "rotate0"}, {"signal": "rotate1"}, 0]
}
}
],
"config": {}
}