Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🏠

Davo Galavotti davo

🏠
View GitHub Profile
@davo
davo / data.tsv
Created November 23, 2012 17:15 — forked from mbostock/.block
Multi-Series Line Chart
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 6 columns, instead of 5. in line 1.
Indicators Government Companies Total Difference Ratio Number of individual payments
87,658 43,160 131,488 44,498 0.4
@davo
davo / flare.json
Created December 1, 2012 22:58 — forked from mbostock/.block
Arbol para 50% / 2030
{
"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;
@davo
davo / README.md
Created December 6, 2012 14:58 — forked from mbostock/.block
Stacked-to-Grouped Transition

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.

@davo
davo / README.md
Created December 18, 2012 14:13 — forked from mbostock/.block

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.

@davo
davo / README.mkd
Created December 18, 2012 17:55 — forked from mbostock/README.md

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.

@davo
davo / index.html
Created December 18, 2012 17:55 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<title>Polar Clock</title>
<style>
#clock {
position: relative;
background: #222;
width: 960px;
height: 500px;
@davo
davo / README.md
Created December 21, 2012 20:44 — forked from mbostock/.block
@davo
davo / index.html
Created December 21, 2012 23:28 — forked from mbostock/.block
<!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{