burndownData = d3
.utcDays(new Date(2022, 3, 18), new Date(), 1)
.map((date) => ({
date,
shipped: data
.filter((d) => d["Shipped?"] === "Yes")
.filter((d) => d["Date Shipped"] <= date).length
}))
.map((d) => ({ ...d, remaining: data.length - d.shipped }))
.reduce((acc, d) => {
if (acc.length === 0) {
return [{...d, incrShipped: d.shipped}];
} else {
return [...acc, {...d, incrShipped: d.shipped - acc.slice(-1)[0].shipped}];
}
}, [])