myviz = {
const nausea = vl.markPoint({size:90, filled:true})
.data(df)
.encode(
vl.x().fieldQ("excitement").axis({grid:false}).scale({domainMin:2}).title('Excitement'),
vl.y().fieldQ("nausea").title('Nausea'),
vl.color().fieldN("custom_design").legend(null),
vl.tooltip().fieldN('theme')
)
.width(400)
.height(200)
const intensity = vl.markPoint({size:90, filled:true})
.data(df)
.encode(
vl.x().fieldQ("excitement").axis(null).scale({domainMin:2}),
vl.y().fieldQ("intensity").title('Intensity'),
vl.color().fieldN("custom_design").legend(null),
vl.tooltip().fieldN('theme')
)
.width(400)
.height(200)
const speed = vl.markPoint({size:90, filled:true})
.data(df)
.encode(
vl.x().fieldQ("excitement").axis({grid:false}).scale({domainMin:2}).title('Excitement'),
vl.y().fieldQ("max_speed").title('Maximum Speed'),
vl.color().fieldN("custom_design").legend(null),
vl.tooltip().fieldN('theme')
)
.width(400)
.height(200)
const time = vl.markPoint({size:90, filled:true})
.data(df)
.encode(
vl.x().fieldQ("excitement").axis(null).scale({domainMin:2}),
vl.y().fieldQ("ride_time").title('Ride Time'),
vl.color().fieldN("custom_design").legend({orient:'top-left', fillColor:'white', labelFontSize: 12, titleFontSize:14, values:['Not Custom', 'Custom']}).title('Customization'),
vl.tooltip().fieldN('theme')
)
.width(400)
.height(200)
const horiz1 = vl.hconcat(time, intensity)
const horiz2 = vl.hconcat(speed, nausea)
return vl.vconcat(horiz1, horiz2)
.title({text:'Ride Time, Speed, Intensity, and Nausea Effect on Excitement Based on Custom or Not Custom Design', anchor: 'middle', fontSize:17, labelFontStyle:'bold'})
.render()
}