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
Created June 3, 2016 01:22 — forked from nbremer/.block
Animated gradient - Simple rectangle
@davo
davo / README.md
Created June 1, 2016 13:25 — forked from christophermanning/README.md
Unknown Pleasures

Forked from Tom MacWright and updated by Christopher Manning

Summary

This adds simplex noise to the waves. The 3D noise uses the parameters x and y. z is a function of the velocity and frame from d3.timer.

Controls

  • Drag up and down to adjust the height of the noise
@davo
davo / README.md
Last active May 31, 2016 15:17 — forked from nbremer/.block
Data based gradients - HR Diagram

An example of creating data based gradients used in my blog on Data-based and unique gradients for visualizations with d3.js . Here each star has a unique radial gradient where the color is based on the effective temperature of the star.

This is a Hertzsprung–Russell diagram. In this diagram stars are plotted according to their luminosities (or the related absolute magnitudes) versus their effective temperatures (or related spectral classifications). Many interesting discoveries around stellar evolution were speculated from this chart even before much was known about what happens in the interior of stars by looking at the positions of stars on the diagram.

The data comes from the HYG database. I took a subset of 400 stars that lie relatively close.

The orange circle is where our own

@davo
davo / .block
Created May 26, 2016 17:14 — forked from tonyhschu/.block
Small Scroll-linked Animation Demo
scrolling: yes
license: MIT
@davo
davo / README.md
Last active August 29, 2015 14:27 — forked from jazzido/README.md
Diferencia porcentual votos positivos al FPV entre PASO 2011 y 2015 — Por provincia
@davo
davo / index.html
Last active August 29, 2015 14:26 — forked from mbostock/.block
Force-Directed Graph with Mouseover
<!DOCTYPE html>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<style>
.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
@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