Published
Edited
Jun 30, 2020
1 star
Insert cell
Insert cell
Insert cell
Insert cell
dataset_step1 = d3.csvParse(await FileAttachment("throughput@9.csv").text(), d3.autoType)
Insert cell
Insert cell
Insert cell
dataset_step2 = dataset_step1.map(function(d) {
return {
issueId: d.issueid,
completionDate: d.completiondate,
week: getWoy(d.completiondate)
};
})
Insert cell
Insert cell
Insert cell
aggregationMap = d3.rollup(dataset_step2, v => d3.count(v, d => d.week), d => d.week)
Insert cell
dataset_step3 = Array.from(aggregationMap).sort((a, b) => d3.ascending(a[0], b[0]))
Insert cell
Insert cell
Insert cell
Insert cell
dataset_step4 = movingAverage(dataset_step3.map(d => d[1]), N)
Insert cell
Insert cell
Insert cell
Insert cell
dataset_step5 = Array.from({length}, (_, i) => ({
week: dataset_step3.map(d => d[0])[i],
throughput: dataset_step3.map(d => d[1])[i],
movingaverage: +d3.format(".1f")(dataset_step4[i])
}))
Insert cell
final_dataset = dataset_step5
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// Testing getWoy function
getWoy("30-Mar-2020")
Insert cell
Insert cell
// Testing getDow function
getDow("30-Mar-2020")
Insert cell
Insert cell
// Testing getDoy function
getDoy("30-Mar-2020")
Insert cell
Insert cell
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