Releases: lzear/votes
votes@3.0.0
Major Changes
- 63568c3: Update
lodash
tolodash-es
. Change the package to be ESM by
default.
votes@2.2.2
Patch Changes
- 91eeb7a: Update some dependencies
votes@2.2.1
votes@2.2.0
Minor Changes
-
1165f3e: Fix the LP solver used in Randomized Condorcet and Maximal
Lotteries.The methods should still be tested more deeply, but at least they should be
less buggy now. Their warnings and deprecation notices are removed with this
release.
votes@2.1.1
Patch Changes
- 674d485: Add IIFE bundle
v2.0.6 Minimax-TD, no `array.at`, misc. utils, Minimax variants
Patch Changes since 2.0.4
2.0.6
c30f99b: Add Minimax-TD2.0.5
04ba095: Removearray.at
from the codebase2.0.4
9c462a6: Add utils to categorise methods (random, needs ballots, needs matrix)2.0.3
Add the variants for Minimax Condorcet
[Generated notes] What's Changed since 1.8.4
- ci: add project-token param to Codacy coverage report script by @lzear in #53
- V2 by @lzear in #63
- Minimax variations by @lzear in #65
- chore: plausible by @lzear in #66
- Some documentation + Minimax in demo by @lzear in #67
- Add categories utils by @lzear in #69
- chore(deps): bump moment from 2.29.2 to 2.29.4 by @dependabot in #70
- chore(deps): bump ejs from 3.1.6 to 3.1.8 by @dependabot in #68
- Version Packages by @lzear in #71
- Add release script by @lzear in #72
- Remove
Array.at
from the library codebase by @lzear in #77 - chore: Update nextjs_bundle_analysis by @lzear in #81
- Nextjs bundle analysis by @lzear in #82
- fixup: action-download-artifact by @lzear in #83
- ci: cache yarn by @lzear in #84
- Add Minimax-TD by @lzear in #80
- chore(deps): bump terser from 5.12.1 to 5.15.1 by @dependabot in #78
- Version Packages by @lzear in #85
Full Changelog: https://github.com/lzear/votes/compare/v1.8.4...votes@2.0.6
v2.0.2
Major Changes
-
Complete refactor of
votes
The old functions were getting difficult to work with, as I was trying to add tie-breaking mechanisms (not included in this release) and adding new systems.
New API
Old:
import { utils as voteUtils, VotingSystem } from 'votes' const scores = scoresFromBallots( [ { ranking: [['Lion'], ['Bear'], ['Sheep']], weight: 4 }, { ranking: [['Sheep'], ['Bear'], ['Lion']], weight: 3 }, { ranking: [['Bear', 'Sheep'], ['Lion']], weight: 2 }, ], ['Lion', 'Bear', 'Sheep'], VotingSystem.Schulze, ) // -> { Lion: 0, Bear: 2, Sheep: 1 } const ranking = scoresToRanking({ Bear: 2, Lion: 0, Sheep: 1 }) // -> [ [ 'Bear' ], [ 'Sheep' ], [ 'Lion' ] ]
New:
import { Borda } from 'votes' const borda = new Borda({ candidates: ['Lion', 'Bear', 'Sheep'], ballots: [ { ranking: [['Lion'], ['Bear'], ['Sheep']], weight: 4 }, { ranking: [['Sheep'], ['Bear'], ['Lion']], weight: 3 }, { ranking: [['Bear', 'Sheep'], ['Lion']], weight: 2 }, ], }) const scores = borda.scores() // -> { Bear: 10, Lion: 8, Sheep: 9} const ranking = borda.ranking() // -> [ [ 'Bear' ], [ 'Sheep' ], [ 'Lion' ] ]
Monorepo
The repository now also contains the code for a demo, which will be hosted on www.rank-votes.vercel.app
Back to classes
My implementation of the voting systems keep on alternating between classes and some attempts of object composition. This time it was refactored to classes.
Added systems
-
Random candidate: Selects a random ranking, regardless of ballots.
-
Random dictator: Selects a random ballot that decides the ranking.
-
Bottom-two-runoff: take the two options with the fewest first preference votes. The pairwise loser out of those two options is eliminated. Repeat.
-
Full Changelog: v1.8.4...v2.0.2