Skip to content

Instantly share code, notes, and snippets.

@phil-pedruco
phil-pedruco / data.tsv
Last active August 29, 2015 13:56
Bar chart with mouseover event
letter frequency
A .08167
B .01492
C .02782
D .04253
E .12702
F .02288
G .02015
H .06094
I .06966
@phil-pedruco
phil-pedruco / data.tsv
Last active August 29, 2015 13:56
Axis transition
Date Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware Midwest Northeast South West United States
1917 14.3 2.8 11.7 11.2 15 13.3 19.1 37.9 13.1 22.9 15.7 13.2 17.3
1918 11.5 1.3 11.6 11.7 14.9 10.3 16.9 32.9 11.7 20.2 15.1 11.7 15.6
1919 13.2 1.1 9.8 9.9 15 12.1 16.6 30.4 12.8 21.2 14.3 12.2 16
1920 12.1 1.2 8.3 9.6 12.7 11.1 14.1 21 12.4 17.8 13.5 10.9 14.5
1921 13.4 2.1 8.4 10.6 13.4 11.7 16.4 21.8 13.2 17.9 14 12 15.3
1922 14.2 2 9.8 11.7 14.2 13.6 16.6 23 14.1 19.8 15 12.8 16.6
1923 13.4 1.9 9.1 10.9 13.4 12.1 16.2 22.7 12.9 18 14.4 12 15.3
1924 14.5 2.3 10.4 11.1 14.7 13.1 18.5 29.1 14.7 20 15.3 12.9 17
1925 15.8 3.1 14.2 12.5 16.3 16 21.3 35.4 17.3 22.9 18 15.2 19.8
@phil-pedruco
phil-pedruco / index.html
Last active August 29, 2015 13:56
Map of the Netherlands
<!DOCTYPE html>
<meta charset="utf-8">
<style>
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
var width = 960,
@phil-pedruco
phil-pedruco / data.csv
Last active August 29, 2015 13:57
Simple Line Chart
first second
2 2
3 3
4 4
5 4
5.5 5
6 6
6 7
6.5 8
6.5 16
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 5 columns, instead of 6. in line 3.
Date First Second Third Fourth
1917 14.3 2.8 11.7 11.2
1918 11.5 1.3 11.6 11.2
1919 13.2 1.1 9.8 9.9
1920 12.1 1.2 8.3 9.6
1921 13.4 2.1 8.4 10.6
1922 14.2 2 9.8 11.7
1923 13.4 1.9 9.1 10.9
1924 14.5 2.3 10.4 11.1
1925 15.8 3.1 14.2 12.2
Channel Velocity Conversion Value
Banner Ads 116.282838326879 0.0777953412150964 2586.09978249297
Email 110.74304234935 0.0529536268208176 3761.50209223852
Search 124.261170288082 0.0693502774462104 6119.40218368545
Events 23.7619550898671 0.0889248474035412 5757.40572996438
Social 121.343896351755 0.0824868025956675 5425.63441209495
Content Syndication 36.7841859231703 0.0890633624512702 2396.92708943039
Nurture 30.726479308214 0.0241480510216206 6321.72799669206
Sponsorship 55.1225619041361 0.0389538716059178 5938.49707627669
Display 143.331882997882 0.00218722021672875 8178.07669518515
/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */
Date.ext={};Date.ext.util={};Date.ext.util.xPad=function(a,c,b){if(typeof(b)=="undefined"){b=10}for(;parseInt(a,10)<b&&b>1;b/=10){a=c.toString()+a}return a.toString()};Date.prototype.locale="en-GB";if(document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){Date.prototype.locale=document.getElementsByTagName("html")[0].lang}Date.ext.locales={};Date.ext.locales.en={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%T"};Date.ext.locales["en-US"]=Date.ext.locales.en;Date.ext.locales["en-US"].c="%a %d %b %Y %r %Z";Date.ext.locales["en-US"].x="%D";Date.
@phil-pedruco
phil-pedruco / index.html
Created June 5, 2014 19:15
Colour interpolation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Interpolated Colour Scales</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
</head>
client_ip timestamp bytes_transfered
92.239.29.77 1412109000000 577818
92.239.29.77 1412110830000 108257
92.239.29.77 1412112600000 20922726
92.239.29.77 1412132430000 3190
92.239.29.78 1412109000000 57818
92.239.29.78 1412110830000 10257
92.239.29.78 1412112600000 2022726
ip timestamp value
92.239.29.77 1412132430000 3190
92.239.29.77 1412142430000 319011
92.239.29.78 1412128830000 545568
92.239.29.78 1412130600000 616409
92.239.29.78 1412132430000 319087
92.239.29.76 1412130600000 616409
92.239.29.76 1412132430000 319087