Skip to content

Instantly share code, notes, and snippets.

View wimdows's full-sized avatar

wim wimdows

  • Amsterdam
View GitHub Profile
@wimdows
wimdows / colorbrewer.js
Created February 20, 2012 09:18
Trying some bar transitions...
/*
* This product includes color specifications and designs developed by Cynthia
* Brewer (http://colorbrewer.org/).
*/
var colorbrewer = {
YlGn:{3:["rgb(247,252,185)","rgb(173,221,142)","rgb(49,163,84)"],4:["rgb(255,255,204)","rgb(194,230,153)","rgb(120,198,121)","rgb(35,132,67)"],5:["rgb(255,255,204)","rgb(194,230,153)","rgb(120,198,121)","rgb(49,163,84)","rgb(0,104,55)"],6:["rgb(255,255,204)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(49,163,84)","rgb(0,104,55)"],7:["rgb(255,255,204)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,90,50)"],8:["rgb(255,255,229)","rgb(247,252,185)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,90,50)"],9:["rgb(255,255,229)","rgb(247,252,185)","rgb(217,240,163)","rgb(173,221,142)","rgb(120,198,121)","rgb(65,171,93)","rgb(35,132,67)","rgb(0,104,55)","rgb(0,69,41)"]},
YlGnBu:{3:["rgb(237,248,177)","rgb(127,205,187)","rgb(44,127,184)"],4:["rgb(255,255,204)
@wimdows
wimdows / index.html
Created December 22, 2011 12:56 — forked from mzupan/index.html
transition not working
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://raw.github.com/mbostock/d3/master//d3.js"></script>
<script type="text/javascript" src="https://raw.github.com/mbostock/d3/master/d3.time.js"></script>
<style type="text/css">
body {
font: 10px sans-serif;
margin: 0;
@wimdows
wimdows / index.html
Created December 20, 2011 21:01
force graph from lastFM data
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Force-Directed Graph</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/
d3.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/
d3.geom.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/
d3.layout.js?1.25.0"></script>
@wimdows
wimdows / index.html
Created December 20, 2011 18:57 — forked from mbostock/.block
Force-Directed Symbols (D3)
<!DOCTYPE html>
<html>
<head>
<title>Force-Directed Symbols</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.25.0"></script>
</head>
<body>
<script type="text/javascript">
@wimdows
wimdows / index.html
Created December 14, 2011 07:25 — forked from anonymous/index.html
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
</head>
<body>
<script type="text/javascript">
@wimdows
wimdows / index.html
Created December 6, 2011 14:10 — forked from benjchristensen/index.html
Animated Line Graphs / Sparklines using SVG Path and d3.js
<html>
<head>
<title>Animated Sparkline using SVG Path and d3.js</title>
<script src="https://raw.github.com/mbostock/d3/master/d3.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@wimdows
wimdows / index.html
Created November 16, 2011 13:02 — forked from diafygi/index.html
Make call after transition
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<title>Delayed Call</title>
</head>
<body>
<div id="chart"></div>
@wimdows
wimdows / datafile.json
Created October 21, 2011 10:25 — forked from wimdows/datafile.json
a very simple pie chart
{"scores": [ {"naam":"David",
"comp":3,
"thingy": 80,
"parts": [{"test": "3", "score": 7},
{"test": "4", "score": 12},
{"test": "5", "score": 12}]
},
{"naam":"David",
"comp":2,
"thingy": 100,
@wimdows
wimdows / datafile.json
Created October 19, 2011 17:08
a very simple pie chart
{"scores": [ {"naam":"David",
"comp":3,
"thingy": 80,
"parts": [{"test": "3", "score": 7},
{"test": "4", "score": 12},
{"test": "5", "score": 12}]
},
{"naam":"David",
"comp":2,
"thingy": 100,
var r = 480,
format = d3.format(",d"),
fill = d3.scale.category20c();
var keeper;
var bubble = d3.layout.pack()
.sort(null)
.size([r, r]);