g-loot / react-tournament-brackets

React component library for displaying bracket leaderboards
https://sleepy-kare-d8538d.netlify.app/?path=/story/components-bracket--bracket
GNU Lesser General Public License v2.1
219 stars 69 forks source link

Set SVG Height based on max of column lengths. #73

Open EjPlatzer opened 2 months ago

EjPlatzer commented 2 months ago

Currently, the height of the SVG is set based on the length of the first column. This works when the first round of the bracket is completely full. However, if the bracket is sparse (i.e. bye rounds are not shown), then it's possible for the first column to have fewer matches (and therefore be shorter) than later columns.

To fix this, I have updated the calls to calculateSVGDimensions. Before, the numOfRows param was always set to the length of columns[0]. Now, it is set to the maximum length of all columns.