// we can see the months May, June, and July have more collisions
d3.rollup(
data,
group=>d3.sum(group,d=>d.injured+d.killed),
d=>mon[d.dateTime.getMonth()]//again in the months of june, may, july deaths and injuries are more/higher
)
md`What are the Top 5 zipcodes with highest number of collisions?.`
collision=data.filter(d=>d.zip!=='')
d3.groupSort(collision,
group=>group.length,
d=>d.zip).reverse().slice(0,5)// top 5 with highest no. of collisons
md`What are the Top 5 zipcodes with highest number of injuries and deaths?.`
d3.rollup(collision,
group=>d3.sum(group,d=>d.killed+d.injured),
d=>d.zip)//showing no. of injuries and death for all zipcodes
d3.groupSort(collision,
group=>d3.sum(group,d=>d.killed+d.injured),
d=>d.zip).reverse()
.slice(0,5)// top 5 zipcodes with highest injury and death
md`What are the Top 5 causes that contributed highest number of collisions?`
d3.groupSort(
data,
group=>group.length,
d=>d.cause
).reverse()
.slice(0,5)
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.