This repository has been archived on 2021-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
pyRCV2/html/index.html

207 lines
5.5 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>pyRCV2</title>
<style type="text/css">
html, body {
font-family: 'Liberation Sans', FreeSans, Helvetica, Arial, sans-serif;
}
table {
border-collapse: collapse;
}
td {
padding: 0px 8px;
2020-12-23 19:19:11 +11:00
min-height: 1em;
}
td.count {
text-align: right;
}
tr:first-child td {
vertical-align: bottom;
}
td.excluded {
background-color: #fecfcfff;
}
td.elected {
background-color: #d1fca7ff;
}
tr.info td {
background-color: #edededff;
}
i.sep::after {
content: "•";
color: #ccc;
}
</style>
</head>
<body>
<div>
<input type="file" id="bltFile">
<button onclick="clickCount()">Count</button>
<i class="sep"></i>
<label>
Preset:
<select id="selPreset" onchange="changePreset()">
<option value="scottish" selected>Scottish STV</option>
<!--<option value="stvc">pyRCV STV-C</option>-->
<option value="senate">Australian Senate STV</option>
2020-10-18 21:47:59 +11:00
<option value="wright">Wright STV</option>
<option value="prsa77">PRSA 1977</option>
2021-01-01 22:26:57 +11:00
<option value="ers97">ERS97</option>
</select>
</label>
<i class="sep"></i>
<button id="btnAdvancedOptions" onclick="clickAdvancedOptions()">Show advanced options</button>
<!--GITREV-->
<i class="sep"></i>
2020-12-24 21:33:09 +11:00
<a href="https://yingtongli.me/blog/2020/12/24/pyrcv2.html">Information and instructions</a>
</div>
<div id="divAdvancedOptions" style="display: none;">
2021-01-01 22:26:57 +11:00
<label>
Numbers:
<select id="selNumbers">
<option value="native">Native</option>
<option value="rational">Rational</option>
<option value="fixed" selected>Fixed</option>
</select>
</label>
<i class="sep"></i>
<label>
Decimal places (if Numbers = Fixed):
<input type="number" id="txtDP" value="5" style="width: 3em;">
</label>
<br>
<label>
Quota:
<select id="selQuotaCriterion">
<option value="geq" selected>&gt;=</option>
<option value="gt">&gt;</option>
</select>
</label>
<label>
<select id="selQuota">
<option value="droop" selected>Droop</option>
<option value="droop_exact">Droop (exact)</option>
<option value="hare">Hare</option>
<option value="hare_exact">Hare (exact)</option>
</select>
</label>
<label>
2021-01-01 22:26:57 +11:00
<select id="selQuotaMode">
<option value="static" selected>Static quota</option>
<option value="progressive">Progressive quota</option>
<option value="ers97">Static with ERS97 rules</option>
</select>
</label>
<i class="sep"></i>
<label>
<input type="checkbox" id="chkBulkElection" checked>
Bulk election
</label>
2021-01-01 22:26:57 +11:00
<i class="sep"></i>
<label>
<input type="checkbox" id="chkBulkExclusion">
2021-01-01 22:26:57 +11:00
Bulk exclusion
</label>
<i class="sep"></i>
<label>
<input type="checkbox" id="chkDeferSurpluses">
Defer surpluses
</label>
<br>
<label>
2021-01-01 22:26:57 +11:00
<input type="checkbox" id="chkRoundQuota" checked>
Round quota to
</label>
<label>
2021-01-01 22:26:57 +11:00
<input type="number" id="txtRoundQuota" value="0" style="width: 3em;">
d.p.
</label>
<i class="sep"></i>
<label>
<input type="checkbox" id="chkRoundVotes">
Round votes to
</label>
<label>
<input type="number" id="txtRoundVotes" value="0" style="width: 3em;">
d.p.
</label>
<i class="sep"></i>
2021-01-01 22:26:57 +11:00
<label>
<input type="checkbox" id="chkRoundTVs">
Round transfer values to
</label>
<label>
<input type="number" id="txtRoundTVs" value="0" style="width: 3em;">
d.p.
</label>
<i class="sep"></i>
<label>
<input type="checkbox" id="chkRoundWeights">
Round ballot weights to
</label>
<label>
<input type="number" id="txtRoundWeights" value="0" style="width: 3em;">
d.p.
</label>
<br>
<label>
Surplus order:
<select id="selSurplus">
<option value="size" selected>By size</option>
<option value="order">By order</option>
</select>
</label>
<i class="sep"></i>
<label>
2020-10-18 21:47:59 +11:00
Method:
<select id="selTransfers">
<option value="wig" selected>Weighted inclusive Gregory</option>
<option value="uig">Unweighted inclusive Gregory</option>
2020-12-29 02:43:37 +11:00
<option value="eg">Exclusive Gregory (last bundle)</option>
2020-10-18 21:47:59 +11:00
<option value="wright">Wright STV</option>
</select>
</label>
2020-12-29 02:43:37 +11:00
<label>
<select id="selPapers">
<option value="both" selected>Include non-transferable papers</option>
<option value="transferable">Use transferable papers only</option>
</select>
</label>
<label>
<select id="selExclusion">
<option value="one_round" selected>Exclude in one round</option>
<option value="parcels_by_order">Exclude by parcel (by order)</option>
<!--<option value="parcels_by_value">Exclude by parcel (by value)</option>-->
<option value="by_value">Exclude by value</option>
<option value="wright">Wright method (re-iterate)</option>
2020-12-29 02:43:37 +11:00
</select>
</label>
<br>
<label>
2020-12-24 00:04:30 +11:00
Ties:
<select id="selTies">
2020-12-24 01:36:39 +11:00
<option value="backwards_random" selected>Backwards then random</option>
<option value="random">Random</option>
2020-12-27 23:28:16 +11:00
<option value="prompt">Prompt</option>
</select>
</label>
<i class="sep"></i>
<label>
Random seed:
2020-12-24 00:04:30 +11:00
<input type="text" id="txtSeed" value="">
</label>
</div>
<table id="result"></table>
<script src="vendor/BigInt_BigRat-a5f89e2.min.js"></script>
<script src="vendor/big-6.0.0.min.js"></script>
<script src="vendor/sjcl-1.0.8.min.js"></script>
<script src="bundle.js"></script>
<script src="index.js"></script>
</body>
</html>