Published
Edited
Jan 17, 2022
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getSpiralAreaVeryHigh(data) {
const data3 = data.map((d, i) => [
(2 * Math.PI * moment(d.date).dayOfYear()) / 365,

d.highlightCritical
? startRadious +
areaHeight * 2 * (1 + i / 365) -
d.relativeSize * areaHeight
: startRadious + areaHeight * 2 * (1 + i / 365),

d.highlightCritical
? startRadious +
areaHeight * 2 * (1 + i / 365) +
d.relativeSize * areaHeight
: startRadious + areaHeight * 2 * (1 + i / 365)
]);

return areaGenerator(data3);

return data;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getMaxCasesPerMillion(data) {
return _.chain(data)
.maxBy((d) => d.value)
.value()["valuePerMillion"];
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
higlightThresholdCritical = 3
Insert cell
_.chain(dataWorld)
.filter((d) => d.location == "United States")
.slice(700, 800)
.value()
Insert cell
Insert cell
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
}));
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
moment = require("moment")
Insert cell
import { groupedSelect, style_bootstrap } from "@elaval/utils"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more