sbachinin / bracketry

Visualize bracket of a knockout tournament in the browser
https://bracketry.app/
MIT License
11 stars 0 forks source link

Cant go beyond order:1 #1

Closed Savvassidi closed 8 months ago

Savvassidi commented 8 months ago

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?

Screenshot 2024-03-08 210028

Savvassidi commented 8 months ago

closed, found out rounds should align

sbachinin commented 8 months ago

Ok, feel free to ask any questions, I'd be happy to help