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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more