Skip to content

Instantly share code, notes, and snippets.

@larsenmtl
larsenmtl / .block
Created May 29, 2016 19:51
Choropleth with Pie Charts
license: gpl-3.0
@larsenmtl
larsenmtl / .block
Last active June 28, 2023 12:30
MathJax and d3
license: mit
@larsenmtl
larsenmtl / .block
Created May 21, 2016 16:57
Getting hover-interaction and brushing to co-exist
license: cc-by-sa-4.0
@larsenmtl
larsenmtl / README.md
Created May 11, 2016 00:56
Interactive Bubble Chart
@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
Last active May 20, 2018 21:53
d3 Correlogram
@larsenmtl
larsenmtl / README.md
Last active January 13, 2016 18:10
Letter Spitter

Press any letter on the keyboard.

@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 August 29, 2015 14:13
d3.js Packed Circle Scatter Plot