Skip to content

Instantly share code, notes, and snippets.

@fod
fod / readgazeteer.pl
Created February 2, 2012 15:26
Get data from EA Gazeteer
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
use CAM::PDF;
use DBI;
use SQL::Abstract;
use List::AllUtils qw(zip);
use Term::ProgressBar 2.00;
d3.scale.flexiclass = function(class_alg) {
return d3_scale_flexiclass([], [], class_alg);
};
function d3_scale_flexiclass(domain, range, class_alg) {
var thresholds;
function rescale() {
var geostats_class = new geostats(domain);
var k = 0,
@fod
fod / README.mkd
Created September 21, 2011 02:56 — forked from jasondavies/README.mkd
Resizable Markers

A quick example demonstrating the use of "show" event handlers and reshow, which allows you to restyle GeoJSON features dynamically from an external event. In this example, you can use the jQuery UI slider in the top-left corner to resize the points.

@fod
fod / index.html
Created September 19, 2011 21:16 — forked from kforeman/index.html
treemap transitions
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Treemap</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<script type="text/javascript" src="http://simiantics.net/d3/lib/jquery/jquery.min.js"></script>
<script type="text/javascript" src="http://simiantics.net/d3/lib/jquery-ui/jquery-ui.min.js"></script>
<style type="text/css"> @import url("http://simiantics.net/d3/lib/jquery-ui/jquery-ui.css"); text { font-family: sans-serif; } </style>
<script type="text/javascript" src="http://simiantics.net/treemap_USA.js"></script>
@fod
fod / tilestache.cfg
Created August 31, 2011 09:29
tilestache config
{
"cache": {
"name": "Disk",
"path": "stache",
"umask": "0000",
"dirs": "portable"
},
"layers": {
"eds": {
@fod
fod / index.html
Created July 11, 2011 20:30 — forked from mbostock/.block
d3.geo.tiler
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.8.4/d3.js"></script>
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.8.4/d3.geo.js"></script>
<script type="text/javascript" src="https://github.com/simplegeo/polymaps/raw/v2.4.0/polymaps.js"></script>
<script type="text/javascript" src="tiler.js"></script>
<style type="text/css">
@import url("http://github.com/simplegeo/polymaps/raw/v2.4.0/examples/example.css");
@fod
fod / README.mkd
Created July 11, 2011 19:12 — forked from mbostock/.block
Fancy Markers

The default display for GeoJSON points in Polymaps is a 4.5px-radius circle. In this example, I show how to create more traditional pin-style markers for points. This is implemented using a “load” event handler which replaces the default circles with custom path elements.

The marker outline is courtesy of Dmitry Baranovskiy; he has graciously provided over 100 free vector icons to choose from. Of course, there’s no requirement to use vector icons. You could replace the circles with image elements instead, if you prefer raster. But the nice thing about vectors is that we can color them dynamically based on the data, as we do here by generating three categorical color gradients.

@fod
fod / drag.js
Created July 11, 2011 15:53 — forked from g2010a/drag.js
Behaviors for D3 Visualization library
d3.behavior.drag = function() {
var x = 0,
y = 0,
listeners = [],
dragit
function drag() {
var container = this
.on("mousedown", mousedown)
@fod
fod / README.mkd
Created July 10, 2011 22:25 — forked from RandomEtc/README.mkd
smooth panning and zooming for polymaps
@fod
fod / index.html
Created July 8, 2011 14:39 — forked from mbostock/.block
d3.geo.tiler
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.8.4/d3.js"></script>
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.8.4/d3.geo.js"></script>
<script type="text/javascript" src="https://github.com/simplegeo/polymaps/raw/v2.4.0/polymaps.js"></script>
<script type="text/javascript" src="tiler.js"></script>
<style type="text/css">
@import url("http://github.com/simplegeo/polymaps/raw/v2.4.0/examples/example.css");