Skip to content

Instantly share code, notes, and snippets.

View Contrastat's full-sized avatar

Federico Todeschini Contrastat

  • Contrastat.cat
  • Barcelona
View GitHub Profile
@Contrastat
Contrastat / index.html
Last active March 5, 2016 09:37
Ongoing Unemployment Project
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bar Chart, Framed</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<!-- <script type="text/javascript" src="../d3.v3.js"></script> -->
<style type="text/css">
body {
@Contrastat
Contrastat / EpaReader.R
Last active February 8, 2016 09:39
Project for Udacity Visualization
library(ggplot2)
library(tidyr)
library(dplyr)
library(RColorBrewer)
library(GGally)
library(scales)
library(memisc)
library(gridExtra)
library(reshape2)
library(data.table)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Contrastat
Contrastat / ESPadm4.json
Last active November 17, 2015 19:18
Black Map...
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Contrastat
Contrastat / aturats_provincia2.csv
Created November 9, 2015 00:08
Registered unemployed by Spanish Province
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 33 columns, instead of 24 in line 5.
Numero,Provincia,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
2,Albacete,172.0,171.2,174.0,160.7,161.8,154.0,157.4,148.4,146.9,148.6,151.3,154.7,149.0,150.8,147.7,145.8,137.1,129.5,126.2,123.6,126.2,133.4,136.0,134.3,137.1,137.7,132.4,136.2,133.4,143.5,144.8
3,Alacant,786.6,780.2,780.8,773.5,714.1,732.8,725.9,702.7,688.4,679.9,683.9,674.3,666.5,686.5,680.5,674.3,637.8,659.4,654.7,634.4,628.0,654.6,661.5,640.7,632.5,662.9,671.6,667.7,657.4,681.6,687.1
4,Almeria,287.2,265.7,258.2,266.1,268.2,258.7,247.3,264.4,261.5,248.9,255.2,263.2,249.7,231.8,234.7,241.0,238.4,233.5,225.1,231.5,230.6,238.6,216.2,230.3,241.1,227.0,217.4,227.9,238.4,241.8,234.4
1,Alava,152.9,155.1,160.0,154.6,150.0,147.8,142.0,140.6,141.8,147.7,146.7,147.9,147.2,150.0,148.9,147.5,135.8,136.8,139.4,133.6,135.6,136.8,135.2,132.8,131.1,136.1,132.3,135.3,131.6,134.2,133.0
33,Asturias,448.2,460.2,469.0,447.6,435.0,424.3,425.8,419.5,409.8,409.9,422.4,405.9,397.5,408.5,404.3,395.8,383.2,389.2,386.3,372.9,368.4,36
@Contrastat
Contrastat / hidrovulnerables.csv
Created October 31, 2015 00:21
Project 1 for Intermediate D3 Data Journalism
municipio hidrovulnerables llarscobertes taxaatur
Badalona 9.321 13.52 0.299554659
Barcelona 7.839 3.94 0.217109504
Bagues 4.028 43.72 0.126036928
Castelldefels 9.005 8.42 0.210353374
Cerdanyola 7.655 8.87 0.232007139
Cornella 9.347 14.57 0.290765445
El Papiol 6.693 46.10 0.171846435
Esplugues de Llobregat 8.257 8.92 0.25076836
Gava 10.136 11.56 0.267272797
@Contrastat
Contrastat / RadarChart.js
Last active August 29, 2015 14:22
Share of votes in Barcelona
var RadarChart = {
draw: function(id, d, options){
var cfg = {
radius: 5,
w: 600,
h: 600,
factor: 1,
factorLegend: .85,
levels: 3,
maxValue: 0,
@Contrastat
Contrastat / bbddcompleta.csv
Last active August 29, 2015 14:20
Project for the Data Journalism course. Shows the unemployment rate and noncontribute pensions for catalonia's comarques. Many thanks to Scott Murray, Albert Cairo and Gloria Yanguas (who made the CSS which I'm using here).
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 31 columns, instead of 10 in line 5.
Comarca,pT1991,pT1996,pT1998,pT1999,pT2000,pT2003,pT2004,pT2005,pT2006,pT2007,pT2010,pT2011,pT2012,pT2013,pT2014,p14_2012,p15a64_2012,p65_2012,p14_2007,p15a64_2007,p65_2007,p14_2000,p15a64_2000,p65_2000,pensions_2000,pensions_2007,pensions_2012,atur_2000,atur_2007,atur_2012
Alt Camp,34016,34403,34546,35028,35443,37744,38824,40017,41081,42586,45326,45189,45299,44771,44578,16.4,66.3,17.3,15.5,68,16.5,14.1,66.3,19.6,131,105,76,948,1523,4002
Alt Emporda,90755,93172,95871,98506,101028,110743,112439,118950,123983,129158,140262,140428,141517,141351,140214,16.4,66.5,17.1,15.2,68.7,16.1,14.7,66.8,18.4,383,347,374,2213,3765,10709
Alt Penedes,69863,73196,74566,76018,77622,86306,89444,93408,96779,98856,104589,105670,106252,106242,106262,18,66,16,16.4,68.4,15.2,14.2,68,17.7,422,333,268,1339,3122,8854
Alt Urgell,19010,19006,18950,19069,19315,20106,20315,20936,21257,21566,22005,22008,21386,21128,20878,13.6,66.6,19.8,12.6,68.1,19.4,12.5,64.7,22.8,154,109,78,240,440,1204
Alta Ribagorza,3514,3542,3490,3633,3612,3687,3796,4004,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Line Chart with Multiple Lines</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: white;
@Contrastat
Contrastat / bbddcompleta.csv
Last active August 29, 2015 14:19
Scatterplot showing relationship of unemployment rate to non contributive pensions in Catalonia for the period 2000 to 2012.
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 31 columns, instead of 10 in line 5.
Comarca,pT1991,pT1996,pT1998,pT1999,pT2000,pT2003,pT2004,pT2005,pT2006,pT2007,pT2010,pT2011,pT2012,pT2013,pT2014,p14_2012,p15a64_2012,p65_2012,p14_2007,p15a64_2007,p65_2007,p14_2000,p15a64_2000,p65_2000,pensions_2000,pensions_2007,pensions_2012,atur_2002,atur_2007,atur_2012
Alt Camp,34016,34403,34546,35028,35443,37744,38824,40017,41081,42586,45326,45189,45299,44771,44578,16.4,66.3,17.3,15.5,68,16.5,14.1,66.3,19.6,131,105,76,948,1523,4002
Alt Emporda,90755,93172,95871,98506,101028,110743,112439,118950,123983,129158,140262,140428,141517,141351,140214,16.4,66.5,17.1,15.2,68.7,16.1,14.7,66.8,18.4,383,347,374,2213,3765,10709
Alt Penedes,69863,73196,74566,76018,77622,86306,89444,93408,96779,98856,104589,105670,106252,106242,106262,18,66,16,16.4,68.4,15.2,14.2,68,17.7,422,333,268,1339,3122,8854
Alt Urgell,19010,19006,18950,19069,19315,20106,20315,20936,21257,21566,22005,22008,21386,21128,20878,13.6,66.6,19.8,12.6,68.1,19.4,12.5,64.7,22.8,154,109,78,240,440,1204
Alta Ribagorza,3514,3542,3490,3633,3612,3687,3796,4004,