Skip to content

Instantly share code, notes, and snippets.

@jrladd
jrladd / network.r
Created April 16, 2021 15:25
Code for network analysis tutorial using R
####################################
# Code for network analysis tutorial using R
####################################
# Import necessary libraries
library(tidyverse)
library(igraph)
library(networkD3)
# Read in edgelist CSV
@jrladd
jrladd / EMDAworld.csv
Last active June 21, 2018 20:42
Early Modern Digital Agendas Network
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
@jrladd
jrladd / README.md
Last active March 21, 2017 19:13
How to Prepare a Corpus for DocuScope

This gist contains a Jupyter Notebook tutorial for corpus preparation.

@jrladd
jrladd / README.md
Last active March 1, 2017 16:38
Inaugural Address topic model network

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

Keybase proof

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:

@jrladd
jrladd / README.md
Last active April 14, 2020 04:31
Marvel Network: A Tricked-Out D3 Implementation

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.

Features

  • 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.
@jrladd
jrladd / index.html
Last active July 6, 2016 18:46 — forked from mbostock/.block
LCSH Tag Network
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
stroke: #fff;
stroke-width: 1.5px;
}
.link {
@jrladd
jrladd / README.md
Last active September 8, 2016 20:47
Spenser's Color Wheel

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.

@jrladd
jrladd / README.md
Last active September 7, 2016 16:12
Miscellany network

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

@jrladd
jrladd / eikon.py
Created February 3, 2016 19:07
Find doubles in Eikon Basilike
#! /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')