wmap = {
const selection =
vl.selectSingle()
.on('mouseover')
.nearest(false)
.empty('all')
const wrld_map = vl.markGeoshape()
.width(600)
.height(400)
.data(vl.topojson(world).feature('land') )
.encode(
vl.color().value("#c5dddd")
)
const cities = vl.markCircle()
.data(capitals)
.select(selection)
.encode(
vl.size().fieldQ("pop_max").title("Население"),
vl.longitude().fieldQ("longitude"),
vl.latitude().fieldQ("latitude"),
vl.tooltip().fieldN("name-rus"),
vl.color().value("#008EBA").if(selection, {value: "#373fa1"}),
)
let barhart = vl.markBar()
.title("Население")
.data(capitals)
.select(selection)
.transform(
{filter: "pop_max>50000"}
)
.encode(
vl.x().fieldQ("capitals"),
vl.y().fieldN("name-rus").sort("-x"),
vl.tooltip().fieldQ("pop_max"),
vl.color().value("#4992f2").if(selection , {value: "#0c4896" } )
)
return vl.layer (wrld_map, cities, barhart)
.view({stroke: "transparent" })
.project(
vl.projection("Mercator")
).render()
}