This gist contains a Jupyter Notebook tutorial for corpus preparation.
#################################### | |
# Code for network analysis tutorial using R | |
#################################### | |
# Import necessary libraries | |
library(tidyverse) | |
library(igraph) | |
library(networkD3) | |
# Read in edgelist CSV |
First Name | Last Name | Affiliation | EMDA1 | EMDA2 | EMDA3 | Reunion role | Remix role | Remix redux | project1 | project2 | project3 | funder1 | funder2 | funder3 | publication1 | publication2 | publication3 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tara | Wood | Ball State University | Participant | |||||||||||||||
Ian | Gadd | Bath Spa University | Faculty | |||||||||||||||
Erica | Zimmer | Boston University | Participant | |||||||||||||||
Erica | Zimmer | Boston University | Participant | |||||||||||||||
Mark | Davies | Brigham Young University | Faculty | |||||||||||||||
Wendy | Hui Kyong Chun | Brown University | Faculty | |||||||||||||||
Julia | Flanders | Brown University Library | Faculty | Women Writers Project | ||||||||||||||
Katherine | Rowe | Bryn Mawr College | Faculty | |||||||||||||||
Sebastian | Ahnert | Cambridge University | Faculty |
A network graph of the 10-topic LDA results for all 58 inaugural address. Whose inaugural addresses were semantically similar? Let's find out!
Features of this visualization:
- drag canvas to pan
- scroll to zoom
- orange nodes are topics, blue are inaugural addresses
- mouseover to see node labels
- click on any node to see its ego network
- click on an orange node to see the words in that topic
I hereby claim:
- I am jrladd on github.
- I am jrladd (https://keybase.io/jrladd) on keybase.
- I have a public key whose fingerprint is C488 A09C 0502 4214 BB7F 4855 3AA8 EA95 DF99 A3EE
To claim this, I am signing this object:
This force-directed graph takes advantage of the new features of D3 version 4 to display and manipulate a network of Marvel Comics characters. Click "open" to use the full suite of tools.
- Scroll to zoom.
- Use the slider to change the edge-weight threshold.
- Click on nodes to see ego networks (click again to see all nodes).
- Use the dropdown to show three different centrality measures, calculated using NetworkX in Python and imported through the marvel.json file.
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.node { | |
stroke: #fff; | |
stroke-width: 1.5px; | |
} | |
.link { |
n.b. If the text is overlapping with the graph, click "open" and widen your browser window.
A Spenser deformance project for the conclusion of the 2016 HDW Summer Workshop at WashU. Using color words from WordNet, this data visualization finds all lines that include a color term in The Faerie Queene (and, for comparison, in A Midsummer Night's Dream) and displays that data in a pie graph.
When a user clicks on a color in the pie graph, the lines for that color are displayed. They can then select multiple colors, and the visualization will randomly reorder the lines, creating new, evocative color poems. Using the dropdowns for each Book of the epic, the user can create poems that combine all the "red" lines from Book 1 with all the "green" lines from Book 4 and so on.
This bipartite force-directed network graph shows participants in university miscellanies from the 1650s and 1660s. Dark green nodes represent texts published before 1660, while light green nodes represent those published after. The rest of the nodes are for individual contributors (mouseover to see names, scroll or double-click to zoom, click a node to see ego networks). The dark blue nodes show political "shapeshifters" who published in miscellanies both before and after the Restoration. Notice that the graph separates not by political affiliation (Royalist and Republican) but by university affiliation (Oxford and Cambridge).
This visualization is based on a demo from Mike Bostock, on force-directed graphs. Additionally it handles search and a dropdown menu, which allows you to switch between different measures of centrality (degree, betweenness, and closeness) without reloading the graph. (All centrality calculations were made using the bipartite algorithms in Pyth
#! /usr/bin/env python | |
from bs4 import BeautifulSoup | |
from textblob import TextBlob as tb | |
with open('eikon.xml', 'r') as f: | |
xml = f.read() | |
soup = BeautifulSoup(xml, 'lxml-xml') |