Coder Social home page Coder Social logo

dominikpeters / abcvoting-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 1.9 MB

An online app for computing approval based committee election rules.

Home Page: https://pref.tools/abcvoting/

License: MIT License

HTML 5.86% JavaScript 7.28% CSS 1.82% Python 84.37% Makefile 0.08% Shell 0.01% TeX 0.56%

abcvoting-app's Introduction

abcvoting-app

An online app for computing approval based committee election rules. Available at https://pref.tools/abcvoting/.

The app is based on the abcvoting python package developed by Martin Lackner and others. It is run in the browser using pyodide (a Python interpreter compiled in WebAssembly). ILPs are solved using the HiGHS solver, run in the browser using the highs-js WebAssembly compilation.

screenshot

Overview

The ABC Voting app is built using the following technologies:

  • abcvoting: A Python package developed by Martin Lackner and others for computing approval-based committee election rules.
  • pyodide: A Python interpreter compiled in WebAssembly, used to run Python code in the browser.
  • HiGHS: A solver for integer linear programming (ILP) problems, compiled to WebAssembly: highs-js.

The app allows users to input approval-based voting profiles, compute committee election rules, generate random profiles, and explore the axiomatic properties and algorithms used to find the selected committees.

Repository Structure

The repository is structured as follows:

  • index.html: The main HTML file that serves as the entry point for the app.
  • js/: Contains the JavaScript modules that make up the app's functionality.
    • abcvoting.js: The main module that orchestrates the app's functionality.
    • globalState.js: Manages the global state of the app (current profile etc.).
    • InstanceManagement.js: Provides functions for managing the voting profile.
    • CalculateRules.js: Handles the computation of committee election rules.
    • TableBuilder.js: Builds the table for displaying voting profiles and results.
    • SettingsManagement.js: Manages app settings.
    • constants.js: Defines constants used throughout the app (e. g., names of voting rules).
    • ExportModal.js: Implements the export functionality for saving voting profiles.
    • FileDrop.js: Handles drag-and-drop functionality for importing voting profiles.
    • LibraryModal.js: Implements the library modal for selecting pre-defined voting profiles.
    • loadPython.js: Loads the Python interpreter and required packages.
    • logger.js: Provides logging functionality.
    • Randomizer.js: Generates random voting profiles.
    • RuleSelection.js: Handles the user selection of which committee election rules to display.
    • clipboard.js: Provides functionality for copying and pasting voting profiles.
    • URL.js: Handles URL-related functionality.
    • utils.js: Contains utility functions used throughout the app.
  • imports/: Contains external libraries and dependencies.
    • highs.js: The HiGHS solver compiled to WebAssembly.
    • hystmodal.min.js: A library for creating modal dialogs.

Usage

To use the ABC Voting app, simply open index.html in a web browser (served via a web server which can be started with python -m http.server, for example). The app will load the necessary dependencies and provide an interface for inputting voting profiles, computing committee election rules, and exploring the results.

Users can input voting profiles manually, import profiles from files, or generate random profiles. The app computes the selected committees using various approval-based committee election rules and displays the results in a table. Users can click on a selected committee to view its axiomatic properties and the algorithm used to find it.

Dependencies

The app relies on the following external dependencies:

  • pyodide: A Python interpreter compiled to WebAssembly.
  • HiGHS: A solver for integer linear programming problems.
  • hystmodal: A library for creating modal dialogs.
  • popper.js: A library for positioning tooltips and popovers.
  • tippy.js: A library for creating tooltips.

These dependencies are loaded via CDN links in the index.html file.

Contributing

Contributions to the ABC Voting app are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

The ABC Voting app is open-source software licensed under the MIT License.

abcvoting-app's People

Contributors

dominikpeters avatar oriyalperin avatar

Stargazers

Sajan Maharjan avatar

Watchers

 avatar

Forkers

ariel-research

abcvoting-app's Issues

[Feature] Allow voters to be weighted

This is supported by the underlying abcvoting library and would make constructing examples easier. The best UI is not clear though. To not clutter, it should probably be shown optionally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.