Skip to content

Instantly share code, notes, and snippets.

View emeeks's full-sized avatar

Elijah Meeks emeeks

View GitHub Profile
@emeeks
emeeks / append_force.js
Last active October 3, 2015 09:08
Force-Directed Layout with Append on Double-Click
function viz01() {
w = 960;
h = 600;
nodeHash = new Array();
var force = d3.layout.force()
.gravity(.05)
.distance(100)
@emeeks
emeeks / cartdat.json
Created April 22, 2012 16:41
Dynamic Distance Cartogram for ORBIS
[
{"name": "Adramyttium","scale": 80,"xcoord": 26.94,"ycoord": 39.5,"ws_rom": 17.91,"ss_rom": 18.58,"we_rom": 1.81,"se_rom": 2.01,"ws_con": 5.69,"ss_con": 6.29,"we_con": 0.66,"se_con": 0.95,"ws_lon": 58.78,"ss_lon": 44.48,"we_lon": 17.1,"se_lon": 5.43,"ws_ant": 8.76,"ss_ant": 8.12,"we_ant": 0.96,"se_ant": 0.9},
{"name": "Aeclanum","scale": 80,"xcoord": 15.01,"ycoord": 41.06,"ws_rom": 6.13,"ss_rom": 6.43,"we_rom": 3.44,"se_rom": 3.47,"ws_con": 22.57,"ss_con": 23.66,"we_con": 5.38,"se_con": 5.56,"ws_lon": 47,"ss_lon": 32.34,"we_lon": 18.73,"se_lon": 7.25,"ws_ant": 20.77,"ss_ant": 20.25,"we_ant": 5.19,"se_ant": 4.95},
{"name": "Aelana","scale": 80,"xcoord": 35,"ycoord": 29.53,"ws_rom": 32.21,"ss_rom": 36.11,"we_rom": 10.67,"se_rom": 11.06,"ws_con": 25.34,"ss_con": 29.49,"we_con": 9.98,"se_con": 10.61,"ws_lon": 73.08,"ss_lon": 61.65,"we_lon": 25.97,"se_lon": 14.49,"ws_ant": 15.7,"ss_ant": 15.81,"we_ant": 9.09,"se_ant": 9.1},
{"name": "Aequum Tuticum","scale": 70,"xcoord": 15.07,"ycoord": 41.26,"ws_rom": 6.35,"ss_
@emeeks
emeeks / read_mallet.php
Created August 8, 2012 21:39
Create Node and Edge Tables from MALLET Topic-Modeling Output
<?php
header("Content-type: text/html; charset=utf-8");
$link = mysql_connect("localhost","gephi","gephi");
mysql_select_db("dh_stanford");
mysql_set_charset('utf8');
echo ("Start-");
echo date(DATE_RFC822);
@emeeks
emeeks / d3.layout.cloud.js
Last active July 22, 2021 06:03
Topic Clouds using D3 Word Cloud Layout
// Word cloud layout by Jason Davies, http://www.jasondavies.com/word-cloud/
// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf
(function(exports) {
function cloud() {
var size = [256, 256],
text = cloudText,
font = cloudFont,
fontSize = cloudFontSize,
rotate = cloudRotate,
padding = cloudPadding,
@emeeks
emeeks / index.html
Last active April 27, 2017 09:00 — forked from anonymous/index.html
Parallel Coordinates wired to a map of routes from ORBIS
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Route Probability Exploration with Parallel Coordinates</title>
<style type="text/css">
svg {
font: 10px sans-serif;
}
@emeeks
emeeks / README.md
Last active December 10, 2015 21:48 — forked from syntagmatic/README.md
Yearly Parallel Coordinates
@emeeks
emeeks / README.md
Last active December 10, 2015 23:59 — forked from mbostock/.block
Projected Geodata with a Bounding Box Brush

Aitoff projection with a brush that logs the bounding corners in latlong for the brush area.

@emeeks
emeeks / index.html
Last active December 11, 2015 02:38
A satellite projection with a few interesting UI elements, as well as a simple geo-located bar chart.
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke-linejoin: round;
stroke-linecap: round;
}
@emeeks
emeeks / README.md
Last active March 25, 2024 07:56 — forked from mbostock/.block
An online tool for interactive teaching of network visualization and representation principles.

The range sliders at the top change the values for the force-directed algorithm and the buttons load new graphs and apply various techniques. This will hopefully serve as a tool for teaching network analysis and visualization principles during my Gephi courses and general Networks in the Humanities presentations.

Notice this includes a pretty straightforward way to load CSV node and edge lists as exported from Gephi.

It also includes a pathfinding algorithm built for the standard data structure of force-directed networks in D3. This requires the addition of .id attributes for the nodes, however.

Now with Clustering Coefficients!

Also, it loads images for nodes but the images are not in the gist. The code also refers to different network types but the data files on Gist only refer to the transportation network.

@emeeks
emeeks / city-topic-pct.csv
Last active December 12, 2015 03:38
Many, many pie charts
name habitat parks
Albuquerque 0.044 0.043
Atlanta 0.005 0.013
Austin 0.041 0.043
Baltimore 0.008 0.035
Charlotte 0.001 0.053
Chicago 0.02 0.029
Columbus 0.039 0.042
Dallas 0.022 0.055
Denver 0.012 0.064