0.0.20 • Published 7 years ago

react-tournament-grid v0.0.20

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Simple component to render tournament grid

This small package presents simple components to implement tournament grid UI with transparent data model.

NPM Page

Installation

yarn add react-tournament-bracket

Data model

Series

Series is object that has following structure:

{
  stage: 2,
  order: 6,
  firstTeamId: 2,
  secondTeamId: 15,
  games: [{...}, ..., {...}]
}

Game

Game is used to count series score.

{
  firstTeamResult: 'win',
  secondTeamResult: 'loose'
}

Score is counting according to number of won games for each team. For example, in following example score will be 2:1:

{
  stage: 0,
  order: 0,
  games: [
    {
      firstTeamResult: 'win',
      secondTeamResult: 'loose'
    },
    {
      firstTeamResult: 'loose',
      secondTeamResult: 'win'
    },
    {
      firstTeamResult: 'draw',
      secondTeamResult: 'draw'
    },
    {
      firstTeamResult: 'win',
      secondTeamResult: 'loose'
    }
  ]
}

Notes

  • Currently support only single-elimination grid type
  • Root series (i.e. Grand-Final) is represented with (stage: 0, order: 0) series
  • Tree depth is calculated based on max stage in input series array. For example you have max stage equal 2, hence tree will be of depth 3 and it will has (2^3 - 1) = 7 series.
  • Missed series will have 'TBD' titles.

ToDo

  • Documentation
  • Examples

Contributions

Any contributions are highly appreciated.

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago