Unlisted
Edited
Oct 16, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
barbSpending = expenditures.filter(d => d.candidate === 'Barb')
Insert cell
Insert cell
tableStyle = `
<style>
table {
font-family: Arial, sans-serif;
font-size: 14px; /* to override Newspack's awful defaults */
}
@media (max-width 500px) {
table {
font-size: 12px;
}
}
table th {
font-size: 1em;
line-height: 1.1em;
}
table tr {
border-bottom: 1px solid #eee;
}
table thead tr {
border-bottom: 1px solid #ddd;
}
table tbody tr:last-child {
border-bottom: none;
}
table td, table th {
word-break: normal;
border: none;
padding: 0.3em;
}
</style>
`
Insert cell
Insert cell
fillColor = d => {
const scale = d3.scaleThreshold()
.domain([1e3, 1e6, 1e7, 1e8])
.range(['#ffffd4','#fee391','#fec44f','#fe9929','#ec7014',])
if (d === 0) return 'none'
return scale(d)
}
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