Skip to content

Instantly share code, notes, and snippets.

View owendall's full-sized avatar

Owen Dall Sotomayor owendall

View GitHub Profile
@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

@owendall
owendall / .block
Created February 19, 2017 17:40 — forked from mbostock/.block
Static Force Layout
license: gpl-3.0
@owendall
owendall / d3-wordcloud-2
Last active January 5, 2017 17:22 — forked from ericcoopey/README.md
D3 Word Cloud implementation
Word cloud implementation.
Example of how to
1. Change style from default. Uses linear scale
2. Alter word size
3. "Fit" it into the screen. At first the words were appearing out of view to the left.
@owendall
owendall / PCoA.tsv
Created January 4, 2017 03:46 — forked from laceysanderson/PCoA.tsv
PCoA Plot
name p1 p2 p3 p4 p5 p6
Rose Reber 0.626 1.016 2.195 -1.662 -0.533 1.256
Pansy Paisley -1.026 -0.272 2.083 0.688 -1.270 -1.770
Nathaniel Nace -0.182 3.786 2.599 -1.688 1.442 -0.679
Leon Leblanc 2.522 4.166 -1.782 3.723 1.867 1.240
Verla Vanish 1.997 3.576 -1.288 1.729 0.731 0.310
Shona Sigmon 1.960 3.719 -1.421 1.785 0.777 0.265
Columbus Cartee 2.057 3.908 -2.608 3.596 2.256 1.528
Sunni Stalzer -2.481 -2.642 0.234 1.690 1.484 0.501
Wes Wahl 2.487 3.942 -1.664 3.296 2.371 1.096
@owendall
owendall / curl.md
Created December 20, 2016 15:30 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');