Skip to content

Instantly share code, notes, and snippets.

@1wheel
1wheel / README.md
Last active December 21, 2015 09:29 — forked from mbostock/.block
@1wheel
1wheel / README.md
Created August 20, 2013 18:57 — forked from mbostock/.block
@1wheel
1wheel / README.md
Last active August 22, 2016 02:18 — forked from mbostock/README.md
underscore-d3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@1wheel
1wheel / README.md
Created June 26, 2013 05:39 — forked from mbostock/.block
@1wheel
1wheel / README.md
Last active December 18, 2015 11:38 — forked from mbostock/.block

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.

@1wheel
1wheel / README.md
Last active December 17, 2015 20:09 — forked from mbostock/.block

This choropleth encodes unemployment rates from 2008 with a quantize scale ranging from 0 to 15%. A threshold scale is a useful alternative for coloring arbitrary ranges.

@1wheel
1wheel / index.html
Last active July 27, 2016 04:16 — forked from umcrcooke/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<head>
</head>
<style>
.q0-11 {fill: rgb(215, 48, 39);}
.q1-11 {fill: rgb(244, 109, 67);}
.q2-11 {fill: rgb(253, 174, 97);}
.q3-11 {fill: rgb(254, 224, 144);}
@1wheel
1wheel / FetchTrackAndAnalysisData.js
Created April 15, 2012 04:36 — forked from plamere/FetchTrackAndAnalysisData.js
Syncing Echo Nest analysis to Spotify playback
function fetchSongInfo(track) {
info('Getting song info for ' + track.name + ' by ' + track.artists[0].name);
var url = 'http://developer.echonest.com/api/v4/track/profile?api_key=N6E4NIOVYMTHNDM8J&callback=?';
var track_id = fromSpotify(track.uri);
$.getJSON(url, { id: track_id, format:'jsonp', bucket : 'audio_summary'}, function(data) {
if (checkResponse(data)) {
info("");
showTrackInfo(data.response.track);
fetchAnalysis(data.response.track);