Skip to content

Instantly share code, notes, and snippets.

@dyorama
dyorama / Index.html
Created April 3, 2015 19:04
Forest area and my svg
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loading CSV Data with D3</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
</head>
<body>
<svg width="500" height="500">
@dyorama
dyorama / forestdata.csv
Created April 3, 2015 19:20
Forest data and my SVG with a small I to index !
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
Country Name,Forest area 1992 in km2,Forest area 2002 in km2,Forest area 2012 in km2,Variation of area 1992 2012 in km2,Variation 2002 2012 in km2,Win or loss 1992 2002,Win or loss 2002 2012,Forest area in 1992 in % of land area ,Forest area in 2002 in % of land area ,Forest area in 2012 in % of land area ,Variation 1992 2012 of forest area in % of land area ,Variation 2002 2012 of forest area in % of land area
World,"41343881,1","40633810,8","39430117,2","-4,6","-3,0","-1913763,9","-1203693,6","31,9","31,4","31,0","-3,0","-1,2"
Sub-Saharan Africa ,"18957703,1","18355162,6","17400761,6","-8,2","-5,2","-1556941,5",-954401,"31,0","29,4","27,7","-10,6","-5,5"
Zimbabwe,"12713470,4","12481327,8","12432176,9","-2,2","-0,4","-281293,5","-49150,9","55,6","47,2","38,7","-30,4","-17,9"
Tanzania,10302831,"9815763,6","9394935,5","-8,8","-4,3","-907895,5","-420828,1","45,9","41,4","36,8","-19,8","-11,0"
Ukraine,8090136,8090771,8092100,"0,0","0,0",1964,1329,"16,1","16,5","16,8","4,7","2,3"
Latin America et Caribbean ,"
@dyorama
dyorama / forestdata.csv
Created April 7, 2015 22:37
Error message to fix
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
country,forest1992km2,forestarea2002km2,forestarea2012km2,variation19922012area,variation20022012area,winorloss19922002,winorloss20022012,forestarea1992%,forestarea2002%,forestarea2012%,variation19922012%,variation20022012%
World,"41343881,1","40633810,8","39430117,2","-4,6","-3,0","-1913763,9","-1203693,6","31,9","31,4","31,0","-3,0","-1,2"
Sub-Saharan Africa ,"18957703,1","18355162,6","17400761,6","-8,2","-5,2","-1556941,5",-954401,"31,0","29,4","27,7","-10,6","-5,5"
Zimbabwe,"12713470,4","12481327,8","12432176,9","-2,2","-0,4","-281293,5","-49150,9","55,6","47,2","38,7","-30,4","-17,9"
Tanzania,10302831,"9815763,6","9394935,5","-8,8","-4,3","-907895,5","-420828,1","45,9","41,4","36,8","-19,8","-11,0"
Ukraine,8090136,8090771,8092100,"0,0","0,0",1964,1329,"16,1","16,5","16,8","4,7","2,3"
Latin America et Caribbean ,"7326468,8","6931542,8","5890094,3","-19,6","-15,0","-1436374,5","-1041448,5","51,3","48,7","46,9","-8,7","-3,8"
Brazil,6655594,6317239,5334266,"-19,9","-15,6",-1321328,-982973,"68,1","63,8","61,6
@dyorama
dyorama / forestdata.csv
Created April 10, 2015 16:45
Module 3, Exercice 3
country forest1992Km2 forest2002Km2 forest2012Km2 forestLossorWin19922012 forestLossorWin20022012 forest1992% forest2002% forest2012%
Latin America and Caribbean 10302831 9815764 9394936 -907896 -420828 51 49 47
Russian Federation 8090136 8090771 8092100 1964 1329 49 49 49
Brazil 5690598 5397634 5151332 -539266 -246302 68 64 62
Low income 4652830 4368853 4092572 -560258 -276281 31 29 28
Canada 3101340 3101340 3101340 0 0 34 34 34
United States 2971070 3009602 3047876 76806 38274 32 33 33
China 1611126 1834179 2123873 512747 289694 17 20 23
European Union 1423830 1546458 1597946 174116 51487 35 36 38
Congo Democratic Republic 1597402 1566262 1535122 -62280 -31140 70 69 68
@dyorama
dyorama / forestdata.csv
Created April 10, 2015 17:02
Module 3, exercice 3
Latin America and Caribbean 10302831 9815764 9394936 -907896 -420828 51 49 47
Russian Federation 8090136 8090771 8092100 1964 1329 49 49 49
Brazil 5690598 5397634 5151332 -539266 -246302 68 64 62
Low income 4652830 4368853 4092572 -560258 -276281 31 29 28
Canada 3101340 3101340 3101340 0 0 34 34 34
United States 2971070 3009602 3047876 76806 38274 32 33 33
China 1611126 1834179 2123873 512747 289694 17 20 23
European Union 1423830 1546458 1597946 174116 51487 35 36 38
Congo Democratic Republic 1597402 1566262 1535122 -62280 -31140 70 69 68
@dyorama
dyorama / forestdata.csv
Created April 11, 2015 17:00
Module 3, Exercice 3, version 2
country forest1992Km2 forest2002Km2 forest2012Km2 forestLossorWin19922012 forestLossorWin20022012 forest1992% forest2002% forest2012%
Russia 8090136 8090771 8092100 1964 1329 49 49 49
Brazil 5690598 5397634 5151332 -539266 -246302 68 64 62
Canada 3101340 3101340 3101340 0 0 34 34 34
United States 2971070 3009602 3047876 76806 38274 32 33 33
China 1611126 1834179 2123873 512747 289694 17 20 23
European Union 1423830 1546458 1597946 174116 51487 35 36 38
Congo 1597402 1566262 1535122 -62280 -31140 70 69 68
Australia 1545840 1545200 1474520 -71320 -70680 20 20 19
Indonesia 1147178 987882 930620 -216558 -57262 63 55 51
@dyorama
dyorama / forestdata.csv
Created April 18, 2015 17:10
Module 4, exercice 4 (Joachim)
country forest1992Km2 forest2002Km2 forest2012Km2 forestLossorWin19922012 forestLossorWin20022012 forest1992% forest2002% forest2012%
Russia 8090136 8090771 8092100 1964 1329 49 49 49
Brazil 5690598 5397634 5151332 -539266 -246302 68 64 62
Canada 3101340 3101340 3101340 0 0 34 34 34
United States 2971070 3009602 3047876 76806 38274 32 33 33
China 1611126 1834179 2123873 512747 289694 17 20 23
Congo 1597402 1566262 1535122 -62280 -31140 70 69 68
Australia 1545840 1545200 1474520 -71320 -70680 20 20 19
Indonesia 1147178 987882 930620 -216558 -57262 63 55 51
India 642292 663176 687240 44948 24064 22 22 23
@dyorama
dyorama / forestdata.csv
Created April 20, 2015 13:51
Module 5, exercice 5 (Joachim)
country forest1992Km2 forest2002Km2 forest2012Km2 forestLossorWin19922012 forestLossorWin20022012 forest1992% forest2002% forest2012
Russia 8090136 8090771 8092100 1964 1329 49 49 49
Brazil 5690598 5397634 5151332 -539266 -246302 68 64 62
Canada 3101340 3101340 3101340 0 0 34 34 34
United States 2971070 3009602 3047876 76806 38274 32 33 33
China 1611126 1834179 2123873 512747 289694 17 20 23
Congo 1597402 1566262 1535122 -62280 -31140 70 69 68
Australia 1545840 1545200 1474520 -71320 -70680 20 20 19
Indonesia 1147178 987882 930620 -216558 -57262 63 55 51
India 642292 663176 687240 44948 24064 22 22 23
@dyorama
dyorama / forestdata.csv
Created April 23, 2015 23:28
Module 6 exercise
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 24 columns, instead of 16. in line 5.
country,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012
Russian Federation,8089500,8089500,8090136,8090455,8090773,8091092,8091411,8091729,8092048,8092366,8092685,8091728,8090771,8089814,8088857,8087900,8088500,8089100,8089700,8090300,8090900,8091500,8092100
Brazil,5748390,5719494,5690598,5661702,5632806,5603910,5575014,5546118,5517222,5488326,5459430,5428532,5397634,5366736,5335838,5304940,5282996,5261052,5239108,5217164,5195220,5173276,5151332
Canada,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340
United States,2963350,2967210,2971070,2974930,2978790,2982650,2986510,2990370,2994230,2998090,3001950,3005776,3009602,3013428,3017254,3021080,3024908,3028736,3032564,3036392,3040220,3044048,3047876
China,1571406,1591266,1611126,1630986,1650846,1670706,1690565,1710425,1730285,1750145,1770005,1802092,1834179,1866265,
@dyorama
dyorama / forestdata.csv
Created April 23, 2015 23:36
Module 6 exercise
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 24 columns, instead of 16. in line 5.
country,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012
Russian Federation,8089500,8089500,8090136,8090455,8090773,8091092,8091411,8091729,8092048,8092366,8092685,8091728,8090771,8089814,8088857,8087900,8088500,8089100,8089700,8090300,8090900,8091500,8092100
Brazil,5748390,5719494,5690598,5661702,5632806,5603910,5575014,5546118,5517222,5488326,5459430,5428532,5397634,5366736,5335838,5304940,5282996,5261052,5239108,5217164,5195220,5173276,5151332
Canada,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340,3101340
United States,2963350,2967210,2971070,2974930,2978790,2982650,2986510,2990370,2994230,2998090,3001950,3005776,3009602,3013428,3017254,3021080,3024908,3028736,3032564,3036392,3040220,3044048,3047876
China,1571406,1591266,1611126,1630986,1650846,1670706,1690565,1710425,1730285,1750145,1770005,1802092,1834179,1866265,