Skip to content

Instantly share code, notes, and snippets.

@pm5
Last active August 29, 2015 14:07
Show Gist options
  • Save pm5/5660f9cb0ee630e253bd to your computer and use it in GitHub Desktop.
Save pm5/5660f9cb0ee630e253bd to your computer and use it in GitHub Desktop.
Comparison of Deposit Systems in Taiwanese Elections

Comparison of Deposit Systems in Taiwanese Elections

Deposit systems among several countries divided by minimum wages.

台灣選舉保證金圖表

對於小黨、獨立參選人而言,登記候選人時所繳交的保證金,是選舉的第一道實質門檻。

各國的選舉保證金制度不同,也有些國家(例如德國)認為保證金制度妨害人民參政權,裁定其違憲。如果把台灣與其它國家的選舉保證金額度並列,並且除以當地的法定基本工資,以檢視基層人民的參政權,結果會怎麼樣呢?

有一件事情是圖表沒有畫出來的。台灣總統登記參選的保證金為新台幣 1500 萬元,是直轄巿巿長參選保證金(200 萬元)的 7.5 倍,屬於極端值,已經從資料中剔除。

{
".at": 1413012594000,
"NTD": 1.0000,
"JPY": 3.5405,
"GBP": 0.0205,
"EUR": 0.0260,
"HKD": 0.2553,
"SGD": 0.0420
}
{
"mayor of london": {
"country": "UK",
"title": "倫敦巿長",
"amount": 10000,
"currency": "GBP",
"reference": "http://en.wikipedia.org/wiki/Mayor_of_London"
},
"memer of assembly of london": {
"country": "UK",
"title": "倫敦議會議員",
"amount": 1000,
"currency": "GBP",
"reference": "https://en.wikipedia.org/wiki/London_Assembly"
},
"member of lower house of japan": {
"country": "JP",
"title": "眾議院議員",
"amount": 3000000,
"currency": "JPY",
".at": "2014/2/9",
"reference": "http://en.wikipedia.org/wiki/Deposit_%28politics%29#Japan"
},
"member of upper house of japan": {
"country": "JP",
"title": "參議院議員",
"amount": 3000000,
"currency": "JPY",
".at": "2014/2/9",
"reference": "http://en.wikipedia.org/wiki/Deposit_%28politics%29#Japan"
},
"mayor of tokyo": {
"country": "JP",
"title": "東京都知事",
"amount": 3000000,
"currency": "JPY",
".at": "2014/2/9",
"reference": "http://ja.wikipedia.org/wiki/%E4%BE%9B%E8%A8%97%E9%87%91"
},
"legislator of tokyo": {
"country": "JP",
"title": "東京都議會議員",
"amount": 600000,
"currency": "JPY",
".at": "1994",
"reference": "http://ja.wikipedia.org/wiki/%E4%BE%9B%E8%A8%97%E9%87%91"
},
"member of legislative council of hong kong": {
"country": "HK",
"title": "立法會議員",
"amount": 50000,
"currency": "HKD",
"reference": "http://en.wikipedia.org/wiki/Deposit_%28politics%29#Hong_Kong"
},
"mayor of taiwan special municipality": {
"country": "TW",
"title": "直轄巿巿長",
"amount": 2000000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"legislator of taiwan special municipality": {
"country": "TW",
"title": "直轄巿議員",
"amount": 200000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"mayor of taiwan county": {
"country": "TW",
"title": "縣長",
"amount": 200000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"mayor of taiwan provincial city": {
"country": "TW",
"title": "縣轄巿長",
"amount": 200000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"legislator of taiwan county": {
"country": "TW",
"title": "縣議員",
"amount": 120000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"legislator of taiwan provincial city": {
"country": "TW",
"title": "縣轄巿議員",
"amount": 120000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"mayor of taiwn town": {
"country": "TW",
"title": "鄉鎮巿長",
"amount": 120000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"representative of taiwn town": {
"country": "TW",
"title": "鄉鎮巿民代表",
"amount": 50000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"vallage chief of taiwan": {
"country": "TW",
"title": "里長",
"amount": 50000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"legislative yuan memeber of taiwan": {
"country": "TW",
"title": "立法委員",
".at": "2011/10/14",
"amount": 200000,
"currency": "NTD",
"reference": "http://web.cec.gov.tw/files/15-1000-14724,c3383-1.php"
},
"president of taiwan": {
"show": false,
"country": "TW",
"title": "總統",
"amount": 15000000,
"currency": "NTD",
"reference": "http://law.moj.gov.tw/LawClass/LawAll.aspx?PCode=D0020053"
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>選舉保證金制度</title>
<script src="//d3js.org/d3.v3.min.js"></script>
</head>
<body>
<div id="chart"></div>
<script>
function chart() {
var margin = { left: 30, top: 20, right: 180, bottom: 20 };
var width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var base = 'min-wage';
var xScale = d3.scale.linear()
.range([0, width]);
var yScale = d3.scale.linear()
.range([0, height]);
function deposit(d) {
return d.value;
}
function minWage(d) {
return d.minWage;
}
function base(b) {
if (b !== undefined) {
base = b;
}
return base;
}
function normalize(data) {
if (base === 'currency') {
data.forEach(function (d) {
d.value = d.amount / d.currency;
});
} else if (base === 'min-wage') {
data.forEach(function (d) {
d.value = d.amount / d.minWage;
});
}
return data;
}
function joinData(depositData, currencyData, wageData) {
var data = [];
for (var name in depositData) {
var d = depositData[name];
d.minWage = wageData[d.country].amount;
d.currency = currencyData[d.currency];
d.countryName = wageData[d.country].name;
data.push(d);
}
return data;
}
function filterData(data) {
return data.filter(function (d) { return d.show === undefined || d.show; });
};
function scaleData(data) {
xScale.domain([0, d3.max(data, deposit)]);
yScale.domain([0, data.length]);
return data;
}
function loadData(done) {
d3.json("wage.json", function (wageData) {
d3.json("currency.json", function (currencyData) {
d3.json("deposit.json", function (depositData) {
done(filterData(joinData(depositData, currencyData, wageData)));
});
});
});
}
function draw(selection) {
var svg = selection.append("svg")
.attr("height", height + margin.top + margin.bottom)
.attr("width", width + margin.left + margin.right)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
loadData(function (data) {
data = normalize(data);
data = scaleData(data);
var bar = svg.selectAll("g.bar")
.data(data)
.enter().append("g")
.attr("class", "bar")
.attr("transform", function (d, i) { return "translate(0," + yScale(i) + ")"; });
bar.on("mouseover", function () {
d3.select(this).classed("focused", true);
console.log(this);
});
bar.on("mouseout", function () {
d3.select(this).classed("focused", false);
console.log(this);
});
bar.append("rect")
.attr("class", "deposit")
.attr("width", function (d) { return xScale(deposit(d)); })
.attr("height", yScale(1) * 0.6);
bar.append("rect")
.attr("class", "min-wage")
.attr("width", function (d) { return xScale(minWage(d) * 160 / d.minWage); })
.attr("height", yScale(1) * 0.3)
.attr("transform", "translate(0," + (yScale(1) * 0.35) + ")");
bar.append("text")
.text(function (d) { return d.countryName + "·" + d.title; })
.attr("x", width + 16)
.attr("y", 14)
.attr("style", "text-anchor: start");
});
}
return draw;
}
d3.select("#chart")
.call(chart());
</script>
<style>
#chart .bar text {
font-size: 14px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
fill: #555;
}
#chart .bar.focused text {
fill: #000;
}
#chart .bar rect {
shape-rendering: crispEdges;
}
#chart .bar rect.deposit {
fill: rgb(66, 146, 198);
}
#chart .bar rect.min-wage {
fill: rgb(254, 196, 79);
}
#chart .bar.focused rect.deposit {
fill: rgb(33, 113, 181);
}
#chart .bar.focused rect.min-wage {
fill: rgb(254, 153, 41);
}
#chart .wage-160 {
fill: none;
stroke: black;
stroke-dasharray: 10, 4;
shape-rendering: crispEdges;
}
</style>
</body>
</html>
{
"TW": {
"name": "台灣",
"amount": 120.0,
"currency": "NTD",
"reference": "https://zh.wikipedia.org/wiki/%E5%8F%B0%E7%81%A3%E5%9F%BA%E6%9C%AC%E5%B7%A5%E8%B3%87"
},
"UK": {
"name": "英國",
"amount": 6.19,
"currency": "GBP",
"reference": "https://zh.wikipedia.org/wiki/%E6%9C%80%E4%BD%8E%E5%B7%A5%E8%B3%87#.E8.8B.B1.E5.9C.8B",
".at": "2012/10/1"
},
"JP": {
"name": "日本",
"amount": 888.0,
"currency": "JPY",
"reference": "http://www.mhlw.go.jp/stf/seisakunitsuite/bunya/koyou_roudou/roudoukijun/minimumichiran/index.html",
".at": "2013/9/26"
},
"HK": {
"name": "香港",
"amount": 30.0,
"currency": "HKD",
"reference": "https://zh.wikipedia.org/zh-tw/%E6%9C%80%E4%BD%8E%E5%B7%A5%E8%B3%87#.E9.A6.99.E6.B8.AF"
},
"DE": {
"name": "德國",
"amount": 8.6,
"currency": "EUR",
"reference": "https://zh.wikipedia.org/wiki/%E6%9C%80%E4%BD%8E%E5%B7%A5%E8%B3%87#.E5.BE.B7.E5.9C.8B",
".at": "2015"
},
"SG": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment