Platform
Resources
Pricing
Sign in
Get started
tedbjerregaard
Workspace
Fork
Public
By
tedbjerregaard
Edited
Mar 22, 2023
1
Insert cell
Insert cell
navio
(
USSenateVotingData
.
map
(
(
v
)
=>
v
.
members
.
member
.
map
(
(
m
)
=>
(
{
...
m
,
n
:
v
.
vote_number
}
)
)
)
.
flat
(
)
)
Insert cell
flatUSSenateVotingData.csv
Filter
Columns
Sort
Slice
Save
Type Table, then Shift-Enter. Ctrl-space for more options.
Insert cell
senators
=
USSenateVotingData
[
0
]
.
members
.
member
.
map
(
(
m
)
=>
{
const
copy
=
{
...
m
,
id
:
m
.
member_full
}
;
delete
copy
.
vote_cast
;
return
copy
;
}
)
Insert cell
// convert to a network
senatorToVoteLinks
=
USSenateVotingData
.
map
(
(
v
)
=>
v
.
members
.
member
.
map
(
(
m
)
=>
(
{
source
:
m
.
member_full
,
target
:
v
.
vote_number
+
m
.
vote_cast
}
)
)
)
.
flat
(
)
Insert cell
commonVotesLinks
=
getCommonConnections
(
{
links
:
senatorToVoteLinks
}
)
Insert cell
network
=
(
{
nodes
:
senators
,
links
:
commonVotesLinks
}
)
Insert cell
Insert cell
USSenateVotingData
Insert cell
import
{
ForceGraph
}
from
"@john-guerra/force-directed-graph"
Insert cell
import
{
getCommonConnections
}
from
"@john-guerra/get-common-connections"
Insert cell
import
{
Swatches
}
from
"@d3/color-legend"
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
flatussenatevotingdata
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
File attachments
flatUSSenateVotingData.csv
CSV
Databases
Filter
Column
Operator
Columns
Sort
Column
Direction
Descending
Ascending
Slice
From
Start
To
End
senators
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
senatorToVoteLinks
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
commonVotesLinks
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
network
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML