dol-match-bracket

0.0.6 • Public • Published

dol-match-bracket

  • Javascript Library to make tree structured tournament brackets.
  • using Recursion to generate tournament bracket based on match JSON not team JSON(example below)

Install

  • npm install
$ npm install
  • gulp Development Mode - local server and watch
$ gulp dev
  • gulp bulid
$ gulp
or
$ gulp build

Common Structure.

├── dol-bracket-match
    ├── dol-bracket-main
        └── dol-bracket-item  
            (information: score, team name ex= team1 vs team2)
    └── dol-bracket-sub
        └── dol-bracket-match (dol-bracket-left or dol-bracket-right)
            ├── dol-bracket-main
                └── dol-bracket-item
            └── dol-bracket-sub
                ...

Data Example

<body>
<div id="dol-bracket"></div>
const arr = [
        {
          id: 1, //required
          school1: 'a', //required -> team1 name
          score1: 9,   //team1 score
          score2: 4,   //team1 score
          school2: 'b',  //required -> team2 name
          state: 'ended',
          next: 3, //required this indicates parents bracket idx
        },
        ...
        ]
   MakeDolBracket('#dol-bracket', arr, {});
</body>
  • result:
                  (final)  
          |`team3or4 : team5or6`| 
    (semi-final)     |     (semi-final)
  |`team3: team4`|       |`team5: team6`|
  ...

Package Sidebar

Install

npm i dol-match-bracket

Weekly Downloads

9

Version

0.0.6

License

ISC

Unpacked Size

38.9 kB

Total Files

12

Last publish

Collaborators

  • cksdnd004