Skip to content

Releases: lzear/votes

votes@3.0.0

27 Feb 20:04
e14aa35
Compare
Choose a tag to compare

Major Changes

  • 63568c3: Update lodash to lodash-es. Change the package to be ESM by
    default.

votes@2.2.2

27 Feb 11:22
Compare
Choose a tag to compare

Patch Changes

  • 91eeb7a: Update some dependencies

votes@2.2.1

24 Jun 12:57
Compare
Choose a tag to compare

Patch Changes

votes@2.2.0

16 Apr 13:54
56efd2d
Compare
Choose a tag to compare

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

26 Mar 08:41
Compare
Choose a tag to compare

Patch Changes

v2.0.6 Minimax-TD, no `array.at`, misc. utils, Minimax variants

07 Nov 22:59
6c62648
Compare
Choose a tag to compare

Patch Changes since 2.0.4

[Generated notes] What's Changed since 1.8.4

Full Changelog: https://github.com/lzear/votes/compare/v1.8.4...votes@2.0.6

v2.0.2

16 Apr 13:32
Compare
Choose a tag to compare

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

v1.9.1

12 Dec 15:46
Compare
Choose a tag to compare
v1.9.1 Pre-release
Pre-release

1.9.1 (2021-12-12)

Bug Fixes

  • revert "feat: use microbundle instead of rollup" (a51737e)

v1.9.0

12 Dec 15:01
Compare
Choose a tag to compare
v1.9.0 Pre-release
Pre-release

1.9.0 (2021-12-12)

Features

  • use microbundle instead of rollup (5199cdd)

v1.8.4

08 Mar 17:45
8866da8
Compare
Choose a tag to compare

1.8.4 (2021-03-08)

Bug Fixes

  • package.json & yarn.lock to reduce vulnerabilities (48f56ca)