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
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 / 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 / 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 / .block
Created April 23, 2017 17:08 — forked from mbostock/.block
Radial Tidy Tree
license: gpl-3.0
border: no
height: 1060
@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 / protips.js
Created August 11, 2017 18:21 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@owendall
owendall / Tooltip Test
Last active September 1, 2017 18:23 — forked from sirahd/.block
Vega-lite Scatterplot with Tooltip
A vega-lite scatterplot example for vega-tooltip. You can specify the limited sets of field to display in tooltip by setting `showAllFields` to false, then specify those in `fields` array. You can also rename the field by specifying `title`
@owendall
owendall / .block
Created September 5, 2017 23:05 — forked from domoritz/.block
Vega-Lite block example
license: bsd-3-clause
@owendall
owendall / d3.sankey.js
Created September 10, 2017 01:49 — forked from emeeks/d3.sankey.js
Sankey Particles
d3.sankey = function() {
var sankey = {},
nodeWidth = 24,
nodePadding = 8,
size = [1, 1],
nodes = [],
links = [];
sankey.nodeWidth = function(_) {
if (!arguments.length) return nodeWidth;
@owendall
owendall / .block
Created September 10, 2017 02:08 — forked from micahstubbs/.block
Sankey Particles | d3v4 & es2015+
border: no
license: Apache-2.0