data_ = {
const data = _.chain(dataExcessDeaths)
.filter(
(d) =>
(dictCode[d.iso3c] && dictCode[d.iso3c]["location"]) == selectedCountry
)
.value();
const max = _.chain(data)
.map((d) => +d["cumulative_estimated_daily_excess_deaths_per_100k"] || 0)
.max()
.value();
return data.map((d) => ({
date: d.date,
relativeSize: +d["cumulative_estimated_daily_excess_deaths_per_100k"]
? +d["cumulative_estimated_daily_excess_deaths_per_100k"] / max
: 0,
value: +d["cumulative_estimated_daily_excess_deaths_per_100k"],
valuePerMillion:
+d["cumulative_estimated_daily_excess_deaths_per_100k"] * 10,
highlight:
+d["cumulative_estimated_daily_excess_deaths_per_100k"] >=
higlightThreshold,
highlightCritical:
+d["cumulative_estimated_daily_excess_deaths_per_100k"] >=
higlightThresholdCritical
}));
}