A layer to convert Toornament data to brackets-viewer.js data.
You can use this to view Toornament stages with your own personalized viewer without embedding Toornament's viewer.
You need to give data for one tournament at a time.
Toornament API routes needed:
/stages
to have the list of stages/bracket-nodes
to have thesource_node_id
property (used to have theposition
property)/matches/{match_id}/games
for each match (if you know you have child matches, i.e. Bo3, Bo5, ...)
The input is constructed as this:
Note: If match_games
is omitted, the child_count
will be set to 0
.
First, do npm start
. This will generate the database file db.json
.
To quickly test the results, you can use json-server
.
npx json-server ./output/db.json
Then, open the ./demo/index.html
file from the brackets-viewer.js project.
And tada! You are viewing Toornament data with your own viewer! 🎉
This library has been created to be used by the Nantarena.