chartAmericaSimple =
{
const hover = vl.selectSingle().nearest(true).on("mousemove").fields("Country").empty("none")
const points = vl.markCircle()
.select(hover)
.encode(
vl.opacity().value(0).if(hover, vl.value(1)),
vl.size().value(1).if(hover, vl.value(200))
)
const lines = vl.markLine({ interpolate: "monotone" })
const plotAmerica =
vl
.data(wvs.filter(d => d.Continent === "America"))
.encode(
vl.x().fieldT("Year").title("Año").axis({ grid: false}),
vl.y().fieldQ("pct").title("% De Acuerdo").axis({ format: "%", grid: false }).scale({domain: [0, 0.5]}),
vl.size().fieldQ("size").legend(null).if(hover, vl.value(4)),
vl.color().fieldN("color").legend(null).if(hover, vl.value("#000000")),
vl.detail().fieldN("Country"),
vl.tooltip(["Country", "WVS Wave", "% Agree"]))
.layer(lines, points)
.width(600)
return plotAmerica.render();
}