Public
Edited
Apr 17, 2023
Insert cell
Insert cell
chart = Plot.plot({
dataAspectRatio: true,
inset: 10,
marks: [Plot.dot(data, { x: "time", y: "duration" })],
y: { tickFormat: (d) => d / 1000, label: "duration (s)" }
})
Insert cell
x = chart.scale("x")
Insert cell
y = chart.scale("y")
Insert cell
x.apply(10000) - x.apply(0)
Insert cell
y.apply(10000) - y.apply(0)
Insert cell
data = d3.csvParse(
`time,duration
2008-10-05T04:01:00Z,3600000
2008-10-05T04:06:00Z,2800000
2008-10-05T04:36:00Z,2890000
2008-10-05T05:00:00Z,2500000
`,
d3.autoType
)
Insert cell
Plot = FileAttachment("plot-2.umd.js").url().then(require)
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