RankingOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a ranking can be told: the style (podium, list or featured), rows and page, columns, movement arrows, name and rank style, and the size, theme and language.
インポート
import type { RankingOptions } from "@johnmorrisdotca/taisen-brackets";
定義
interface RankingOptions extends BoardOptions {
style?: "podium" | "list" | "featured";
big?: number;
columns?: 1 | 2;
rows?: number;
page?: number;
split?: boolean;
medals?: boolean;
movement?: "arrow" | "row" | "both" | "none";
nameStyle?: "surname-first" | "given-first" | "as-is";
rankStyle?: "plain" | "hash";
precision?: number;
ties?: boolean;
sort?: "given" | "points";
categories?: boolean;
badge?: boolean;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
style (省略可) | "podium" | "list" | "featured" | undefined |
|
big (省略可) | number | undefined | How many rows, from the top, are big (0 to 3). Default by |
columns (省略可) | 2 | 1 | undefined | One column or two for the compact rows (the first column runs down before the second starts). Default 1, and 2 for |
rows (省略可) | number | undefined | The most entries drawn, from the first of the page. Default: as many as fit at a readable size. |
page (省略可) | number | undefined | Which page of |
split (省略可) | boolean | undefined | On a wide board (at least 3:2) the big rows go in a panel on the left and the compact ones beside them, in place of one above the other. Default true; |
medals (省略可) | boolean | undefined | Tint the rows of ranks 1 to 3 gold, silver and bronze. Default: on for |
movement (省略可) | "none" | "arrow" | "row" | "both" | undefined | How movement is shown: |
nameStyle (省略可) | "surname-first" | "given-first" | "as-is" | undefined |
|
rankStyle (省略可) | "plain" | "hash" | undefined |
|
precision (省略可) | number | undefined | Decimals for numeric points ( |
ties (省略可) | boolean | undefined | Equal points share a rank where an entry names none ( |
sort (省略可) | "points" | "given" | undefined |
|
categories (省略可) | boolean | undefined | Write each entry's own |
badge (省略可) | boolean | undefined | Draw a club's (or the athlete's) initials on a badge for an entry with no flag or mark, even where no entry has one. Default: only where some entry has a flag or mark. |
size (省略可) | BoardSizeName | { width: number; height: number; } | undefined | One of |
theme (省略可) | "auto" | "light" | "dark" | undefined |
|
flags (省略可) | FlagRenderer | undefined | Draws a flag from its code, as for |
flagHref (省略可) | ((code: string) => string | null | undefined) | undefined | The address of a flag as a picture to load, tried where |
flagShape (省略可) | "round" | "square" | undefined |
|
locale (省略可) | string | Locale | undefined | The language: |
words (省略可) | Partial<Words> | undefined | |
title (省略可) | string | undefined | The |
id (省略可) | string | undefined | Prefix for the drawing's ids. Default: a hash of the state and the options. |
className (省略可) | string | undefined |
例
import { rankingList, type RankingOptions } from "@johnmorrisdotca/taisen-brackets";
const options: RankingOptions = { style: "list", precision: 2, size: "portrait", movement: "arrow" };
console.log(rankingList({ entries: [
{ name: { surname: "Nakamura", given: "Kenji" }, club: "Coastal Pine Judo", flag: "CA-BC", points: 412.5, change: 1 },
{ name: { surname: "Brar", given: "Harpreet" }, club: "Salmonberry Judo Club", flag: "CA-BC", points: 398, change: -1 },
{ name: { surname: "Leclerc", given: "Mathieu" }, club: "Kestrel Valley Judo", flag: "CA-QC", points: 366.25, change: 4 },
] }, options).includes("412.50"));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。