Skip to content

Instantly share code, notes, and snippets.

View jasondavies's full-sized avatar
💭
💡

Jason Davies jasondavies

💭
💡
View GitHub Profile
(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 / README.md
Created October 13, 2011 11:49
Zoom/Pan Map Example

Demonstrates using d3.behavior.zoom with a geographic projection. Based on an example by Iain Dillingham.

@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),
@jasondavies
jasondavies / .block
Last active February 4, 2024 12:38 — forked from mbostock/.block
Parallel Coordinates
license: gpl-3.0
@jasondavies
jasondavies / index.html
Created January 3, 2012 12:46 — forked from gka/index.html
alpha-shapes aka concave hulls in d3
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Alpha-Shapes</title>
<script src="http://mbostock.github.com/d3/d3.min.js"></script>
<script src="http://mbostock.github.com/d3/d3.geom.min.js"></script>
<style type="text/css">
path {