Public
Edited
Mar 29, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof selectedSenators = searchCheckbox(
senators.map((d) => d.member_full.content)
)
Insert cell
ForceGraph(
{
nodes: senatorToVoteLinksNodes,
links: senatorToVoteLinks.filter((d) => selectedSenators.includes(d.source))
},
{
nodeId: (d) => d.id,
renderer: "canvas",
invalidation,
_this: this,
extent: [
[0, 0],
[width, height]
],
width,
height,
// nodeLabel: false,
drawLinksWhenAlphaIs: 0.5 // useful for larger graphs
}
)
Insert cell
// isolate node values
senators = USSenateVotingData[0].members.member.map((m) => {
const copy = { ...m, id: m.member_full };
delete copy.vote_cast;
return copy;
})
Insert cell
Insert cell
Insert cell
// isolate node values (senators)
senatorToVoteLinksNodes = Array.from(
d3.group(senatorToVoteLinks, (d) => d.source).keys()
)
.concat(Array.from(d3.group(senatorToVoteLinks, (d) => d.target).keys()))
.map((d) => ({ id: d }))
Insert cell
Insert cell
Insert cell
viewof selectedUnis = searchCheckbox(papersNodes)
Insert cell
ForceGraph(
{
nodes: papersNodes,
links: papersLinks.filter((d) => selectedUnis.includes(d.source))
},
{
nodeId: (d) => d,
renderer: "canvas",
invalidation,
_this: this,
extent: [
[0, 0],
[width, height]
],
width,
height,
// nodeLabel: false,
drawLinksWhenAlphaIs: 0.5 // useful for larger graphs
}
)
Insert cell
Insert cell
uniqueSources = papersLinks
.map((paper) => paper.source)
.filter((source, index, self) => self.indexOf(source) === index)
Insert cell
papersNodes = papersAndAffiliations
.map((paper) => paper.affiliation)
.filter((source, index, self) => self.indexOf(source) === index)
Insert cell
Insert cell
papersAndAffiliations = arrayData
.map((p) =>
p.authors.map((a) => ({
paper: p.id,
author: a.personId,
affiliation: a.affiliations[0]?.institution
}))
)
.flat()
Insert cell
viewof paperAffiliationsDF = aq
.from(papersAndAffiliations)
.groupby(["paper", "affiliation"])
.count()
.view()
Insert cell
Insert cell
arrayData = data.contents
Insert cell
data = FileAttachment("UIST_2020_program (1).json").json()
Insert cell
import { xmlToJSON } from "@visnup/xml-to-json"
Insert cell
import { aq, op } from "@uwdata/arquero"
Insert cell
import { getCommonConnections } from "@john-guerra/get-common-connections"
Insert cell
import { searchCheckbox } from "@john-guerra/search-checkbox"
Insert cell
height = 400
Insert cell
import { ForceGraph } from "@john-guerra/force-directed-graph"
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