Switch between stacked and grouped layouts using sequenced transitions! Animations preserve object constancy and allow the user to follow the data across views. Animation design by Heer and Robertson. Colors and data generation inspired by Byron and Wattenberg.
Indicators Government Companies Total Difference Ratio Number of individual payments | |
87,658 43,160 131,488 44,498 0.4 |
{ | |
"name": "51%2030", | |
"children": [ | |
{ | |
"name": "Accesible", | |
"children": [ | |
{ | |
"name": "Estacionar bicicletas es caro", "size": 1 | |
}, | |
{ |
(function(){d3.layout = {}; | |
// Implements hierarchical edge bundling using Holten's algorithm. For each | |
// input link, a path is computed that travels through the tree, up the parent | |
// hierarchy to the least common ancestor, and then back down to the destination | |
// node. Each path is simply an array of nodes. | |
d3.layout.bundle = function() { | |
return function(links) { | |
var paths = [], | |
i = -1, | |
n = links.length; |
The tick format provided by d3.time.scale is a multi-scale tick format, meaning that it formats times differently depending on the time. For example, the start of February is formatted as "February", while February second is formatted as "Feb 2". The format is implemented using an array of time formats, each with an associated filter. The first filter that returns true is used. (In the implementation below, the formats are processed in reverse order.) You can create your own custom multi-scale time format using the same technique with only a few lines of code.
This example is a simple loupe using Polymaps. Drag the center of the loupe to move it around, or drag the thick border to resize it. Loupes are normally used to magnify, showing focus and context, but in this example we're using it to show two different tilesets. You can enable magnification (or minification) using the zoomDelta
property.
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Polar Clock</title> | |
<style> | |
#clock { | |
position: relative; | |
background: #222; | |
width: 960px; | |
height: 500px; |
See discussion on Hacker News. Built with D3 and TopoJSON.
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Mercator Projection</title> | |
<style> | |
path { | |
fill: #ccc; | |
stroke: #fff; | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Easy earthquakes</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://libs.cartocdn.com/cartodb.js/v2/cartodb.js"></script> | |
<style type="text/css"> | |
body{ |