View this code at http://livecoding.io/5708772
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
void require('http://d3js.org/d3.v3.min.js'); | |
// An introduction to d3js scales | |
// | |
// scales are transformations from an input | |
// domains to output ranges. you use them for | |
// transforming your input data into your output | |
// representation: $1B in the stock market might | |
// mean 200px on a laptop screen, and so on. |
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 pre = '<pre>*</pre>'; | |
var txt = ''; | |
var chars = ' xx xxx 0000000000005550'; | |
window.setInterval(function() { | |
var txt = ''; | |
var c = chars.split(''); | |
var l = c.pop(); | |
chars = [l].concat(c).join('') |
Welcome to OpenStreetMap, the world's open-source map.
You've just joined a community of over one million contributors who are creating a free, worldwide map.
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
// Types | |
var one = 1; | |
var two = 2; | |
// three; | |
window.three; | |
window.one = 1; | |
one = 1; | |
var one = []; | |
var one = {one: 1}; | |
one.two = 1; |
Demonstrating jenks natural breaks implemented in simple-statistics.
Rendered by d3js, based on an example by Mike Bostock.
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> | |
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } | |
#map-ui { | |
position:absolute; |
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> | |
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } | |
</style> | |
</head> |
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
$(layer).click(function(e) { | |
$.each(map.layers, function(l) { | |
l.disable(); | |
}); | |
map.enableLayer(i); | |
$(this).addClass('active'); | |
}); |
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> | |
<meta charset="utf-8"> | |
<title>SVG Swarm</title> | |
<style> | |
svg { | |
position: absolute; | |
top: 0; | |
} |