Skip to content

Instantly share code, notes, and snippets.

View jasondavies's full-sized avatar
💭
💡

Jason Davies jasondavies

💭
💡
View GitHub Profile
@jasondavies
jasondavies / README.md
Last active August 29, 2015 13:58 — forked from mbostock/README.md
Voronoi Clip Bug

There seems to be a bug in voronoi clipping; setting .clipExtent([[-1, -10], [width + 1, height + 1]]) works around the issue for these particular points.

@jasondavies
jasondavies / .gitignore
Last active August 29, 2015 14:04 — forked from mbostock/.block
Quantised States
.DS_Store
build
node_modules
@jasondavies
jasondavies / README.md
Last active August 29, 2015 14:04 — forked from mbostock/.block
Wrapped d3.geo.tile
(function (exports) {
// because the anonymous function is being called without a scope being set,
// "this" will refer to the global scope. In a browser, that's the window, but
// will be "undefined" in strict mode. In other JS platforms, it may be some
// other thing.
// my code here.
// don't make accidental globals.
// hang a small number of things on the "exports" object.

This example is a simple loupe using Polymaps. Drag the center of the loupe to move it around, or drag the thick border to resize it. Loupes are normally used to magnify, showing focus and context, but in this example we're using it to show two different tilesets. You can enable magnification (or minification) using the zoomDelta property.

@jasondavies
jasondavies / README.mkd
Created July 7, 2011 23:37 — forked from mbostock/.block
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.

@jasondavies
jasondavies / ciliarisDAR.js
Created July 9, 2011 12:35 — forked from blahah/ciliarisDAR.js
LatticeXY chart
//Eragrostis ciliaris dry-after ripening germination data
var ddays = ["0630°/days","1260°/days","1890°/days","2520°/days"];
var RH = [20, 35, 50, 65];
var data = [{"temp":"30°C","RH":20,"ddays":"0630°/days","days":0,"germ":0},
{"temp":"30°C","RH":20,"ddays":"0630°/days","days":1,"germ":0},
{"temp":"30°C","RH":20,"ddays":"0630°/days","days":4,"germ":0},
{"temp":"30°C","RH":20,"ddays":"0630°/days","days":8,"germ":0},
{"temp":"30°C","RH":20,"ddays":"0630°/days","days":14,"germ":0},
{"temp":"30°C","RH":20,"ddays":"0630°/days","days":28,"germ":0},
@jasondavies
jasondavies / index.html
Created July 23, 2011 10:02 — forked from hperantunes/index.html
hexagons test
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Hexagons Test</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.behavior.min.js"></script>
<style type="text/css">
svg {
border: solid 1px #aaa;
@jasondavies
jasondavies / index.html
Created October 16, 2011 16:10 — forked from mbostock/.block
Force Layout with fixed Mouseover Labels
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script>
<style type="text/css">
.link {
stroke: #ccc;
@jasondavies
jasondavies / index.html
Created October 20, 2011 06:45 — forked from ZJONSSON/index.html
Contour Test using Jason Davies' implementation with D3
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="https://raw.github.com/jasondavies/conrec.js/master/conrec.js"></script>
<script type="text/javascript" src="multiplot.js"></script>
</head>
<body>
<script type="text/javascript">
var c = new Conrec(),
xs = d3.range(0, data[0].length),