Skip to content

Instantly share code, notes, and snippets.

@larsenmtl
larsenmtl / README.md
Last active August 29, 2015 14:13
d3.js Packed Circle Scatter Plot
@larsenmtl
larsenmtl / index.html
Created February 24, 2015 20:44
d3 scatterplot with tooltip mouseover
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<script>
// data that you want to plot, I've used separate arrays for x and y values
@larsenmtl
larsenmtl / README.md
Last active January 13, 2016 18:10
Letter Spitter

Press any letter on the keyboard.

@larsenmtl
larsenmtl / README.md
Created May 1, 2016 20:29
d3 Force Layout Bound to N Sided Random Polygon

Originally coded for this Stackoverflow Question. First, it causes the force layout to converge on a different foci then the default width/2, height/2. The new foci should be the centroid of the triangle computed with this d3 helper method. Second, now that we are converging on the centroid of the polygon, our nodes our bound inside the polygon by calculating the intersections between lines drawn from the centroid to the node and the line of the edge of the polygon (intersection calculation from this question). No intersections on all sides means the circle is in the polygon, and an intersection on any edge means we need to bring the circle onto that edge.

Built with blockbuilder.org

@larsenmtl
larsenmtl / README.md
Created May 11, 2016 00:56
Interactive Bubble Chart
@larsenmtl
larsenmtl / .block
Created May 29, 2016 19:51
Choropleth with Pie Charts
license: gpl-3.0
@larsenmtl
larsenmtl / README.md
Created June 19, 2016 16:54
Cycle Diagram
@larsenmtl
larsenmtl / .block
Created July 30, 2016 17:03
Scatter Plot w/Histogram Axes
license: gpl-3.0
@larsenmtl
larsenmtl / .block
Created November 12, 2016 23:05
d3 - Condegram Spiral Plot
license: mit