Plot.plot({
projection: {
type: "mercator",
domain: {
type: "MultiPoint",
coordinates: [
[58, -15],
[151, -15],
[58, 38],
[151, 38]
]
}
},
marks: [
Plot.sphere({fill: "black"}),
Plot.geo(countries, {fill: (d)=> happiness_index_sea_2022.get(d.properties.name), opacity: 1, stroke: "white",
title: (d)=> d.properties.name + "\n" + happiness_index_sea_2022.get(d.properties.name),
}),
Plot.geo(countries, {fill: "yellow", opacity: 1, stroke: "yellow", strokeWidth: 5,
title: (d)=> d.properties.name + "\n" + happiness_index_sea_2022.get(d.properties.name),
filter: d=>d.properties.name == "Singapore"
}),
Plot.text(['Happiness index, 2022\nSoutheast Asia'],{x:120, y: 36, fontSize: 40, fill: "yellow", opacity: 1, lineHeight: 1.6, dy: -50, fontStyle: "italic", fontWeight: "Bold" }),
Plot.text(['0 (unhappy) - 10 (happy)\n\nThe average for 2022 based on 10 countries was 5.29 points.The highest value was in Singapore: 6.59 points and the lowest value was in India: 4.04 points.'],
{x:62, y: -15, fontSize: 16, fill: "yellow", opacity: 1, lineWidth: 26, textAnchor: "start", lineHeight: 1.6, clip: false }),
Plot.text(['Data: theglobaleconomy.com | Design: Deepsha Menghani | Threads: @IandLoveandData | Mastodon: @Deepsha'],{x:150, y: -29, fontSize: 14, fill: "gray", opacity: 1, textAnchor: "end", lineHeight: 1.2, clip: false, fontStyle: "italic"}),
],
width: 700,
color: {
range: myContinuousColors,
interpolate: "hcl" ,
legend: true, style: {fontSize: "14px"},
width: 700
}
})