Published
Edited
Sep 21, 2022
Insert cell
df = FileAttachment("311 Summary - Brooklyn Vehicle Nose Since 2017.csv").csv()
Insert cell
parseTime = d3.timeParse("%m/%d/%Y")
Insert cell
dates = df.map(
(row) => new Date(parseTime(row["Created Date"].split(" ")[0]).setDate(0))
)
Insert cell
countByDate = Array.from(d3.group(dates, (d) => d).values()).map((row) => ({
Date: row[0],
Count: row.length
}))
Insert cell
Plot.plot({
width,

y: {
grid: true
},
marks: [Plot.line(countByDate, { x: "Date", y: "Count", sort: "Date" })]
})
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