Skip to content

Instantly share code, notes, and snippets.

View jalapic's full-sized avatar

James Curley jalapic

View GitHub Profile
@jalapic
jalapic / .block
Last active December 26, 2016 03:33
Dice roll probabilities
license: mit
@jalapic
jalapic / README.md
Last active April 9, 2016 02:51
tickplot2
@jalapic
jalapic / tmp.R
Last active February 17, 2023 07:33
testing clickaction
library(randomNames)
library(networkD3)
library(igraph)
set.seed(3)
nl = 100
df = data.frame(source = randomNames(1000,which.names='both', name.order = 'first.last', name.sep=' '), target = '')
df = df[rep(seq_len(nrow(df)), sample(1:10,nrow(df), replace=T)),]
df = df[sample(nrow(df),nl),]
df$target = sample(df$source,nrow(df), replace = T)
#devtools::install_github('thomasp85/ggforce')
#devtools::install_github("dgrtwo/gganimate")
#devtools::install_github('thomasp85/ggraph')
#devtools::install_github("hadley/ggplot2")
library(ggraph)
library(ggforce)
library(gganimate)
library(ggplot2)
library(igraph)
#devtools::install_github('thomasp85/ggforce')
#devtools::install_github("dgrtwo/gganimate")
#devtools::install_github('thomasp85/ggraph')
#devtools::install_github("hadley/ggplot2")
library(ggraph)
library(ggforce)
library(gganimate)
library(ggplot2)
library(igraph)
@jalapic
jalapic / README.md
Created April 24, 2016 19:18
scatter_slope

This is a scatterplot that transforms into a slopechart. The code is entirely built by Gerado Furtado. See here for full example.


This example was made to use as a template to make other scatterplot/slopechart transitions.

Built with blockbuilder.org

@jalapic
jalapic / README.md
Created May 1, 2016 01:43
D3v4 Constraint-Based Layout

Organizing a network made of disconnected pieces like this one is improved by fixing those subgraphs into their own space on the canvas. A while back I showed how to do this using custom code in the tick() function of the D3v3 force layout as part of How to Create Effective Network Data Visualization.

Here's a much easier and cleaner way to do it using the new D3v4 force-layout by specifying a d3.forceY and d3.forceX that are associated with the node's module.

forked from emeeks's block: D3v4 Constraint-Based Layout

@jalapic
jalapic / README.md
Created May 11, 2016 01:20
chickens
@jalapic
jalapic / .block
Created May 11, 2016 02:13
Teaswarm
height: 500
border: yes