Skip to content

Instantly share code, notes, and snippets.

View ericcoopey's full-sized avatar

Coopey ericcoopey

View GitHub Profile
@ericcoopey
ericcoopey / README.md
Last active July 15, 2018 23:49
D3 US Map with Hover

D3 US Map with Hover

Basic US map using D3 and topojson. Each state gets colored and neighbors should never be the same color. Also has some mousein/mouseout functions for highlighting the state your cursor is over

@ericcoopey
ericcoopey / README.md
Last active August 29, 2015 14:15
Directed Force Diagram - Social Network

A force diagram using a marker to indicate direction. Also demonstrates how to transform the path to have the lines arc.

This one represents a social network diagram. Relationship strength is encoded in the path length, with stronger relationships having shorter path lengths.

@ericcoopey
ericcoopey / README.md
Last active April 28, 2017 16:10
Animating Changes in Force Diagram

Demonstrates how to dynamically add and remove nodes to a force diagram. This was functionality that should seemingly be easy, but was surprisingly hard. Many people were asking how to do this in forums, and this final product is the amalgamation of several commenters half baked (but not really functioning) solutions.

This one demonstrates changes in a social network diagram as relationships are added, removed, and updated. Add nodes by name, add links complete with custom lengths.

Also shows how to add labels to a force diagram.

@ericcoopey
ericcoopey / README.md
Last active December 21, 2015 23:49
D3 Binary Sparkline

Binary (up/down) sparkline in D3

Simple but cool

@ericcoopey
ericcoopey / README.md
Last active January 28, 2022 02:32
D3 Word Cloud implementation

Word cloud implementation.

Example of how to

  1. Change style from default. Uses linear scale

  2. Alter word size

  3. "Fit" it into the screen. At first the words were appearing out of view to the left.

@ericcoopey
ericcoopey / README.md
Last active December 21, 2015 22:08
Matrix with Multi-Foci Force Graph

Using D3 to visualize commenting activity in a single depth threaded forum designed for education. Users can post a top level idea, respond to themself, or respond to others. Each Activity has a list of Prompts to respond to, and this gives the teacher a quick overview of user activity.

Demonstrates how to do several things in D3

  1. How to create a matrix
  2. Multi-Foci force graph, as found here, http://bl.ocks.org/mbostock/1021953
  3. Dynamic SVG size based on the size of the input