Skip to content

Instantly share code, notes, and snippets.

@ginseng666
ginseng666 / index.html
Created April 22, 2015 12:15
Polling Data Austria 2006-2015
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Polling Data Austria 2006-2015</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1>Polling Data Austria, 2006-2015</h1>
<div id="teaser"><p>Newspapers publish opinion polls regularly. While single results for the so called "Sonntagsfrage" ("Who would you vote for at the moment?") fluctuate often, a time series can show some general trends - like a decline in support for SPOE and OEVP, the regain in strength of the FPOE (after almost breaking apart), the rise and fall of the BZOE after the death of its leader Joerg Haider or the limited success of new parties. Adding the margin of error shows another thing: Many times it is not possible to identify the strongest party with certainty. Since the last election in 2013 three parties are competing for the first place.</p>
@ginseng666
ginseng666 / data.csv
Last active August 29, 2015 14:19 — forked from jkeohan/data.csv
Location 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012
Australia 6.2 6 5.8 5.7 5.8 5.8 5.8 4.6 4.8 5.1 4.6
Austria 21.3 18.7 19.7 21 22.1 24.1 25.3 27.8 27.2 26.6 29.5
Belgium 1.3 1.5 1.6 2 2.3 2.7 3.1 3.8 4.2 4.9 5.1
Brazil 39.4 42 42.3 42.9 43.3 44.4 44.5 45.8 44 42.7 42.2
Canada 16.9 15.6 15.6 15.9 15.7 16.2 16.8 17.5 17.1 18 17.9
Chile 26.2 24.8 24.2 25.1 25.3 23.5 24.4 26.1 22 23.1 24.1
China (People's Republic of) 18.4 16.2 14.5 13.7 12.8 12.5 12.6 12.1 11.4 10.7 9.8
Czech Republic 3.7 3.4 3.8 4 4.2 4.7 4.9 5.8 6.3 6.9 7.5
Denmark 11 11.9 13.6 15 14.2 16.1 16.7 17.8 20 22.2 24.4
@ginseng666
ginseng666 / data_turnout.csv
Last active August 29, 2015 14:19
Elections, Lower Austria, changes in turnout and electorate
number name region electorate_1995 electorate_2015 votes_1995 votes_2015 turnout_1995 turnout_2015 turnout_change voters_change votes_change voters_change_p votes_change_p
32101 Absdorf 3 1260 1736 1088 1268 86.35 73.04 -13.31 476 180 37.78 16.54
31701 Achau 4 954 1277 819 794 85.85 62.18 -23.67 323 -25 33.86 -3.05
30801 Aderklaa 2 147 218 125 161 85.03 73.85 -11.18 71 36 48.30 28.80
31301 Aggsbach 1 719 763 585 618 81.36 81.00 -0.37 44 33 6.12 5.64
31001 Alberndorf im Pulkautal 2 685 820 559 580 81.61 70.73 -10.87 135 21 19.71 3.76
31302 Albrechtsberg an der grossen Krems 1 1078 1137 868 874 80.52 76.87 -3.65 59 6 5.47 0.69
30601 Alland 4 2246 2769 1590 1706 70.79 61.61 -9.18 523 116 23.29 7.30
32501 Allentsteig 1 2293 2110 1803 1496 78.63 70.90 -7.73 -183 -307 -7.98 -17.03
30501 Allhartsberg 3 1325 1805 1172 1461 88.45 80.94 -7.51 480 289 36.23 24.66
@ginseng666
ginseng666 / index.html
Created April 10, 2015 11:12
moving bars (from jkeohan)
<!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>
<style>
.allContent {
width:1000px;
@ginseng666
ginseng666 / index.html
Last active August 29, 2015 14:18
simple legend and transition
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>simple legend</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
.axis path, line
{
fill: none;
stroke: #d3d3d3;
@ginseng666
ginseng666 / data.csv
Last active August 29, 2015 14:18
Election results, Lower Austria, 1995 vs. 2015
number name eligible_voters_1995 eligible_voters_2015 Turnout_1995 Turnout_2015 OEVP_result_1995 OEVP_result_2015 SPOE_result_1995 SPOE_result_2015 Turnout_change OEVP_change SPOE_change
30401 Wiener Neustadt 31099 36431 68.72 57.39 21.21 33.94 49.70 40.30 -11.32 12.73 -9.40
30501 Allhartsberg 1325 1805 88.45 80.94 68.46 81.32 17.49 18.68 -7.51 12.86 1.18
30502 Amstetten 18538 20428 74.42 57.58 21.99 24.60 44.49 46.45 -16.84 2.61 1.96
30503 Ardagger 2379 2985 84.53 79.03 68.06 72.32 12.37 12.16 -5.50 4.26 -0.20
30504 Aschbach-Markt 2585 3206 81.32 73.33 69.63 49.22 17.09 11.90 -7.98 -20.40 -5.19
30506 Behamberg 2219 2918 84.99 70.77 65.57 58.60 25.10 27.80 -14.23 -6.97 2.70
30507 Biberbach 1519 1979 84.07 77.21 72.24 70.27 20.54 13.36 -6.86 -1.98 -7.18
30508 Ennsdorf 1755 2551 79.20 64.68 13.67 26.90 65.06 61.55 -14.52 13.23 -3.51
30509 Ernsthofen 1636 1985 85.45 74.96 55.12 54.08 44.88 41.70 -10.49 -1.04 -3.17
volgnr jaar aantal_verleend aantal_geweigerd aantal_totaal gevraagd_bedrag_geweigerd gevraagd_bedrag_verleend gevraagd_bedrag_totaal verleend_bedrag
1 2011 37 25 62 694114 284960 979074 508982
2 2012 25 27 52 627500 160273 787773 486000
3 2013 34 31 65 689550 271225 960775 494000
4 2014 26 14 40 552000 185720 737720 384500
@ginseng666
ginseng666 / index.html
Last active August 29, 2015 14:18
Vienna map, mouseover-example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Vienna</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
body {
background-color: #606060;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Exercise: Module 3</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: #dddddd;
} svg {
@ginseng666
ginseng666 / data.csv
Last active August 29, 2015 14:18
Slope Chart: Election Results, Lower Austria, 1995 vs. 2015
number name eligible_voters_1995 eligible_voters_2015 invalid_votes_1995 invalid_votes_2015 valid_votes_1995 valid_votes_2015 seats_to_fill_1995 seats_to_fill_2015 oevp_votes_1995 oevp_votes_2015 oevp_seats_1995 oevp_seats_2015 spoe_votes_1995 spoe_votes_2015 spoe_seats_1995 spoe_seats_2015
30401 Wiener Neustadt 31099 36431 536 290 20834 20619 40 40 4419 6998 9 14 10355 8310 22 17
30501 Allhartsberg 1325 1805 40 42 1132 1419 19 21 775 1154 14 17 198 265 3 4
30502 Amstetten 18538 20428 436 330 13360 11432 41 41 2938 2812 9 10 5944 5310 19 20
30503 Ardagger 2379 2985 54 65 1957 2294 23 23 1332 1659 16 17 242 279 3 3
30504 Aschbach-Markt 2585 3206 54 31 2048 2320 23 23 1426 1142 16 12 350 276 4 2
30506 Behamberg 2219 2918 65 36 1821 2029 21 23 1194 1189 14 14 457 564 5 6
30507 Biberbach 1519 1979 16 38 1261 1490 19 21 911 1047 14 15 259 199 4 3
30508 Ennsdorf 1755 2551 22 22 1368 1628 21 21 187 438 3 6 890 1002 14 13
30509 Ernsthofen 1636 1985 32 18 1366 1470 21 21 753 795 12 12 613 613 9 9