Skip to content

Instantly share code, notes, and snippets.

View owendall's full-sized avatar

Owen Dall Sotomayor owendall

View GitHub Profile
@owendall
owendall / README.md
Last active May 14, 2017 14:08
Sankey Transitions
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r67/three.min.js"></script>
<script src="http://www.billdwhite.com/wordpress/wp-content/js/threejs/examples/js/controls/TrackballControls.js"></script>
<script src="http://www.billdwhite.com/wordpress/wp-content/js/threejs/examples/js/controls/OrbitControls.js"></script>
<script src="http://www.billdwhite.com/wordpress/wp-content/js/threejs/examples/js/renderers/CanvasRenderer.js"></script>
<script src="http://www.billdwhite.com/wordpress/wp-content/js/threejs/examples/js/controls/TrackballControls.js"></script>
@owendall
owendall / Animated d3 word cloud
Last active April 24, 2017 21:20 — forked from joews/README.md
Animated d3 word cloud
# d3 cloud example
An example of how to animate a [d3-cloud](https://github.com/jasondavies/d3-cloud) word cloud.
Based on https://github.com/jasondavies/d3-cloud/blob/master/examples/simple.html.
@owendall
owendall / .block
Created April 23, 2017 17:08 — forked from mbostock/.block
Radial Tidy Tree
license: gpl-3.0
border: no
height: 1060
@owendall
owendall / Zoomable Sunburst
Last active April 21, 2017 18:00 — forked from mbostock/.block
Zoomable Sunburst
Click on any arc to zoom in. Click on the center circle to zoom out.
A sunburst is similar to a treemap, except it uses a radial layout. The root node of the tree is at the center, with leaves on the circumference. The area (or angle, depending on implementation) of each arc corresponds to its value. Sunburst design by [John Stasko](http://www.cc.gatech.edu/gvu/ii/sunburst/). Data courtesy [Jeff Heer](http://flare.prefuse.org/).
@owendall
owendall / Zoomable sunburst with updating data
Last active April 21, 2017 18:01 — forked from kerryrodden/README.md
Zoomable sunburst with updating data
I combined Mike Bostock's [Zoomable Sunburst](http://bl.ocks.org/mbostock/4348373) and [Sunburst Partition](http://bl.ocks.org/mbostock/4063423) examples, so that I could have both zooming and updating the underlying data (between count and size, in this case). A simple combination of the examples does not work; you have to edit the arcTween function used for updating the data, so that when it redraws the partition layout, it takes account of the current zoom level by adjusting the domain of the x scale.
Click on any arc to zoom in, and click on the center circle to zoom out. Use the Size/Count radio buttons to update the data.
@owendall
owendall / README.md
Created April 13, 2017 19:17 — forked from christophermanning/README.md
Spherical Force-Directed Layout

Created by Christopher Manning

Summary

Draws a force directed graph using svg:path and geo projections onto a sphere.

TODO

@owendall
owendall / Force-Directed Web Worker
Last active April 21, 2017 17:57 — forked from mbostock/.block
Force-Directed Web Worker
license: gpl-3.0
height: 960
@owendall
owendall / README.md
Last active April 21, 2017 17:58 — forked from mbostock/.block
Sticky Force Layout

This example demonstrates how to prevent D3’s force layout from moving nodes that have been repositioned by the user. When the force layout’s drag behavior dispatches a dragstart event, the fixed property of the dragged node is set to true. This prevents the force layout from subsequently changing the position of the node (due to forces). Double-click to release a node.

Internally, the force layout uses three bits to control whether a node is fixed. The first bit can be set externally, as in this example. The second and third bits are set on mouseover and mousedown, respectively, so that nodes are fixed temporarily during dragging. Although the second and third bits are automatically cleared when dragging ends, the first bit stays true in this example, and thus nodes remain fixed after dragging.

Also note that the force layout resumes au

@owendall
owendall / README.md
Last active April 21, 2017 17:59 — forked from mbostock/.block
Sticky Force Layout

This example demonstrates how to prevent D3’s force layout from moving nodes that have been repositioned by the user. When the force layout’s drag behavior dispatches a dragstart event, the fixed property of the dragged node is set to true. This prevents the force layout from subsequently changing the position of the node (due to forces). Double-click to release a node.

Internally, the force layout uses three bits to control whether a node is fixed. The first bit can be set externally, as in this example. The second and third bits are set on mouseover and mousedown, respectively, so that nodes are fixed temporarily during dragging. Although the second and third bits are automatically cleared when dragging ends, the first bit stays true in this example, and thus nodes remain fixed after dragging.

Also note that the force layout resumes au