Public
Edited
Apr 8, 2024
Insert cell
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.plot({
marginTop: 50,
marginLeft: 100,
width,
marks: [
Plot.dot(filteredData, {
x: "createdOn",
y: "revenue",
fill: "#65a7ff",
opacity: 0.5,
r: "revenue",
tip: true,
title: "name"
})
]
})
Insert cell
Insert cell
raw = FileAttachment("indie-hackers.csv").csv({ typed: true })
Insert cell
data = {
const keys = Object.keys(raw[0]);
const isTimestampKey = (k) => k.endsWith("Timestamp");
const timestampKeys = keys.filter(isTimestampKey);

return raw
.map((d) => {
return keys.reduce((obj, k) => {
if (timestampKeys.includes(k)) {
const newKey = k.replace("Timestamp", "On");
return { ...obj, [newKey]: new Date(d[k]) };
}
return {
...obj,
[k]: d[k]
};
}, {});
})
.map((d) => {
return { startedOn: new Date(d.startDateStr), ...d };
})
.sort((a, b) => b.revenue - a.revenue);
}
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