An open API service indexing awesome lists of open source software.

https://github.com/sbachinin/bracketry

Visualize bracket of a knockout tournament in the browser
https://github.com/sbachinin/bracketry

bracket draws playoffs sports visualization-library

Last synced: 2 months ago
JSON representation

Visualize bracket of a knockout tournament in the browser

Awesome Lists containing this project

README

        

# [bracketry](https://sbachinin.github.io/bracketry-site) · [![test workflow](https://github.com/sbachinin/bracketry/actions/workflows/main.yml/badge.svg)](https://github.com/sbachinin/bracketry/actions/) [![npm](https://img.shields.io/npm/v/bracketry.svg?style=flat-square)](https://www.npmjs.com/package/bracketry) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/sbachinin/bracketry/blob/main/LICENSE.md)

JavaScript library that takes your data and draws the tree of a knockout tournament in the browser. Suitable (hopefully) for any kind of sport


![alt text](https://github.com/sbachinin/bracketry/blob/main/images/example.jpg?raw=true)


Bracketry is designed to draw _single elimination_ brackets. Technically you can use it to make [double elimination](https://en.wikipedia.org/wiki/Double-elimination_tournament) brackets too but it won't be that easy and the result won't look very nice (a lot of screen space will be left unused).


## Basic usage

```javascript
import { createBracket } from 'bracketry'

createBracket(your_data, your_wrapper_element)
```

_You only need a wrapper element (advisably with explicit height) and some properly formatted data_


## Some lovely features

   🎾 Tennis: doubles, tiebreak, points within a game (15:30 etc), "serving" dot
   🍏 Live updates
   🔦 Team's path within a tournament is highlighted on click (if you want)
   👯 Multiple brackets on a page
   📱 Can be easily tuned for mobile devices
   3️⃣ Third place match is possible


## Plenty of options (try)

* Sizes, margins and fonts are quite flexible
* Navigation between rounds can be adjusted or built from scratch
* Vertical scroll can work with mousewheel or buttons or both
* You can inject your own markup here and there. You may also choose to render matches yourself and use bracketry only as a positioning mechanism
* You can attach click handlers to matches (or their sides)
* It's possible to specify a number of rounds visible at a time


## Installation: npm or yarn

```bash
npm install bracketry
# or
yarn add bracketry
```


Minified bundle is 48k, gzipped is 12k.

Includes a __d.ts__ file for ease of TypeScript development


## Licensing

MIT