Skip to content

Instantly share code, notes, and snippets.

View emeeks's full-sized avatar

Elijah Meeks emeeks

View GitHub Profile
@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 / d3.layout.timeline.js
Last active March 11, 2024 01:28
d3.layout.timeline with dates
(function() {
d3.layout.timeline = function() {
var timelines = [];
var dateAccessor = function (d) {return new Date(d)};
var processedTimelines = [];
var startAccessor = function (d) {return d.start};
var endAccessor = function (d) {return d.end};
var size = [500,100];
var timelineExtent = [-Infinity, Infinity];
var setExtent = [];
@emeeks
emeeks / index.html
Last active February 6, 2024 09:02
Visualizing the PageRank Model
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Visualizing PageRank Centrality</title>
<meta charset="utf-8" />
</head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/colorbrewer.v1.min.js"></script>
<style>
svg {
@emeeks
emeeks / firm.csv
Last active September 25, 2023 09:15
Networks - Edges 1
source target weight
1 3 5
1 8 3
1 9 3
1 12 3
1 15 2
1 23 3
1 26 2
1 37 2
1 46 2
@emeeks
emeeks / firm.csv
Last active September 25, 2023 09:13
Networks - Graphs 6
1 3 5
1 8 3
1 9 3
1 12 3
1 15 2
1 23 3
1 26 2
1 37 2
1 46 2
@emeeks
emeeks / d3.sketchy.js
Last active July 20, 2023 17:19
Sketchy World
/*global d3:false */
/*jshint unused:false*/
/**
* Initiate the sketchy library
* @constructor
*/
var d3sketchy = function(){
/**
@emeeks
emeeks / d3.layout.timeline.js
Last active June 19, 2023 20:42
d3.layout.timeline categorized timelines
(function() {
d3.layout.timeline = function() {
var timelines = [];
var dateAccessor = function (d) {return new Date(d)};
var processedTimelines = [];
var startAccessor = function (d) {return d.start};
var endAccessor = function (d) {return d.end};
var size = [500,100];
var timelineExtent = [-Infinity, Infinity];
var setExtent = [];
@emeeks
emeeks / d3.sankey.js
Last active April 20, 2023 15:23
Sankey Particles III
d3.sankey = function() {
var sankey = {},
nodeWidth = 24,
nodePadding = 8,
size = [1, 1],
nodes = [],
links = [];
sankey.nodeWidth = function(_) {
if (!arguments.length) return nodeWidth;
@emeeks
emeeks / flare.json
Last active March 6, 2023 18:27
Simple Word Tree
{
"name": "Google",
"children": [
{
"name": "accounts but that",
"size": 1
},
{
"name": "advance search used to be better",
"size": 1
@emeeks
emeeks / .block
Last active February 9, 2023 10:48 — forked from mbostock/.block
Every ColorBrewer Scale
license: gpl-3.0