bertin.draw({
params: {
projection: upsidedown
? "CylindricalEqualArea.rotate([0,180])"
: "CylindricalEqualArea",
extent: america,
width: 800
},
layers: [
{
type: "header",
text: "Population in America",
background: "#1194a8",
fill: "white",
fontSize: 27,
anchor: "middle"
},
{
type: "square",
geojson: america,
values: "pop_thousands",
demers: demers,
k: k,
fill: "#1194a8",
tooltip: ["$NAMEen", "$pop_thousands", "thousands inh."],
leg_round: 0,
leg_x: 540,
leg_y: 30,
leg_title: "Thousands of inhabitants\nin 2018"
},
{
type: "layer",
geojson: world,
fillOpacity: 0.35,
fill: "white",
stroke: "none"
},
{ type: "scalebar" },
{ type: "graticule" },
{ type: "outline" }
]
})