Public
Edited
Nov 17, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
densities_tt = {
const a = [];
["Talk type A", "Talk type B"].forEach((d, i) => {
const raw = talk_type
.filter((f) => f["Talk_Type"] === d)
.map((g) => parseInt(g["Honoraria_Value"]))
.sort((a, b) => a - b);
const data2 = kde(epanechnikov(bwEstimate(raw)), raw)(raw);
data2.forEach((f) =>
a.push({
value: f[0],
weight: f[1],
"Honoraria Type": d,
index: i,
resp: talk_type.filter(
(item) =>
item["Talk_Type"] === d &&
parseInt(item["Honoraria_Value"]) === f[0]
).length,
m: d3.median(raw)
})
);
});
return a;
}
Insert cell
newMax = {
const test = d3.group(densities_tt, (d) => d["Honoraria Type"]);
const newObj = Object.fromEntries(test);
return Object.keys(newObj).map((key) => {
let valsOnly = newObj[key].map((item) => item.value);
return {
"Honoraria Type": key,
maxVal: d3.max(valsOnly)
};
});
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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