Published
Edited
May 4, 2021
1 fork
Insert cell
Insert cell
Insert cell
Plot.cell(data, { x: "from", y: "to", fill: "contract_size" }).plot({
color: { scheme: "reds" },
x: { domain: top_donors },
y: { domain: top_recipients },
marginLeft: 150,
width
})
Insert cell
d3 = require("d3")
Insert cell
data = d3.csv(
"https://raw.githubusercontent.com/sophieehill/my-little-crony/main/connections.csv",
d3.autoType
)
Insert cell
Table(data)
Insert cell
Plot = require("@observablehq/plot@0.1.0/")
Insert cell
import { Table, Range } from "@observablehq/inputs"
Insert cell
top_donors = tidy(
data,
groupBy("from", [summarize({ total: sum("contract_size") })]),
sliceMax(max_cells)
).map((d) => d.from)
Insert cell
top_recipients = tidy(
data,
groupBy("to", [summarize({ total: sum("contract_size") })]),
sliceMax(max_cells)
).map((d) => d.to)
Insert cell
import {
tidy,
arrange,
filter,
desc,
summarize,
groupBy,
sum,
distinct,
sliceMax
} from "@pbeshai/tidyjs"
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