[ Launch: optical_illusion_001_motion2 ] 6084524 by nsonnad[ Launch: optical_illusion_001_motion2 ] 5968492 by zeffii[ Launch: optical_illusion_001_motion ] 5892162 by zeffii[ Launch: optical_illusion_001 ] 5891299 by zeffii[ Launch: zeffii default ] 5891190 by zeffii[ Launch: zeffii default ] 5033869 by zeffii
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
categories = ["funny", "stupid", "sad", "embarassing"]; | |
tabData = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]; | |
mapped = categories.map(function(cat) { | |
return tabData.map(function(d) { | |
return { | |
name: cat, value: d[categories.indexOf(cat)] | |
}; | |
}); | |
}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Text bbox issue</title> | |
</head> | |
<style type="text/css" media="screen"> | |
@import url(http://fonts.googleapis.com/css?family=Cutive); | |
svg text { |
Simple change to Mike Bostock's force-directed graph, adding colors to links.
This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.
[ Launch: pi man ] 5942244 by nsonnad[ Launch: pi man ] 5942016 by enjalot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Force-Directed Layout (Multiple Foci)</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> |
Mouseover to repel nodes. Adapted from my talk on force layouts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
force.on("tick", function(e) { | |
// Push nodes toward their designated focus. | |
var k = .1 * e.alpha; | |
nodes.forEach(function(o, i) { | |
o.y += (foci[o.id].y - o.y) * k; | |
o.x += (foci[o.id].x - o.x) * k; | |
}); | |
vis.selectAll("circle.node") |
[ Launch: Tributary inlet ] 5822060 by nsonnad