Skip to content

Instantly share code, notes, and snippets.

View wboykinm's full-sized avatar

Bill Morris wboykinm

View GitHub Profile
@wboykinm
wboykinm / README.md
Last active August 29, 2015 13:57 — forked from milroc/README.md
-- SELECT Faraday_JoyDivision('households'::text, 'year_built'::text) AS the_geom
explain analyze WITH
-- Snap the disparate points to a regular grid where theres data for the given filter
grid AS (
SELECT
-- note transform here
ST_SnapToGrid(ST_Transform(wkb_geometry, 4326), 0.002) the_geom,
year_built

This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.

@wboykinm
wboykinm / README.md
Last active August 29, 2015 13:57 — forked from mbostock/.block

This grouped bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:

var data = [{
date: new Date("Jan 01, 2013"),
data: 12
},{
date: new Date("Jan 02, 2013"),
data: 17
},{
date: new Date("Jan 03, 2013"),
data: 5
},{
@wboykinm
wboykinm / RadarChart.js
Last active August 29, 2015 14:04 — forked from nbremer/.block
//Practically all this code comes from https://github.com/alangrafu/radar-chart-d3
//I only made some additions and aesthetic adjustments to make the chart look better
//(of course, that is only my point of view)
//Such as a better placement of the titles at each line end,
//adding numbers that reflect what each circular level stands for
//Not placing the last level and slight differences in color
//
//For a bit of extra information check the blog about it:
//http://nbremer.blogspot.nl/2013/09/making-d3-radar-chart-look-bit-better.html
@wboykinm
wboykinm / README.md
Last active August 29, 2015 14:06 — forked from mbostock/.block
Paletted Spanning Tree using Wilson's Algorithm

Adapted from Mike Bostock's example (detailed below) by Tristan Davies and Andy Rossmeissl to cycle through a set of defined colors instead of a mathematically-generated rainbow. Particularly nice with divergent palettes, we recommend you try chroma.js to populate the colors array in index.html.

Original notes: A spanning tree of the canvas is generated using Wilson’s algorithm and then flooded with color. Hue encodes Manhattan distance from the root of the tree. (This is not an optimal visual encoding, but it suffices and is pretty.)

_Spanning trees can also be used to generate mazes. See a maze generated with Wilson’s algorithm flooded with color, and compare color floods of spanning trees generate

@wboykinm
wboykinm / README.md
Last active August 29, 2015 14:06 — forked from mbostock/.block

This stylized globe uses D3’s in-development geometry pipeline to jitter points before rendering. Points are sampled along great arcs, jittered, and then smoothed using basis-spline interpolation to achieve a hand-drawn effect. The resulting spherical geometry is computed once, allowing faster rendering with arbitrary rotation!

This techinque was developed in collaboration with Derek Watkins for Norway the Slow Way.

@wboykinm
wboykinm / index.html
Last active August 29, 2015 14:07 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<title>UVM map4ebola</title>
<meta charset='utf-8' />
<link href='http://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
<style type='text/css'>
body {
background:#1B346C;