Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🦮
Golden

Davo Galavotti davo

🦮
Golden
View GitHub Profile
@davo
davo / README.md
Last active August 29, 2015 14:25 — forked from mbostock/.block
Multi-Foci Force Layout

Click to perturb or drag the nodes!

This example demonstrates the flexibility of D3's force layout. By using position Verlet integration, it is easy to add custom forces to a layout. In this example, the nodes are clustered around four foci using additional forces: the odd nodes are pushed down, the even nodes are pushed up, and a similar bisecting force is applied laterally. These custom forces are based purely on the index of the node, but they could just as easily be derived from properties of data!

@davo
davo / README.md
Last active August 29, 2015 14:25 — forked from mbostock/.block
Build Your Own Graph!

Click to add nodes! Nodes near the cursor will be linked to the new node.

D3's force layout uses the Barnes–Hut approximation to compute repulsive charge forces between all nodes efficiently. Links are implemented as geometric constraints on top of position Verlet integration, offering greater stability. A virtual spring between each node and the center of the chart prevents nodes from drifting into space.

@davo
davo / index.html
Last active August 29, 2015 14:25 — forked from nbremer/README.md
Gooey Effect - Line
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/ >
<title>Gooey effect - Line</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
@davo
davo / README.md
Last active August 29, 2015 14:14 — forked from mbostock/.block
  1. If you haven’t already: brew install ffmpeg gifsicle imagemagick.
  2. Open QuickTime Player.
  3. File > New Screen Recording.
  4. Record.
  5. Save as recording.mov.
  6. mkdir frames
  7. ffmpeg -i recording.mov -r 24 recording-%03d.png
  8. convert recording-001.png palette.gif
  9. convert -dither none -remap palette.gif recording-*.png recording-uncompressed.gif
  10. gifsicle --optimize=3 --delay=4 &lt; recording-uncompressed.gif &gt; recording.gif
@davo
davo / README.md
Created August 7, 2014 17:48 — forked from madelfio/README.md

Shows multiple overlaid Voronoi diagrams, given multiple point sets.

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'>
@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.

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 / 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>
@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