Skip to content

Instantly share code, notes, and snippets.

@lmelgar
lmelgar / index.html
Last active August 30, 2015 18:16
Week 1: Style article.
<!DOCTYPE html>
<html lang="en">
<head>
<link media="screen" href="style.css" rel="stylesheet" />
<!-- original article: http://www.washingtonpost.com/news/the-fix/wp/2015/08/06/heres-how-much-or-how-little-debates-actually-matter-in-7-cool-charts/ -->
<title>Here's how much debates actually matter</title>
</head>
<div class="container">
@lmelgar
lmelgar / Deaths_04yearsold_UNICEF.csv
Last active August 30, 2015 18:40
Mortality among 0-4 years old children since 2000
Country Year Meningitis/encephalitis Acute lower respiratory infections Sepsis and other infectious conditions of the newborn Pertussis Malaria Measles Congenital anomalies HIV/AIDS Diarrhoeal diseases Birth asphyxia and birth trauma Total yearly deaths
Afghanistan 2013 3363 20040 7131 1214 6 3936 3592 26 13217 11076 63601
Afghanistan 2012 3588 20996 7189 1243 6 3331 3574 27 14355 11355 65664
Afghanistan 2011 3904 22145 7265 1288 29 4698 3576 26 15623 11659 70213
Afghanistan 2010 4189 23263 8131 1324 29 3176 3613 25 16926 12409 73085
Afghanistan 2009 4476 24232 8417 1360 19 4450 3586 23 18136 12823 77522
Afghanistan 2008 6225 26879 8398 1367 21 2247 3429 21 17900 12581 79068
Afghanistan 2007 6458 27449 8282 1393 32 1718 3335 19 18995 12715 80396
Afghanistan 2006 6676 27950 8583 1432 31 3627 3286 18 20082 12742 84427
Afghanistan 2005 6875 28263 8513 1445 28 2447 3180 16 21112 12641 84520
@lmelgar
lmelgar / deaths_04yearsold.csv
Last active September 7, 2015 20:58
"Week 2: Paragraph Data load."
Country Year Meningitis_encephalitis Respiratory_infections Sepsi Pertussis Malaria Measles Congenital_anomalies HIV/AIDS Diarrhoeal_diseases Asphyxia_ trauma Total PIB_PerCapita
Afghanistan Year 2013 3363 20040 7131 1214 6 3936 3592 26 13217 11076 63601 665
Afghanistan Year 2012 3588 20996 7189 1243 6 3331 3574 27 14355 11355 65664 689
Afghanistan Year 2011 3904 22145 7265 1288 29 4698 3576 26 15623 11659 70213 616
Afghanistan Year 2010 4189 23263 8131 1324 29 3176 3613 25 16926 12409 73085 561
Afghanistan Year 2009 4476 24232 8417 1360 19 4450 3586 23 18136 12823 77522 451
Afghanistan Year 2008 6225 26879 8398 1367 21 2247 3429 21 17900 12581 79068 377
Afghanistan Year 2007 6458 27449 8282 1393 32 1718 3335 19 18995 12715 80396 374
Afghanistan Year 2006 6676 27950 8583 1432 31 3627 3286 18 20082 12742 84427 275
Afghanistan Year 2005 6875 28263 8513 1445 28 2447 3180 16 21112 12641 84520 252
@lmelgar
lmelgar / data.json
Created September 7, 2015 13:19
Test with json
[
{"name":"Argentina","value":[6245,6253,5780,5459,5405,5193,5238,5321,5169,5131,4966,4780]},
{"name":"Bolivia","value":[11716,11249,10704,10074,9433,8735,8137,7615,7193,6930,6758,6641]},
{"key":"Brazil","value":[54832,49618,46313,41297,38213,33548,29617,26744,23996,22632,21916,21428]},
{"key":"Chile","value":[1315,1302,1266,1252,1163,1175,1129,1151,1118,1100,1066,1038]},
{"key":"Colombia","value":[10425,10619,10981,10245,10238,10156,9576,9189,8943,8606,8255,7943]},
{"key":"Ecuador","value":[5547,5312,5168,5042,4912,4754,4456,4322,4125,3983,3860,3787]},
{"key":"Paraguay","value":[2737,2603,2546,2518,2454,2367,2270,2217,2163,2125,2104,2073]}
{"key":"Peru","value":[11315,10543,9716,8983,8399,7788,7230,6735,6313,5868,5612,5286]},
{"key":"Uruguay","value":[456,445,399,394,376,362,361,368,354,344,332,316]},
@lmelgar
lmelgar / Readme.md
Last active September 7, 2015 20:57
"Week 2: Another JS library."

The first library that I choose was Chart.js. I liked it, but the documentation was not as good as Highcharts. Moreover, things like adding labels were really complicated. So I decided to move into Zingchart.

At the very beginning, working with Zingchart was tricky. It's not that different from Highcharts, but it required me to understand how to set up the chart. I feel that Highcharts is more flexible and intuitive, although, I must say, I’m more use now to this library, after working in this homework.

On the other hand, Highcharts documentation is friendlier, and quite intuitive, with its tree structure. Another postive aspect, It's pretty easy to find a lot of information about Highcharts through Google, specially in starckoverflow.

@lmelgar
lmelgar / index.html
Created September 7, 2015 20:54
"Week2: High Charts."
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>Highcharts Extract Example</title>
<!-- Code example for class extracted from http://datatools.urban.org/Features/wealth-inequality-charts/ with code from Tim Meko and Ben Chartoff -->
<style>
body {
country year1990 year2000 year2010 year2013
Afghanistan 6339095 3587336 3054709 2556507
Albania 1822 6802 14772 10073
Algeria 19 8034 6689 3659
Angola 407760 433760 134858 10295
Argentina 334 609 557 388
Armenia 1 5786 17547 11998
Azerbaijan 0 284277 16753 10809
Bahrain 39 95 87 275
Bangladesh 477 5401 10049 9727
@lmelgar
lmelgar / UN_RefugeesByOrigin_1990-2013.csv
Created September 14, 2015 02:42
"Week 3: Cleaned data file"
country year1990 year2000 year2010 year2013
Afghanistan 6339095 3587336 3054709 2556507
Albania 1822 6802 14772 10073
Algeria 19 8034 6689 3659
Angola 407760 433760 134858 10295
Argentina 334 609 557 388
Armenia 1 5786 17547 11998
Azerbaijan 0 284277 16753 10809
Bahrain 39 95 87 275
Bangladesh 477 5401 10049 9727
@lmelgar
lmelgar / deaths_04yearsold.csv
Last active September 14, 2015 11:47
"Week 3: Basic D3 Table."
Afghanistan Year 2013 3363 20040 7131 1214 6 3936 3592 26 13217 11076 63601 665
Afghanistan Year 2012 3588 20996 7189 1243 6 3331 3574 27 14355 11355 65664 689
Afghanistan Year 2011 3904 22145 7265 1288 29 4698 3576 26 15623 11659 70213 616
Afghanistan Year 2010 4189 23263 8131 1324 29 3176 3613 25 16926 12409 73085 561
Afghanistan Year 2009 4476 24232 8417 1360 19 4450 3586 23 18136 12823 77522 451
Afghanistan Year 2008 6225 26879 8398 1367 21 2247 3429 21 17900 12581 79068 377
Afghanistan Year 2007 6458 27449 8282 1393 32 1718 3335 19 18995 12715 80396 374
Afghanistan Year 2006 6676 27950 8583 1432 31 3627 3286 18 20082 12742 84427 275
Afghanistan Year 2005 6875 28263 8513 1445 28 2447 3180 16 21112 12641 84520 252
@lmelgar
lmelgar / deaths_04yearsold.csv
Created September 14, 2015 02:57
"Week 3: My Data the D3 Way."
Afghanistan Year 2013 3363 20040 7131 1214 6 3936 3592 26 13217 11076 63601 665
Afghanistan Year 2012 3588 20996 7189 1243 6 3331 3574 27 14355 11355 65664 689
Afghanistan Year 2011 3904 22145 7265 1288 29 4698 3576 26 15623 11659 70213 616
Afghanistan Year 2010 4189 23263 8131 1324 29 3176 3613 25 16926 12409 73085 561
Afghanistan Year 2009 4476 24232 8417 1360 19 4450 3586 23 18136 12823 77522 451
Afghanistan Year 2008 6225 26879 8398 1367 21 2247 3429 21 17900 12581 79068 377
Afghanistan Year 2007 6458 27449 8282 1393 32 1718 3335 19 18995 12715 80396 374
Afghanistan Year 2006 6676 27950 8583 1432 31 3627 3286 18 20082 12742 84427 275
Afghanistan Year 2005 6875 28263 8513 1445 28 2447 3180 16 21112 12641 84520 252