sbachinin / bracketry Goto Github PK
View Code? Open in Web Editor NEWVisualize bracket of a knockout tournament in the browser
Home Page: https://bracketry.app/
License: MIT License
Visualize bracket of a knockout tournament in the browser
Home Page: https://bracketry.app/
License: MIT License
const sampleData = {
rounds: [
{
name: "1st round"
},
{
name: "2nd round"
}
],
matches: [
{
title: "Match 1",
roundIndex: 0,
order: 0,
sides: [
{
contestantId: "163911",
scores: [
{
mainScore: "7",
isWinner: true
},
{
mainScore: "6",
isWinner: true
},
{
mainScore: "6",
isWinner: true
}
],
isWinner: true
},
{
contestantId: "163806",
scores: [
{
mainScore: "5"
},
{
mainScore: "2"
},
{
mainScore: "2"
}
]
}
]
},
{
title: "Match 2",
roundIndex: 0,
order: 1,
sides: [
{
contestantId: "163911",
scores: [
{
mainScore: "7",
isWinner: true
},
{
mainScore: "6",
isWinner: true
},
{
mainScore: "6",
isWinner: true
}
],
isWinner: true
},
{
contestantId: "163806",
scores: [
{
mainScore: "5"
},
{
mainScore: "2"
},
{
mainScore: "2"
}
]
}
]
},
{
title: "Match 3",
roundIndex: 0,
order: 2,
sides: [
{
contestantId: "163911",
scores: [
{
mainScore: "7",
isWinner: true
},
{
mainScore: "6",
isWinner: true
},
{
mainScore: "6",
isWinner: true
}
],
isWinner: true
},
{
contestantId: "163806",
scores: [
{
mainScore: "5"
},
{
mainScore: "2"
},
{
mainScore: "2"
}
]
}
]
},
{
title: "Match 4",
roundIndex: 0,
order: 3,
sides: [
{
contestantId: "163911",
scores: [
{
mainScore: "7",
isWinner: true
},
{
mainScore: "6",
isWinner: true
},
{
mainScore: "6",
isWinner: true
}
],
isWinner: true
},
{
contestantId: "163806",
scores: [
{
mainScore: "5"
},
{
mainScore: "2"
},
{
mainScore: "2"
}
]
}
]
},
{
title: "Semi Match 1",
roundIndex: 1,
order: 0,
sides: [
{
contestantId: "163911",
scores: [
{
mainScore: "7",
isWinner: true
},
{
mainScore: "6",
isWinner: true
},
{
mainScore: "6",
isWinner: true
}
],
isWinner: true
},
{
contestantId: "163806",
scores: [
{
mainScore: "5"
},
{
mainScore: "2"
},
{
mainScore: "2"
}
]
}
]
},
{
title: "SemiMatch 2",
roundIndex: 1,
order: 1,
sides: [
{
contestantId: "163911",
scores: [
{
mainScore: "7",
isWinner: true
},
{
mainScore: "6",
isWinner: true
},
{
mainScore: "6",
isWinner: true
}
],
isWinner: true
},
{
contestantId: "163806",
scores: [
{
mainScore: "5"
},
{
mainScore: "2"
},
{
mainScore: "2"
}
]
}
]
},
],
contestants: {
163806: {
entryStatus: "4",
players: [
{
title: "D. Medvedev",
nationality: "RU"
}
]
},
163911: {
entryStatus: "1",
players: [
{
title: "N. Djokovic",
nationality: "RS"
}
]
}
}
};
excuse my for the copy paste but im going crazy not being able to figure whats wrong here. started experimenting with samples an hour ago and for some reason, i just cant get past order 1 and the result is looking like this, am i missing something?
If the number of players is NOT a power of 2, e.g. there are 61 players instead of 64, then some players get a BYE (free pass to the second round).
How can this be done? e.g. I want (in singles) the lower side of a match to show "BYE". I can leave the contestantId empty, but then it just shows as blank.
First of all, thank you for the amazing work done so far! Have you ever considered rendering a double elimination bracket? Or is this perhaps already implemented? I'm fiddling with this library, which I have to say is the most promising implementation of brackets I've seen, but am somewhat lost in getting this to work for double elimination. Any hints or comments are very welcome.
I am going crazy here.
These data shows only match with order 0
{"rounds":[{"name":"Round 1"}],"matches":[{"roundIndex":0,"order":0,"sides":[{"contestantId":"65","scores":[{"mainScore":0,"isWinner":false}],"isWinner":false},{"contestantId":"56","scores":[{"mainScore":0,"isWinner":false}],"isWinner":false}]},{"roundIndex":0,"order":3,"sides":[{"contestantId":"55","scores":[{"mainScore":0,"isWinner":false}],"isWinner":false},{"contestantId":"66","scores":[{"mainScore":0,"isWinner":false}],"isWinner":false}]},{"roundIndex":0,"order":2,"sides":[{"contestantId":"57","scores":[{"mainScore":0,"isWinner":false}],"isWinner":false},{"contestantId":"67","scores":[{"mainScore":0,"isWinner":false}],"isWinner":false}]},{"roundIndex":0,"order":1,"sides":[{"contestantId":"64","scores":[{"mainScore":0,"isWinner":false}],"isWinner":false},{"contestantId":"54","scores":[{"mainScore":0,"isWinner":false}],"isWinner":false}]}],"contestants":{"65":{"players":[{"title":"Phuong Balistreri","nationality":"SK"}]},"56":{"players":[{"title":"Albert Fay","nationality":"MQ"}]},"55":{"players":[{"title":"Lonnie Beier","nationality":"IL"}]},"66":{"players":[{"title":"Arthur Volkman","nationality":"TK"}]},"57":{"players":[{"title":"Allie Cronin","nationality":"FK"}]},"67":{"players":[{"title":"Marci Streich","nationality":"KY"}]},"64":{"players":[{"title":"Adolph Senger","nationality":"FK"}]},"54":{"players":[{"title":"Brandy Mills","nationality":"MO"}]}}}
and these shows correct all matches
`
{"rounds":[{"name":"Round 1"},{"name":"Round 2"},{"name":"Round 3"}],"matches":[{"roundIndex":0,"order":1,"sides":[{"contestantId":"7","scores":[{"mainScore":44,"isWinner":true}],"isWinner":true},{"contestantId":"8","scores":[{"mainScore":12,"isWinner":false}],"isWinner":false}]},{"roundIndex":0,"order":2,"sides":[{"contestantId":"6","scores":[{"mainScore":45,"isWinner":false}],"isWinner":false},{"contestantId":"9","scores":[{"mainScore":77,"isWinner":true}],"isWinner":true}]},{"roundIndex":0,"order":3,"sides":[{"contestantId":"5","scores":[{"mainScore":34,"isWinner":true}],"isWinner":true},{"contestantId":"10","scores":[{"mainScore":11,"isWinner":false}],"isWinner":false}]},{"roundIndex":1,"order":0,"sides":[{"contestantId":"4","scores":[{"mainScore":33,"isWinner":true}],"isWinner":true},{"contestantId":"7","scores":[{"mainScore":11,"isWinner":false}],"isWinner":false}]},{"roundIndex":1,"order":1,"sides":[{"contestantId":"9","scores":[{"mainScore":44,"isWinner":false}],"isWinner":false},{"contestantId":"5","scores":[{"mainScore":55,"isWinner":true}],"isWinner":true}]},{"roundIndex":0,"order":0,"sides":[{"contestantId":"4","scores":[{"mainScore":25,"isWinner":true},{"mainScore":23,"isWinner":true}],"isWinner":true},{"contestantId":"11","scores":[{"mainScore":25,"isWinner":false},{"mainScore":12,"isWinner":false}],"isWinner":false}]},{"roundIndex":2,"order":0,"sides":[{"contestantId":"4","scores":[{"mainScore":45,"isWinner":true}],"isWinner":true},{"contestantId":"5","scores":[{"mainScore":32,"isWinner":false}],"isWinner":false}]},{"roundIndex":2,"order":1,"sides":[{"contestantId":"7","scores":[{"mainScore":44,"isWinner":true}],"isWinner":true},{"contestantId":"9","scores":[{"mainScore":12,"isWinner":false}],"isWinner":false}]}],"contestants":{"7":{"players":[{"title":"Briana Frami","nationality":"LK"}]},"8":{"players":[{"title":"Ian Hegmann","nationality":"ZM"}]},"6":{"players":[{"title":"Yong Abernathy","nationality":"AT"}]},"9":{"players":[{"title":"Timothy Bartoletti","nationality":"CA"}]},"5":{"players":[{"title":"Vern Kreiger","nationality":"SZ"}]},"10":{"players":[{"title":"Anisha Abernathy","nationality":"PR"}]},"4":{"players":[{"title":"Alan Bode","nationality":"CZ"}]},"11":{"players":[{"title":"Ali Gibson","nationality":"JE"}]}}}
`
I dont see any error in console, data are generated on backend by same function and visually it looks ok to me, but plenty of games do not show all matches and rounds.
Any clue why, or what to check?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.