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
var m = [0, 120, 20, 320], | |
w = 1280 - m[1] - m[3], | |
h = 800 - m[0] - m[2], | |
i = 0, | |
root; | |
var tree = d3.layout.tree() | |
.size([h, w]); | |
var diagonal = d3.svg.diagonal() |
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
//JSON object with the data | |
var treeData = {"name" : "A", "info" : "tst", "children" : [ | |
{"name" : "A1" }, | |
{"name" : "A2" }, | |
{"name" : "A3", "children": [ | |
{"name" : "A31", "children" :[ | |
{"name" : "A311" }, | |
{"name" : "A312" } | |
]}] } | |
]}; |
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
/** | |
* cubeD3 Create a rotating cube with D3.js: | |
* | |
* @param id div id tag starting with # | |
* @param width width of the grid in pixels | |
* @param height height of the grid in pixels | |
* @param square | |
*/ | |
function cubeD3(id, width, height) | |
{ |
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
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<title>Creating SVG groups with D3.js</title> | |
</head> | |
<body> | |
<div id="d3group"></div> | |
<script type="text/javascript"> |
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
//based on blog post that I saw here: http://www.sanraul.com/2010/08/01/implementing-doubletap-on-iphones-and-ipads/ | |
(function($){ | |
$.fn.doubletap = function(fn) { | |
return fn ? this.bind('doubletap', fn) : this.trigger('doubletap'); | |
}; | |
$.attrFn.doubletap = true; | |
$.event.special.doubletap = { | |
setup: function(data, namespaces){ |
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
<script type='text/javascript' src='http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js'></script> | |
<script type="text/javascript"> | |
//var _DEBUG = false; | |
var PLAY_FIELD = [800, 600, 800]; | |
var SCREEN_DEPTH = 300; // Distance from the "eye" to the screen. | |
var EYE = [400, 300]; | |
var LIGHT_SOURCE = [0, 0, 200]; | |
var REFRESH_RATE = (1 / 30) * 1000; |
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 charset="utf-8" /> | |
</head> | |
<body> | |
<script> | |
var source = new EventSource('/events'); | |
source.onmessage = function(e) { | |
document.body.innerHTML += e.data + '<br>'; |
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
body { | |
font-family: Helvetica, Verdana | |
} | |
p { | |
padding: 7px 10px; | |
} | |
#demo { | |
border: 1px solid #999; | |
} |
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
{"nodes":[{"name":"Myriel","group":1},{"name":"Napoleon","group":1},{"name":"Mlle.Baptistine","group":1},{"name":"Mme.Magloire","group":1},{"name":"CountessdeLo","group":1},{"name":"Geborand","group":1},{"name":"Champtercier","group":1},{"name":"Cravatte","group":1},{"name":"Count","group":1},{"name":"OldMan","group":1},{"name":"Labarre","group":2},{"name":"Valjean","group":2},{"name":"Marguerite","group":3},{"name":"Mme.deR","group":2},{"name":"Isabeau","group":2},{"name":"Gervais","group":2},{"name":"Tholomyes","group":3},{"name":"Listolier","group":3},{"name":"Fameuil","group":3},{"name":"Blacheville","group":3},{"name":"Favourite","group":3},{"name":"Dahlia","group":3},{"name":"Zephine","group":3},{"name":"Fantine","group":3},{"name":"Mme.Thenardier","group":4},{"name":"Thenardier","group":4},{"name":"Cosette","group":5},{"name":"Javert","group":4},{"name":"Fauchelevent","group":0},{"name":"Bamatabois","group":2},{"name":"Perpetue","group":3},{"name":"Simplice","group":2},{"name":"Scaufflaire","group":2}, |
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
nimes_assoc.csv |