vegalite({
data: {url:"https://gist.githubusercontent.com/bpricop/eb957963b5499141dc27175445284c8d/raw/471a45f2a8ebeb9e783a026b23a66a0c3d3328df/all_aggregated_tidy%2520FINAL.csv"},
vconcat: [
{
mark: "point",
encoding: {
x: {timeUnit: "year", field: "Year_of_Release", type: "temporal"},
y: {field: "Internet Usage", type: "quantitative"},
color: {
condition: {
field: "Genre",
selection: "click",
type: "nominal"
},
value: "lightgray"
},
size: {field: "Internet Usage", type: "quantitative", scale: {domain: [1, 50]}},
},
"transform": [
{"filter": {"field": "Region", "oneOf": ["EU"]}}
],
width: 350,
height: 250,
selection: {brush: {encodings: ["x"], type: "interval"}}
},
{
mark: "point",
encoding: {
x: {timeUnit: "year", field: "Year_of_Release", type: "temporal"},
y: {field: "Internet Usage", type: "quantitative"},
color: {
condition: {
field: "Genre",
selection: "click",
type: "nominal"
},
value: "lightgray"
},
size: {field: "Internet Usage", type: "quantitative", scale: {domain: [1, 50]}},
},
"transform": [
{"filter": {"field": "Region", "oneOf": ["JP"]}}
],
width: 350,
height: 250,
selection: {brush: {encodings: ["x"], type: "interval"}}
},
{
mark: "point",
encoding: {
// "x": {"field": {"repeat": "column"}, "type": "quantitative"},
x: {timeUnit: "year", field: "Year_of_Release", type: "temporal"},
y: {field: "Internet Usage", type: "quantitative"},
color: {
condition: {
field: "Genre",
selection: "click",
type: "nominal"
},
value: "lightgray"
},
size: {field: "Internet Usage", type: "quantitative", scale: {domain: [1, 50]}},
},
"transform": [
{"filter": {"field": "Region", "oneOf": ["NA"]}}
],
width: 350,
height: 250,
selection: {brush: {encodings: ["x"], type: "interval"}}
},
{
mark: "point",
encoding: {
// "x": {"field": {"repeat": "column"}, "type": "quantitative"},
x: {timeUnit: "year", field: "Year_of_Release", type: "temporal"},
y: {field: "Internet Usage", type: "quantitative"},
color: {
condition: {
field: "Genre",
selection: "click",
type: "nominal"
},
value: "lightgray"
},
size: {field: "Internet Usage", type: "quantitative", scale: {domain: [1, 50]}},
},
"transform": [
{"filter": {"field": "Region", "oneOf": ["NA"]}}
],
width: 350,
height: 250,
selection: {brush: {encodings: ["x"], type: "interval"}}
},
{
encoding: {
color: {
condition: {
field: "Genre",
title: "Genre",
selection: "click",
type: "nominal"
},
value: "lightgray"
},
x: {aggregate: "count", type: "quantitative"},
y: {field: "Genre", type: "nominal"}
},
width: 800,
mark: "bar",
selection: {click: {encodings: ["color"], type: "multi"}},
transform: [{filter: {selection: "brush"}}]
},
{
encoding: {
color: {
condition: {
field: "Region",
title: "Region",
selection: "click",
type: "nominal"
},
value: "lightgray"
},
x: {aggregate: "count", type: "quantitative"},
y: {field: "Region", type: "nominal"}
},
width: 800,
mark: "bar",
selection: {click: {encodings: ["color"], type: "multi"}},
transform: [{filter: {selection: "brush"}}]
}
]
})