npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

relative-placement-js

v1.0.1

Published

JavaScript Relative Placement calculator for dance competitions.

Downloads

15

Readme

RelativePlacementJS

build status

This library provide a placement system with the relative placement algorithm used in West Coast Swing dance competitions.

Understading relative placement

Relative placement is a placement system where electors (judges) provide there own placement of each candidates.

The algorithm consist to search for each place a majority of votes for a candidate at this placement or a greater placement.

You can refer to this explain from boogiebythebay.org for all details.

Get RelativePlacementJS

npm install relative-placement-js --save

With node:

var RelativePlacement = require('relative-placement-js');

With browser:

<script src="{BASE_PATH}/node_modules/relative-placement-js/dist/relative-placement-es2015.js"></script>
<!-- Or the original ES6 sources -->
<script src="{BASE_PATH}/node_modules/relative-placement-js/lib/relative-placement.js"></script> 

With AngularJS:

angular.module('myApp', ['relative-placement-js']).controller('MyCtrl', [
    '$scope', 'RelativePlacement',
    function($scope, RelativePlacement){
        
    }
]);

Use RelativePlacementJS

var contest = new RelativePlacement();

contest.addCandidates(['A','B','C']);
contest.addCandidate('D');

contest.addVote(['A','B','C','D']);
contest.addVotes([
    ['A','B','C','D'],
    ['A','C','B','D'],
    ['A','B','D','C'],
    ['B','A','C','D'],
    ['B','A','D','C']
]);

var result = contest.getResult(); // return ['A','B','C','D'];