drawBracket関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Draws a bracket as an SVG string. input is a list of matchups, { matchups, teams } or a layout from layoutBracket.
The same input and options always give the same string: no clock, no random number, no counter.
インポート
import { drawBracket } from "@johnmorrisdotca/taisen-brackets";
定義
function drawBracket(input: BracketLayout | readonly Matchup[] | BracketInput, options?: DrawOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
input | readonly Matchup[] | BracketInput | BracketLayout | The matchups, a |
options (省略可) | DrawOptions | The look, size, theme, language, background and everything else a drawing can be told. |
戻り値
string
The SVG, a string that begins with <svg, with its own style and no script.
例
import { drawBracket } from "@johnmorrisdotca/taisen-brackets";
const svg = drawBracket([{ sides: ["Aurora", "Harbour"], score: [2, 1] }, { sides: ["Cascade", "Delta"], score: [0, 1] }, { sides: ["Aurora", "Delta"], score: [3, 1] }], { theme: "dark", size: "square" });
console.log(svg.startsWith("<svg"));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。