From 8a3361f20d319b7617bbeef3a5b8682d0ae9e0b7 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Mon, 16 Aug 2021 18:48:49 +1000 Subject: [PATCH] Implement papers+votes report --- docs/options.md | 17 +++- html/index.html | 26 ++++-- html/index.js | 23 +++-- html/main.css | 13 ++- html/worker.js | 11 ++- src/election.rs | 11 ++- src/stv/gregory.rs | 24 +++++- src/stv/wasm.rs | 206 +++++++++++++++++++++++++++++++++++---------- 8 files changed, 257 insertions(+), 74 deletions(-) diff --git a/docs/options.md b/docs/options.md index d6e2c8d..3155102 100644 --- a/docs/options.md +++ b/docs/options.md @@ -166,6 +166,19 @@ OpenTally applies constraints using the Grey–Fitzgerald method. Whenever a can Multiple constraints are supported using the method described by Hill ([*Voting Matters* 1998;(9):2–4](http://www.votingmatters.org.uk/ISSUE9/P1.HTM)) and Otten ([*Voting Matters* 2001;(13):4–7](http://www.votingmatters.org.uk/ISSUE13/P3.HTM)). +## Report options + +### Report style + +* *Votes only*: The result sheet displays the number of votes held by each candidate at each stage of the count. +* *Ballots and votes*: The result sheet displays the number of votes *and ballot papers* held by each candidate at each stage of the count. + +This functionality is not available on the command line. + +### Display up to [n] d.p. (--pp-decimals) + +This option allows you to specify to how many decimal places votes will be reported in the results report. It does not affect the internal precision of calculations. + ## Numeric representation ### Numbers (-n/--numbers), Decimal places (--decimals) @@ -177,10 +190,6 @@ This dropdown allows you to select how numbers (vote totals, etc.) are represent * *Rational* (default): Numbers are represented exactly as fractions, resulting in the elimination of rounding error, but increasing computational complexity when the number of surplus transfers is very large. * *Float (64-bit)*: Numbers are represented as native 64-bit floating-point numbers. This is fast, but not recommended as unexpectedly large rounding errors may be introduced in some circumstances. -### Display up to [n] d.p. (--pp-decimals) - -This option allows you to specify to how many decimal places votes will be reported in the results report. It does not affect the internal precision of calculations. - ### Normalise ballots (--normalise-ballots) In the BLT file format, each set of preferences can have a specified weight – this is typically used to indicate multiple voters who had the same preferences. diff --git a/html/index.html b/html/index.html index 454bdf4..a9301e8 100644 --- a/html/index.html +++ b/html/index.html @@ -182,6 +182,27 @@
+
+ Report options: +
+
+ + +
+
@@ -203,11 +224,6 @@
-