Skip to content

Instantly share code, notes, and snippets.

View djbutler's full-sized avatar

Dan Butler djbutler

  • Meta
  • New York, NY
View GitHub Profile
@djbutler
djbutler / .block
Last active February 26, 2016 19:34 — forked from mbostock/.block
Bullet Charts
license: gpl-3.0
@djbutler
djbutler / README.md
Last active August 29, 2015 14:15 — forked from mbostock/.block

This example demonstrates how to remap a monochrome image using a custom color scale. You might use this technique as an alternative to a CSV- or JSON-based heatmap; binary images can store lots of data efficiently.

The source image is a global heightmap from the Shuttle Radar Topography Mission, released as part of NASA’s Blue Marble collection at 8km resolution. The topography data is stored in a simple black-and-white, 8-bit PNG. Darker values represent lower elevations, and lighter values represent higher elevations. Colors are read out of the image using the Canvas API.

Since there are eight bits per channel, elevation value

@djbutler
djbutler / heatmap.json
Last active August 29, 2015 14:15 — forked from mbostock/.block
[
[103,104,104,105,105,106,106,106,107,107,106,106,105,105,104,104,104,104,105,107,107,106,105,105,107,108,109,110,110,110,110,110,110,109,109,109,109,109,109,108,107,107,107,107,106,106,105,104,104,104,104,104,104,104,103,103,103,103,102,102,101,101,100,100,100,100,100,99,98,97,97,96,96,96,96,96,96,96,95,95,95,94,94,94,94,94,94],
[104,104,105,105,106,106,107,107,107,107,107,107,107,106,106,106,106,106,106,108,108,108,106,106,108,109,110,110,112,112,113,112,111,110,110,110,110,109,109,109,108,107,107,107,107,106,106,105,104,104,104,104,104,104,104,103,103,103,103,102,102,101,101,100,100,100,100,99,99,98,97,97,96,96,96,96,96,96,96,95,95,95,94,94,94,94,94],
[104,105,105,106,106,107,107,108,108,108,108,108,108,108,108,108,108,108,108,108,110,110,110,110,110,110,110,111,113,115,116,115,113,112,110,110,110,110,110,110,109,108,108,108,108,107,106,105,105,105,105,105,105,104,104,104,104,103,103,103,102,102,102,101,100,100,100,99,99,98,97,97,96,96,96,96,96,96,96,96,95,95,94,94,94,94,94],
[105,105,106,106,107,107,108,
@djbutler
djbutler / force.csv
Created March 24, 2014 17:52 — forked from d3noob/.block
source target value
Harry Sally 1.2
Harry Mario 1.3
Sarah Alice 0.2
Eveie Alice 0.5
Peter Alice 1.6
Mario Alice 0.4
James Alice 0.6
Harry Carol 0.7
Harry Nicky 0.8

Click in the open space to add a node, drag from one node to another to add an edge.
Ctrl-drag a node to move the graph layout.
Click a node or an edge to select it.

When a node is selected: R toggles reflexivity, Delete removes the node.
When an edge is selected: L(eft), R(ight), B(oth) change direction, Delete removes the edge.

To see this example as part of a larger project, check out Modal Logic Playground!

@djbutler
djbutler / README.md
Last active December 16, 2015 01:59 — forked from mbostock/.block