-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment_3.vg
43 lines (43 loc) · 1.81 KB
/
assignment_3.vg
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
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"url": "https://raw.githubusercontent.com/Ankita-Khiratkar/ankitakhiratkar.github.io/master/building_inventory.csv"},
"columns": 2,
"concat":[{
"mark": "circle",
"transform": [{"filter": {"field": "Year Acquired", "gt" : 0}}, {"filter" :{"field":"Year Constructed", "gt": 0}}],
"selection": {"clickanddrag": {"type": "interval", "encodings": ["y"]}},
"encoding": {
"x": {"field": "Year Constructed", "type": "quantitative", "scale": {"domain": [1700,2050]}},
"y": {"field": "Year Acquired", "type": "quantitative", "scale": {"domain": [1700,2050]}},
"tooltip": [
{"field": "Congressional Full Name", "type": "nominal"},
{"field": "Year Acquired", "type": "quantitative"}],
"opacity": {"condition": {"selection":"clickanddrag"}, "value": 0.2}}
},
{
"layer": [{
"mark": "bar",
"encoding": {
"x": {"field": "Congressional Full Name", "type": "ordinal"},
"y": {"aggregate": "count", "type": "quantitative"},
"opacity": {"value": 0.2}}
},
{
"mark": "bar",
"transform": [{"filter": {"selection": "clickanddrag"}}],
"encoding": {
"x": {"field": "Congressional Full Name", "type": "ordinal"},
"y": {"aggregate": "count", "type": "quantitative"}
}
}]
},
{
"mark": "bar",
"encoding": {
"x": {
"aggregate": {"sum": "Square Footage"},
"field": "Square Footage",
"type": "quantitative"},
"y": {"field": "Congressional Full Name", "type": "nominal"}}
}]
}