chart = Choropleth(timezone_changes, {
id: (d) => d?.id,
value: (d) => (d?.change_without_dst ? d?.change_without_dst - 1 : 0),
scale: d3.scaleDiverging,
domain: [0, 2, 20],
range: ["#F3F8FE", "#DBEBF6", "#6daed5"],
featureId: (f) => f.properties.tzid,
title: (f, d) => {
if (!d?.change_count) return;
const country = tz.getCountryForTimezone(f.properties.tzid);
return `${f.properties.tzid}${
country?.name ? " - " + country?.name : ""
}, \nIANA records ${
d?.change_count - 1
} changes in this timezone. \n\nIgnoring DST:${
d?.change_without_dst ? d?.change_without_dst - 1 : 0
}`;
},
projection,
features,
borders: world,
onClick: (d) => {
const id = d.properties.tzid;
const tz = timezone_changes.find((x) => x.id == id);
console.log(tz);
mutable selected_tz = tz.id;
},
fill: "gray",
stroke: "peru",
tzStroke: "white",
tzStrokeWidth: 0.4,
strokeWidth: 0.4,
width,
height
})