Public
Edited
Sep 5, 2024
Insert cell
Insert cell
Insert cell
transactionsDates = Array.from(d3.rollup(transactions, v => v[0], d => d.date).keys())
.map(date => new Date(date))
.sort((a, b) => a - b)
Insert cell
Insert cell
transactionsMemo = Array.from(d3.rollup(transactions, v => v[0], d => d.memo).keys())
Insert cell
Insert cell
Insert cell
search_transaction
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
grouped_transactions = d3.rollups(
search_transaction,
v => ({
sum_usd: d3.sum(v, leaf => leaf.amount_usd),
sum_cents: d3.sum(v, leaf => leaf.amount_cents)
}),
d => d.date,
d => d.memo
);
Insert cell
Insert cell
Insert cell
transactions_usd = transactions.map((d) => ({
...d,
amount_usd: Math.abs(d.amount_cents) / 100
}))
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.cell(
transactions_usd,
Plot.group(
{
fill: "sum"
},
{
fill: "amount_usd",
y: "memo",
x: (d) => new Date(d.date)
}
)
)
],
marginLeft: 300,
width: 1040,
height: 5000
})
Insert cell
transactions = FileAttachment(
"transaction_export_Arcade_2024-09-05-02-08-55.json"
).json()
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