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.
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); |
<!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);} |
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.
Part of a series of examples. See:
This simple line chart is constructed from a TSV file storing the closing value of AAPL stock over the last few years. The chart employs conventional margins and a number of D3 features:
- d3.tsv - load and parse data
- d3.time.format - parse dates
- d3.time.scale - x-position encoding
- d3.scale.linear - y-position encoding
- d3.extent - compute domains
- d3.svg.axis - display axes
- d3.svg.line - display line shape
This simple line chart is constructed from a TSV file storing the closing value of AAPL stock over the last few years. The chart employs conventional margins and a number of D3 features:
- d3.tsv - load and parse data
- d3.time.format - parse dates
- d3.time.scale - x-position encoding
- d3.scale.linear - y-position encoding
- d3.extent - compute domains
- d3.svg.axis - display axes
- d3.svg.line - display line shape
This simple line chart is constructed from a TSV file storing the closing value of AAPL stock over the last few years. The chart employs conventional margins and a number of D3 features:
- d3.tsv - load and parse data
- d3.time.format - parse dates
- d3.time.scale - x-position encoding
- d3.scale.linear - y-position encoding
- d3.extent - compute domains
- d3.svg.axis - display axes
- d3.svg.line - display line shape
An example of d3.behavior.zoom and d3.geo.path. By modifying the transform, the browser can rapidly redraw geographic features while panning and zooming, without the overhead of reprojection. This technique can be extended by combining with d3.geo.tile.