rankingNumberOnes関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The number ones as cards in a grid: a coloured panel with the 1, the flag, the name and the club or country, the points and a pill that says "#1 in -57 kg". Throws a RangeError for
no cards, a card with no category, an entry with no name, a colour that is not a hex code, columns that are not 1 to 4, or a bad size or theme.
インポート
import { rankingNumberOnes } from "@johnmorrisdotca/taisen-brackets";
定義
function rankingNumberOnes(source: NumberOnesSource, options?: NumberOnesOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
source | NumberOnesSource | The cards. |
options (省略可) | NumberOnesOptions | The columns, the colours, the size, the theme and the language. |
戻り値
string
The SVG, a string that begins with <svg.
例
import { rankingNumberOnes } from "@johnmorrisdotca/taisen-brackets";
const svg = rankingNumberOnes({
date: "October 2026",
cards: [
{ category: "-60 kg", entry: { name: { surname: "Nakamura", given: "Kenji" }, club: "Coastal Pine Judo", flag: "CA-BC", points: 1240 } },
{ category: "-66 kg", entry: { name: { surname: "Leclerc", given: "Mathieu" }, club: "Kestrel Valley Judo", flag: "CA-QC", points: 1175 } },
],
}, { size: "square" });
console.log(svg.includes("#1 in -66 kg"), svg.includes("LECLERC Mathieu"));true true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。