Ranked voting tabulation widget

What this is....

This is a widget for showing the results of a ranked ballot election as a pairwise matrix, as well as scores that are consistent with pairwise methods.

Most of the methods are Cordorcet, but it also does plurality and IRV. You may notice both plurality and IRV may be inconsistent with the scores.

The candidates are are in order, top to bottom, by running the tabulation method to determine the winner, then reprocessing the ballots (or the pairwise matrix) after removing the winning candidatesto determine the second position.... and then continuing on down.

The scores (i.e. the bar chart) are calculated by comparing each candidate to all other candidates that have an equal number or greater pairwise wins, to get a relative score. It has to happen iteratively, normalizing them to add up to 100 after each round. If there is a Condorcet winner, the ratio of the winner's score to the runner-up's score will be equivalent to the ratio of the number of people who preferred one to the other. It gets a little bit more complicated as you go down because we are comparing to all other candidates that have an equal or greater number of pairwise ones. It is therefore possible for a candidate that is above another to have a lower score.... but this is more likely (and actually makes sense) the lower those candidates are ranked.

I need to work on making this work well on phones and touchscreens. You can tap on any of the cells on the matrix to see an explanation and it will highlight the "mirror image" cell and explain the relationship. It's a little better with a computer and a mouse where you can just hover over it and get the interactivity.

More work is to be done. This will be open source, is highly modular and doesn't rely on any Javascript frameworks, so it can easily be dropped into forums etc. (a version where the matrix is given pre-tabulated matrix data, is here. The display (the matrix) and the tabulation are completely separate, you can use one or the other. And it is designed so the code is very "chatbot compatible".... I will be making some YouTube videos showing how you can code extensions to it without needing to know how to actually code. Most of this was coded by dictating in natural English to Claude and ChatGPT.