forked from danielatkin's block: Interactive Bubble Chart
license: gpl-3.0 |
license: mit |
license: cc-by-sa-4.0 |
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
Correlogram, somewhat mimmicking those produced by R package corrgram. Generated to answer this StackOverflow question: http://stackoverflow.com/questions/34525173/how-to-create-correlogram-using-d3-as-in-the-example-picture/34539194#34539194
Press any letter on the keyboard.
Updated version of this example which renders it all in one svg. For this stackoverflow question.
<!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 |
Scatter plot that abuses the packed circle layout. Created for this StackOverflow question.