Skip to content

Instantly share code, notes, and snippets.

Nick Rabinowitz nrabinowitz

Block or report user

Report or block nrabinowitz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nrabinowitz / quantize.js
Created Jul 25, 2011
Javascript module for color quantization, based on Leptonica
View quantize.js
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license:
// fill out a couple protovis dependencies
* Block below copied from Protovis:
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License:
nrabinowitz / icosahedron.json
Created Jul 12, 2019
Icosahedron geojson (great arcs)
View icosahedron.json
"type": "MultiLineString",
"coordinates": [
[-176.51528829392126, 56.22382026488319],
[-177.666887558162, 56.2558355327094],
[-178.82009217995488, 56.27714350189036],
[-179.97425867250774, 56.287723610665964],
[-180, 56.28772008819492],
[-179.97425867250772, 56.287723610665964],
nrabinowitz /
Last active Nov 9, 2018
Images and Data for H3 Tutorials

Images and data for H3 tutorials

View gist:0cc51e3336e71906c58fd4c5bea87a27
nrabinowitz / fitProjection.js
Created Feb 7, 2012
D3 function for fitting a projection to geodata
View fitProjection.js
function fitProjection(projection, data, box, center) {
// get the bounding box for the data - might be more efficient approaches
var left = Infinity,
bottom = -Infinity,
right = -Infinity,
top = Infinity;
// reset projection
.translate([0, 0]);
nrabinowitz /
Created Dec 9, 2012
Raster geocoding with D3.js

This demonstrates raster-based reverse geocoding using canvas and D3.js. Geocoding is based on the color of the pixel at a given projected position. Note that the canvas is only shown here for the sake of explanation and debugging - this would in fact probably work faster if the canvas was not attached to the document at all.

The biggest remaining issue here is precision, which depends on:

  • the size of the canvas, and
  • the projection used.

Determining the optimum size based on the accuracy of your data is left as an exercise for the reader. Edge cases will also fail here, generally returning null - one option might be to stroke neighborhoods in a color, and then return an "uncertain" value for any non-grayscale pixel.

nrabinowitz / index.html
Created Sep 7, 2012 — forked from stepheneb/index.html
D3 Example: zoom, pan, and axis rescale
View index.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>One Graph</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="simple-graph.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: #fff; }
nrabinowitz / .gitignore
Created Apr 22, 2012 — forked from karmi/.gitignore
Life Expectancy Slope Graph [WIP]
nrabinowitz / index.html
Created Mar 14, 2012
Histogram with a normal distribution
View index.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript" src=""></script>
<style type="text/css">
body {
margin: 3em;
You can’t perform that action at this time.