Skip to content

Instantly share code, notes, and snippets.

View radiocontrolled's full-sized avatar

Alison Benjamin radiocontrolled

  • London
View GitHub Profile
@radiocontrolled
radiocontrolled / d3.v3.js
Last active August 29, 2015 13:55
Tweets matching '@ffregister'
d3 = function() {
var d3 = {
version: "3.3.5"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_arraySlice = [].slice, d3_array = function(list) {
return d3_arraySlice.call(list);
};
@radiocontrolled
radiocontrolled / d3.jsonp.js
Last active August 29, 2015 13:55
Latest Guardian Global Development Articles
d3.jsonp = function (url, callback) {
function rand() {
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
c = '', i = -1;
while (++i < 15) c += chars.charAt(Math.floor(Math.random() * 52));
return c;
}
function create(url) {
var e = url.match(/callback=d3.jsonp.(\w+)/),
@radiocontrolled
radiocontrolled / g.pie.min.js
Last active August 29, 2015 13:56
Per cent of Internet users in Comoros, 2011
/*!
* g.Raphael 0.51 - Charting library, based on Rapha�l
*
* Copyright (c) 2009-2012 Dmitry Baranovskiy (http://g.raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
(function(){function t(f,k,l,i,d,b){function t(d,b,c,e,f){var a=Math.PI/180,g=d+c*Math.cos(-e*a),i=d+c*Math.cos(-f*a),h=d+c/2*Math.cos(-(e+(f-e)/2)*a),j=b+c*Math.sin(-e*a),k=b+c*Math.sin(-f*a),a=b+c/2*Math.sin(-(e+(f-e)/2)*a),d=["M",d,b,"L",g,j,"A",c,c,0,+(180<Math.abs(f-e)),1,i,k,"z"];d.middle={x:h,y:a};return d}var b=b||{},q=[],m=f.set(),a=f.set(),n=f.set(),o=d.length,h=0,j=0,p=0,g=b.maxSlices||100,e=parseFloat(b.minPercent)||1,r=Boolean(e);a.covers=m;if(1==o)n.push(f.circle(k,l,i).attr({fill:b.colors&&
b.colors[0]||this.colors[0],stroke:b.stroke||"#fff","stroke-width":null==b.strokewidth?1:b.strokewidth})),m.push(f.circle(k,l,i).attr(this.shim)),j=d[0],d[0]={value:d[0],order:0,valueOf:function(){return this.value}},b.href&&b.href[0]&&m[0].attr({href:b.href[0]}),n[0].middle={x:k,y:l},n[
@radiocontrolled
radiocontrolled / g.line-min.js
Last active August 29, 2015 13:56
Per cent of Internet users in Comoros, 2005, 2010 and 2011
/*!
* g.Raphael 0.51 - Charting library, based on Raphaël
*
* Copyright (c) 2009-2012 Dmitry Baranovskiy (http://g.raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
(function(){function S(h,o){for(var p=h.length/o,m=0,k=p,b=0,i=[];m<h.length;)k--,0>k?(b+=h[m]*(1+k),i.push(b/p),b=h[m++]*-k,k+=p):b+=1*h[m++];return i}function E(h,o,p,m,k,b,i,c){var F,f,u,w;function J(a){for(var s=[],e=0,G=b.length;e<G;e++)s=s.concat(b[e]);s.sort(function(a,e){return a-e});for(var c=[],g=[],e=0,G=s.length;e<G;e++)s[e]!=s[e-1]&&c.push(s[e])&&g.push(o+d+(s[e]-v)*A);for(var s=c,G=s.length,l=a||h.set(),e=0;e<G;e++){var c=g[e]-(g[e]-(g[e-1]||o))/2,f=((g[e+1]||o+m)-g[e])/2+(g[e]-(g[e-
1]||o))/2,j;a?j={}:l.push(j=h.rect(c-1,p,Math.max(f+1,1),k).attr({stroke:"none",fill:"#000",opacity:0}));j.values=[];j.symbols=h.set();j.y=[];j.x=g[e];j.axis=s[e];for(var f=0,r=i.length;f<r;f++)for(var c=b[f]||b[0],n=0,u=c.length;n<u;n++)c[n]==s[e]&&(j.values.push(i[f][n]),j.y.push(p+k-d-(i[f][n
@radiocontrolled
radiocontrolled / PercentageOfIndividualsUsingTheInternet.csv
Last active August 29, 2015 13:57
What per cent of people per North American country use the Internet?
Country 2012 2007
Canada 86.77 73.20
The Bahamas 71.75 27.00
Belize 25.00 10.86
Costa Rica 47.50 28.40
Cuba 25.64 11.69
Dominican Republic 45.00 17.66
El Salvador 25.50 6.11
Guatemala 16.00 7.30
Haiti 9.80 7.20
@radiocontrolled
radiocontrolled / d3.v3.js
Last active August 29, 2015 13:57
Interactive thermometer
d3 = function() {
var d3 = {
version: "3.3.5"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_arraySlice = [].slice, d3_array = function(list) {
return d3_arraySlice.call(list);
};
@radiocontrolled
radiocontrolled / d3.jsonp.js
Last active August 29, 2015 13:59
News ticker
d3.jsonp = function (url, callback) {
function rand() {
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
c = '', i = -1;
while (++i < 15) c += chars.charAt(Math.floor(Math.random() * 52));
return c;
}
function create(url) {
var e = url.match(/callback=d3.jsonp.(\w+)/),
@radiocontrolled
radiocontrolled / d3.min.js
Last active August 29, 2015 14:01
Humanitarian migrants to Canada by top country
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ha+n in this}function c(n){return n=ha+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===ga&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===ga)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n,
@radiocontrolled
radiocontrolled / d3.min.js
Last active August 29, 2015 14:05
Film leader
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ha+n in this}function c(n){return n=ha+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===ga&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===ga)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n,
@radiocontrolled
radiocontrolled / countries.json
Last active August 29, 2015 14:07
Responsive Globe
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.