viewof jump_rating = V({
data: {values: movies},
transform: [
{filter: {field: "Genre", oneOf: genreSelection}}
],
hconcat: [{
width: 300,
height: 300,
selection: {
MPAArating: {
type: "multi", fields: ["MPAA Rating"], bind: "legend",
},
rating: {
type: "single",
fields: ["MPAA Rating"],
bind: {"input": "select", options: [null, "G", "M", "NC-17", "NR", "PG", "PG-13", "R", "TV-MA"]}
}
}
,
mark: {
type: "circle",
size:50
},
encoding: {
x:{field: "Jump Count", type: "quantitative"},
y:{field: "RT_Critic", type: "quantitative",axis: {title: "Rotton Tomatoes CRITICS Ratings"}},
color: {
field: "MPAA Rating", "type": "nominal",
},
opacity: {
condition: {"selection": "rating", "value": 1},
value: 0.05
},
tooltip: [
{field: "Movie Name", type: "nominal", title: "Movie"},
{field: "MPAA Rating", type: "nominal", title: "MPAA Rating"},
{field: "RT_Critic", type: "quantitative", title: "Rotten Tomatoes Critic Score"},
{field: "RT_Audience", type: "quantitative", title: "Rotten Tomatoes Audience Score"},
{field: "Jump Count", type: "quantitative", title: "Jump Count"}
],
}
},{
width: 300,
height: 300,
mark: {
type: "circle",
size:50
},
selection: {
MPAArating: {
type: "multi", fields: ["MPAA Rating"], bind: "legend"
}
},
encoding: {
x:{field: "Jump Count", type: "quantitative"},
y:{field: "RT_Audience", type: "quantitative",axis: {title: "Rotton Tomatoes AUDIENCE Ratings"}},
color: {
condition: {
selection: "MPAArating",
field: "MPAA Rating", type: "nominal"
},
},
opacity: {
condition: {"selection": "rating", "value": 1},
value: 0.05
},
tooltip: [
{field: "Movie Name", type: "nominal", title: "Movie"},
{field: "MPAA Rating", type: "nominal", title: "MPAA Rating"},
{field: "RT_Critic", type: "quantitative", title: "Rotten Tomatoes Critic Score"},
{field: "RT_Audience", type: "quantitative", title: "Rotten Tomatoes Audience Score"},
{field: "Jump Count", type: "quantitative", title: "Jump Count"}
],
}
}]
})