Skip to the content

Taisen Brackets対戦

Knockout brackets as SVG, from a list of ties.

Taisen (対戦, たいせん) is Japanese for a matchup: two sides facing each other. About the name

Contents

Troubleshooting & FAQ

Troubleshooting

What to check when a bracket is empty, a name is missing, or the page shows nothing.

Nothing appears

  • The result of drawBracket is a string. Put it in the page (element.innerHTML = svg); logging it draws nothing.
  • On a plain page, the script needs type="module", and its address must end in the built file (see plain HTML and CDNs).
  • In a framework, give the string as HTML (React, Vue, Svelte and Angular).

A team shows its id instead of its name

A side named by an id that is not listed is a team of that name. List the teams once, with names, and name the sides by id: { matchups, teams }.

Two matchups have the same id

Each tie's id must be its own: the layout refuses two ties with the same one. Leave id out and the package numbers the ties.

A flag or a trophy is missing

The package draws no flag or trophy of its own. Give flags a function that returns the flag's SVG (such as one made from Hata), and emblems a function that draws an emblem. A team with no mark is drawn as its initials.

The picture is wider than the page

The SVG scales: give it width: 100%; height: auto in your CSS, or choose another size (wide, square, card or phone).

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/taisen-brackets 0.20.0.