Skip to content

Instantly share code, notes, and snippets.

@HuVas
HuVas / d3.hemicycle.js
Last active March 16, 2016 08:52 — forked from michalskop/d3.hemicycle.js
Hemicycle: a single vote event
d3.hemicycle = function() {
function hemicycle(selection) {
selection.each(function(d, i) {
// options
var nvar = (typeof(n) === "function" ? n(d) : n),
gapvar = (typeof(gap) === "function" ? gap(d) : gap),
widthIconvar = (typeof(widthIcon) === "function" ? widthIcon(d) : widthIcon),
widthvar = (typeof(width) === "function" ? width(d) : width);
peoplevar = (typeof(people) === "function" ? people(d) : people);
country_name variacion
Honduras [HND] 29.53
Korea. Dem. Rep. [PRK] 24.22
Zimbabwe [ZWE] 19.33
Cambodia [KHM] 18.31
Timor-Leste [TMP] 17.32
Virgin Islands (U.S.) [VIR] 16.46
Indonesia [IDN] 14.44
Myanmar [MMR] 13.87
Paraguay [PRY] 13.05
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 81 columns, instead of 24. in line 1.
country_name,country_code,grupo,porc_1990,porc_1991,porc_1992,porc_1993,porc_1994,porc_1995,porc_1996,porc_1997,porc_1998,porc_1999,porc_2000,porc_2001,porc_2002,porc_2003,porc_2004,porc_2005,porc_2006,porc_2007,porc_2008,porc_2009,porc_2010,porc_2011,porc_2012,porc_2013,km2_1961,km2_1962,km2_1963,km2_1964,km2_1965,km2_1966,km2_1967,km2_1968,km2_1969,km2_1970,km2_1971,km2_1972,km2_1973,km2_1974,km2_1975,km2_1976,km2_1977,km2_1978,km2_1979,km2_1980,km2_1981,km2_1982,km2_1983,km2_1984,km2_1985,km2_1986,km2_1987,km2_1988,km2_1989,km2_1990,km2_1991,km2_1992,km2_1993,km2_1994,km2_1995,km2_1996,km2_1997,km2_1998,km2_1999,km2_2000,km2_2001,km2_2002,km2_2003,km2_2004,km2_2005,km2_2006,km2_2007,km2_2008,km2_2009,km2_2010,km2_2011,km2_2012,km2_2013,km2_2014
Afganistán,AFG,0,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.0678246
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 81 columns, instead of 24. in line 1.
country_name,country_code,grupo,porc_1990,porc_1991,porc_1992,porc_1993,porc_1994,porc_1995,porc_1996,porc_1997,porc_1998,porc_1999,porc_2000,porc_2001,porc_2002,porc_2003,porc_2004,porc_2005,porc_2006,porc_2007,porc_2008,porc_2009,porc_2010,porc_2011,porc_2012,porc_2013,km2_1961,km2_1962,km2_1963,km2_1964,km2_1965,km2_1966,km2_1967,km2_1968,km2_1969,km2_1970,km2_1971,km2_1972,km2_1973,km2_1974,km2_1975,km2_1976,km2_1977,km2_1978,km2_1979,km2_1980,km2_1981,km2_1982,km2_1983,km2_1984,km2_1985,km2_1986,km2_1987,km2_1988,km2_1989,km2_1990,km2_1991,km2_1992,km2_1993,km2_1994,km2_1995,km2_1996,km2_1997,km2_1998,km2_1999,km2_2000,km2_2001,km2_2002,km2_2003,km2_2004,km2_2005,km2_2006,km2_2007,km2_2008,km2_2009,km2_2010,km2_2011,km2_2012,km2_2013,km2_2014
Afganistán,AFG,0,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.0678246
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 27 columns, instead of 17. in line 3.
country_name,grupo,country_code,año_1990,año_1991,año_1992,año_1993,año_1994,año_1995,año_1996,año_1997,año_1998,año_1999,año_2000,año_2001,año_2002,año_2003,año_2004,año_2005,año_2006,año_2007,año_2008,año_2009,año_2010,año_2011,año_2012,año_2013
Aruba,0,ABW,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333
Afganistán,0,AFG,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648
Angola,0,AGO,48.90992219,48.80981792,48.70971364,48.60960937,48.50950509,48.40940082,48.30929654,48.20919227,48.10908799,48.00898372,47.90887944,47.80877517,47.70867089,47
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 27 columns, instead of 17. in line 3.
country_name,grupo,country_code,año_1990,año_1991,año_1992,año_1993,año_1994,año_1995,año_1996,año_1997,año_1998,año_1999,año_2000,año_2001,año_2002,año_2003,año_2004,año_2005,año_2006,año_2007,año_2008,año_2009,año_2010,año_2011,año_2012,año_2013
Aruba,0,ABW,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333
Afganistán,0,AFG,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648
Angola,0,AGO,48.90992219,48.80981792,48.70971364,48.60960937,48.50950509,48.40940082,48.30929654,48.20919227,48.10908799,48.00898372,47.90887944,47.80877517,47.70867089,47
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 26 columns, instead of 25. in line 3.
Country Name,Country Code,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013
Aruba,ABW,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333
Andorra,AND,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319
Afganistán,AFG,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 26 columns, instead of 25. in line 3.
Country Name,Country Code,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013
Aruba,ABW,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333,2.333333333
Andorra,AND,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319,34.04255319
Afganistán,AFG,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2.067824648,2
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 25 columns, instead of 14. in line 5.
Country,Dwellings without basic facilities,Housing expenditure,Rooms per person,Household net adjusted disposable income,Household net financial wealth,Employment rate,Job security,Long-term unemployment rate,Personal earnings,Quality of support network,Educational attainment,Student skills,Years in education,Air pollution,Water quality,Consultation on rule-making,Voter turnout,Life expectancy,Self-reported health,Life satisfaction,Assault rate,Homicide rate,Employees working very long hours,Time devoted to leisure and personal care
Australia,1.1,20,2.3,31588,47657,72,4.8,1.08,50449,92,76,512,19.4,13,91,10.5,93,82.1,85,7.3,2.1,0.8,14.02,14.41
Austria,1,21,1.6,31173,49887,72,3.9,1.19,45199,89,83,500,17,27,94,7.1,75,81,69,6.9,3.4,0.4,7.61,14.46
Belgium,2,21,2.2,28307,83876,62,5,3.88,48082,94,72,509,18.9,21,87,4.5,89,80.5,74,6.9,6.6,1.1,4.57,15.71
Canada,0.2,21,2.5,29365,67913,72,6.4,0.9,46911,92,89,522,17.2,15,91,10.5,61,81.5,89,7.3,1.3,1.5,3.94,14.25
Chile,9.4,18,1.2,14533,17733,62,4.4,1.59,22101,86,57,436,16.