Skip to content

Instantly share code, notes, and snippets.

View sivartravis's full-sized avatar

Travis Taylor sivartravis

  • Cambridge, MA
View GitHub Profile
@sivartravis
sivartravis / README.md
Created February 25, 2016 21:11 — forked from curran/README.md
Stacked Bars
@sivartravis
sivartravis / README.md
Created February 25, 2016 21:10 — forked from curran/README.md
Lynchings by State Donut Charts
@sivartravis
sivartravis / README.md
Created February 25, 2016 21:09 — forked from eesur/README.md
d3 | reusable slopegraph v2

Updated reusable slopegraph sketch, from my previous slopegraph version

This version allows for multiple sets/columns and will adapted accordingly. Added some interaction to toggle the sets/columns and also toggle highlighted line.

data source

@sivartravis
sivartravis / animate.R
Created February 25, 2016 21:08 — forked from thomasp85/animate.R
Animating graph over time
library(ggraph)
library(gganimate)
library(igraph)
# Data from http://konect.uni-koblenz.de/networks/sociopatterns-infectious
infect <- read.table('out.sociopatterns-infectious', skip = 2, sep = ' ', stringsAsFactors = FALSE)
infect$V3 <- NULL
names(infect) <- c('from', 'to', 'time')
infect$timebins <- as.numeric(cut(infect$time, breaks = 100))
# We want that nice fading effect so we need to add extra data for the trailing
@sivartravis
sivartravis / horizon plot.r
Created February 25, 2016 21:04 — forked from timelyportfolio/horizon plot.r
R Horizon Chart
require(lattice)
require(latticeExtra)
require(reshape2)
require(quantmod)
#set up horizon plots as a function
horizonplot <- function(prices,horizon.type="offset",scale=0.05,title=NA,alpha=0.4){
#get change in prices since beginning or 1st row
prices.change <- prices[,4]/as.numeric(prices[1,4])-1
#get as a data.frame so it will work well with melt and lattice
#should have known R already has horizon plot functionality
#latticeExtra (already a favorite package of mine) has it sitting right there
#http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=latticeExtra:horizonplot
require(lattice)
require(latticeExtra)
require(reshape2)
require(quantmod)
@sivartravis
sivartravis / .block
Created February 2, 2016 21:47
Sized Donut Multiples
scrolling: yes
@sivartravis
sivartravis / README.md
Created February 2, 2016 21:46
Marey’s Trains II
@sivartravis
sivartravis / README.md
Created February 2, 2016 21:45
D3 Show Reel

The first 15 seconds of the D3 show reel. See full video at http://vimeo.com/29862153. Includes seamless transitions between the following visualization types:

  • lines
  • horizons
  • areas
  • stacked areas
  • streamgraph
  • overlapping areas
  • grouped bars
  • stacked bars
@sivartravis
sivartravis / .gitignore
Created February 2, 2016 21:44
State Icons
.DS_Store
build
node_modules