Platform
Resources
Pricing
Sign in
Get started
Josh Rayman
I make elections graphics and other stuff.
Workspace
Fork
Published
By
Josh Rayman
Edited
Mar 16, 2020
1 star
10
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
selectedData
=
statesData
.
filter
(
d
=>
d
.
name
===
selected
)
[
0
]
;
Insert cell
Insert cell
stateNames
=
[
"Chicago, IL"
,
"Des Moines, IA"
,
"Detroit, MI"
,
"Manchester, NH"
,
"Burlington, VT"
,
"New Haven, CT"
,
"Brooklyn, NY"
,
"Columbia, SC"
,
"Austin, TX"
,
"New Orleans, LA"
]
;
Insert cell
states
=
[
"IL"
,
"IA"
,
"MI"
,
"NH"
,
"VT"
,
"CT"
,
"NY"
,
"SC"
,
"TX"
,
"LA"
]
;
Insert cell
statesData
=
states
.
map
(
(
d
,
i
)
=>
(
{
name
:
d
,
isPresent
:
stateGraphic
[
d
]
!==
undefined
,
image
:
images
[
i
]
,
fullName
:
stateNames
[
i
]
}
)
)
Insert cell
stateGraphic
=
(
{
// IA: () => false
}
)
Insert cell
Insert cell
promises
=
files
.
map
(
file
=>
file
.
url
(
)
)
Insert cell
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
selected
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
selectedData
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
updateState
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
stateNames
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
states
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
statesData
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
stateGraphic
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
files
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
promises
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
images
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML