Skip to content

Instantly share code, notes, and snippets.

@vlandham
vlandham / vis.coffee
Created Aug 17, 2012
Example of using different grouping mechanism
View vis.coffee
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 Aug 21, 2012
Output Javascript variable from console to json
View console_2_json.js
console.log(JSON.stringify(object_or_function));
@vlandham
vlandham / _.md
Created Sep 12, 2012 — forked from enjalot/_.md
just another inlet to tributary
@vlandham
vlandham / _.md
Created Sep 12, 2012 — forked from enjalot/_.md
just another inlet to tributary
@vlandham
vlandham / bind_vis.coffee
Created Oct 1, 2012
Network visualization with two searches
View bind_vis.coffee
$(".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 Oct 3, 2012
adding an info div to network visualization
View index.html
<div id="main" role="main">
<div id="vis"></div>
<div id="info"></div>
</div>
@vlandham
vlandham / geodesic.js
Created Oct 12, 2012 — forked from mbostock/.block
Geodesic Grid
View geodesic.js
(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 Nov 1, 2012
javascript scraping tips
View scrape.js
// 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 Nov 7, 2012 — forked from mbostock/.block
move letters
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
text {
font: bold 100px monospace;
cursor: move;
}
.enter {
@vlandham
vlandham / index.html
Created Nov 29, 2012 — forked from mbostock/.block
Satellite Projection
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.graticule {
fill: none;
stroke: #777;
}
.boundary {