Skip to content

Instantly share code, notes, and snippets.

@phoebebright
phoebebright / index.html
Created August 30, 2012 15:46
SVG appears before transform
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style>
body { text-align: center; margin: auto; }
p.source { font-style: italic; }
a { color: blue; }
@phoebebright
phoebebright / index.html
Created August 30, 2012 15:42
Disappearing svg in Firefox
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style>
body { text-align: center; margin: auto; }
p.source { font-style: italic; }
a { color: blue; }
@phoebebright
phoebebright / README.mkd
Created August 30, 2012 16:25
Grouped bar

This is a reimplementation of the Grouped Bar Chart by Mike Bostock. Although useful, I found the original's minimal comments and inverted axes hard to follow, so I created the version you see here.

@phoebebright
phoebebright / 3822981.iml
Created October 2, 2012 20:08
Crossfilter examples (d3)
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
@phoebebright
phoebebright / index.html
Created October 10, 2012 18:43
Scatter to Heatmap
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Scatter to Heatmap</title>
<script src="http://d3js.org/d3.v2.js"></script>
<script src=" https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Numans' rel='stylesheet' type='text/css'>
<style>
body {
@phoebebright
phoebebright / index.html
Created October 11, 2012 08:47 — forked from eoiny/index.html
D3 Choropleth Map Ireland
<!DOCTYPE html>
<html>
<head>
<title>Map</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
svg {
background: #eee;
}
@phoebebright
phoebebright / crossfilter.min.js
Created October 12, 2012 11:39
Ireland Sporthorse Foal Registrations - in progress
(function(a){function b(a){return a}function c(a,b){for(var c=0,d=b.length,e=new Array(d);c<d;++c)e[c]=a[b[c]];return e}function e(a){function b(b,c,d,e){while(d<e){var f=d+e>>1;a(b[f])<c?d=f+1:e=f}return d}function c(b,c,d,e){while(d<e){var f=d+e>>1;c<a(b[f])?e=f:d=f+1}return d}return c.right=c,c.left=b,c}function g(a){function b(a,b,c){var e=c-b,f=(e>>>1)+1;while(--f>0)d(a,f,e,b);return a}function c(a,b,c){var e=c-b,f;while(--e>0)f=a[b],a[b]=a[b+e],a[b+e]=f,d(a,1,e,b);return a}function d(b,c,d,e){var f=b[--e+c],g=a(f),h;while((h=c<<1)<=d){h<d&&a(b[e+h])>a(b[e+h+1])&&h++;if(g<=a(b[e+h]))break;b[e+c]=b[e+h],c=h}b[e+c]=f}return b.sort=c,b}function i(a){function c(c,d,e,f){var g=new Array(f=Math.min(e-d,f)),h,i,j,k;for(i=0;i<f;++i)g[i]=c[d++];b(g,0,f);if(d<e){h=a(g[0]);do if(j=a(k=c[d])>h)g[0]=k,h=a(b(g,0,f)[0]);while(++d<e)}return g}var b=g(a);return c}function k(a){function b(b,c,d){for(var e=c+1;e<d;++e){for(var f=e,g=b[e],h=a(g);f>c&&a(b[f-1])>h;--f)b[f]=b[f-1];b[f]=g}return b}return b}function m(a){functio
@phoebebright
phoebebright / index.html
Created November 5, 2012 16:35
D3 to nest or not to nest selections - examples
<!DOCTYPE html>
<html>
<head>
<title>Map</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
.one {
background: #a7eea4;
}
.two {
@phoebebright
phoebebright / index.html
Created November 21, 2012 10:36 — forked from benjchristensen/index.html
Interactive Line Graph (D3)
<html>
<head>
<title>Interactive Line Graph</title>
<script src="http://d3js.org/d3.v2.js"></script>
<!--
using JQuery for element dimensions
This is a small aspect of this example so it can be removed fairly easily if needed.
-->
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="sample_data.js"></script>