Platform
Resources
Pricing
Sign in
Get started
Eric Dietrich
Data journalist/designer, Montana
Workspace
Fork
Unlisted
By
Eric Dietrich
Edited
Oct 16, 2024
7
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
updateDate
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
expenditures
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
byCommittee
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
barbSpending
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
embedTable
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tableStyle
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dollarFormat
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
fillColor
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML