Skip to content

Instantly share code, notes, and snippets.

@vlandham
vlandham / vis.coffee
Created August 17, 2012 01:34
Example of using different grouping mechanism
root = exports ? this
# Help with the placement of nodes
RadialPlacement = () ->
# stores the key -> location values
values = d3.map()
# how much to separate each location by
increment = 20
# how large to make the layout
radius = 200
@vlandham
vlandham / console_2_json.js
Created August 21, 2012 18:38
Output Javascript variable from console to json
console.log(JSON.stringify(object_or_function));
@vlandham
vlandham / _.md
Created September 12, 2012 14:34 — forked from enjalot/_.md
just another inlet to tributary
@vlandham
vlandham / _.md
Created September 12, 2012 14:34 — forked from enjalot/_.md
just another inlet to tributary
@vlandham
vlandham / bind_vis.coffee
Created October 1, 2012 13:58
Network visualization with two searches
$(".search").keyup () ->
# get which search form is being used
search_id = d3.select(this).attr("id").replace("_search", "")
searchTerm = $(this).val()
myNetwork.updateSearch(searchTerm, search_id)
@vlandham
vlandham / index.html
Created October 3, 2012 21:32
adding an info div to network visualization
<div id="main" role="main">
<div id="vis"></div>
<div id="info"></div>
</div>
@vlandham
vlandham / geodesic.js
Created October 12, 2012 15:50 — forked from mbostock/.block
Geodesic Grid
(function() {
var φ = 1.618033988749895,
ρ = 180 / Math.PI;
var vertices = [
[1,φ,0], [-1,φ,0], [1,-φ,0], [-1,-φ,0],
[0,1,φ], [0,-1,φ], [0,1,-φ], [0,-1,-φ],
[φ,0,1], [-φ,0,1], [φ,0,-1], [-φ,0,-1]
];
@vlandham
vlandham / scrape.js
Created November 1, 2012 17:21
javascript scraping tips
// local storage from
// http://macwright.org/2012/09/06/scrapers.html
var laws = localStorage.getItem('laws');
if (laws) { laws = JSON.parse(laws);
} else { laws = []; }
laws.push({ title: 'New!' });
localStorage.setItem('laws', JSON.stringify(laws));
@vlandham
vlandham / index.html
Created November 7, 2012 01:22 — forked from mbostock/.block
move letters
<!DOCTYPE html>
<meta charset="utf-8">
<style>
text {
font: bold 100px monospace;
cursor: move;
}
.enter {
@vlandham
vlandham / index.html
Created November 29, 2012 03:01 — forked from mbostock/.block
Satellite Projection
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.graticule {
fill: none;
stroke: #777;
}
.boundary {