Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🏠

Davo Galavotti davo

🏠
View GitHub Profile
@davo
davo / README.md
Last active December 14, 2015 00:38 — forked from mbostock/.block

Example

@davo
davo / README.md
Created February 20, 2013 21:59 — forked from mbostock/.block

This diagram shows the distribution of age groups in the United States over the last 150 years. Use the arrow keys to observe the changing population. Data from the Minnesota Population Center. Use the arrow keys to change the displayed year. The blue bars are the male population for each five-year age bracket, while the pink bars are the female population; the bars are partially transparent so that you can see how they overlap, unlike the traditional side-by-side display which makes it difficult to compare the relative distribution of the sexes.

The Issue

I'm trying to build a map that can be zoomed using the mouse wheel and panned with drag. For that I'm using d3.behavior.zoom() and it works fine for the map. However, I also need to mark some points in the map (which are included in the same topojson used to draw the map). They get rendered just fine, but I'm having trouble handling the zoom behaviour with these points. If you try to zoom or pan, the points get translated abruptly and even seem to change their path!

Any ideas?

@davo
davo / graph.json
Created March 20, 2013 14:10 — forked from mbostock/.block
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@davo
davo / README.md
Last active December 15, 2015 15:39 — forked from nsonnad/.block
Object constancy with multiple sets of time-series (update)

Forked from the work of Nikhil Sonnad, called Object constancy with multiple sets of time-series

Add support for JSON and data binding with Knockout.js (it needs improvement).

Original README.md

This chart compares the BRIC countries (Brazil, Russia, India and China) with a new group of upstarts, MIST (Mexico, Indonesia, South Korea, Turkey). The data are from the World Bank. It was my attempt to achieve object constancy for multiple sets of time series data. I used d3.nest() to sort one big CSV file based on each economic indicator, then used d3.key() on the header row (the countries) to make ensure constancy. Check the boxes at the top to highlight the country groups. An interpretation of this visual can be found on my website.

@davo
davo / arboles.csv
Last active December 31, 2015 23:29 — forked from billdwhite/index.html
nombre_familia nombre_comun cant
Aceráceas Arce negundo 6651
Aceráceas Arce tridente 690
Aceráceas Arce 144
Aceráceas Arce campestre (Arce común o Arce menor) 116
Aceráceas Arce real 29
Aceráceas Arce blanco 17
Adoxaceae Sauco austral 3
Agavaceae Yuca 9
Anacardiáceas Aguaribay 98
@davo
davo / index.html
Created January 13, 2014 17:38 — forked from aaizemberg/index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset=utf-8 />
<title>puntos</title>
</head>
<body>
<button id="up" type="button">Up</button>
<button id="down" type="button">Down</button>

A demonstration of how to calculate the areas of Voronoi regions clipped by geographic features using D3.

[D3’s implementation](Sutherland–Hodgman algorithm) of the Sutherland–Hodgman algorithm only works for convex clip polygons, but we exploit the fact that Voronoi regions are guaranteed to be convex, and use each Voronoi region as a clip polygon, with the projected geographic boundary as a subject polygon.

In response to a question by Gonzalo Bellver.

@davo
davo / README.md
Last active August 29, 2015 14:01 — forked from jasondavies/README.md
Voronoi CABA

A demonstration of how to calculate the areas of Voronoi regions clipped by geographic features using D3.

[D3’s implementation](Sutherland–Hodgman algorithm) of the Sutherland–Hodgman algorithm only works for convex clip polygons, but we exploit the fact that Voronoi regions are guaranteed to be convex, and use each Voronoi region as a clip polygon, with the projected geographic boundary as a subject polygon.

In response to a question by Gonzalo Bellver.

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>