ChizuDrawOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a drawing shows beyond the map itself. Every part is optional: a map alone is its land on its sea.
インポート
import type { ChizuDrawOptions } from "@johnmorrisdotca/chizu/draw";
定義
type ChizuDrawOptions = {
box?: MapBox;
language?: ChizuLanguage;
tones?: Readonly<Record<string, string>>;
colors?: Readonly<Record<string, string>>;
callouts?: readonly string[] | Omit<CalloutRequest, "box">;
labels?: boolean | readonly string[];
insetFrames?: boolean;
interactive?: boolean;
label?: string;
style?: boolean;
features?: readonly ChizuFeatureChoice[];
featureLayer?: ChizuFeatureLayer | null;
featureLabels?: boolean;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
box (省略可) | MapBox | undefined | The window to show: a part of the map, as |
language (省略可) | ChizuLanguage | undefined | The language of the names a screen reader hears, and of the labels. Default |
tones (省略可) | Readonly<Record<string, string>> | undefined | A tone for each region, by code: |
colors (省略可) | Readonly<Record<string, string>> | undefined | A colour for each region, by code: |
callouts (省略可) | readonly string[] | Omit<CalloutRequest, "box"> | undefined | Numbered circles in open water with leader lines to these regions ( |
labels (省略可) | boolean | readonly string[] | undefined | Print the names on the land: all the regions that are big enough to hold theirs, or just these. |
insetFrames (省略可) | boolean | undefined | Draw a dashed frame round each inset. Default true. |
interactive (省略可) | boolean | undefined | Give every region its |
label (省略可) | string | undefined | What a screen reader hears of the drawing, instead of "Map of the world". |
style (省略可) | boolean | undefined | Put |
features (省略可) | readonly ChizuFeatureChoice[] | undefined | Which named features to draw from |
featureLayer (省略可) | ChizuFeatureLayer | null | undefined | The map's named features: |
featureLabels (省略可) | boolean | undefined | Print the features' names. Default true. |
例
import WORLD from "@johnmorrisdotca/chizu/world";
import { drawChizu, type ChizuDrawOptions } from "@johnmorrisdotca/chizu/draw";
const options: ChizuDrawOptions = { language: "ja", tones: { JP: "selected" }, style: true };
console.log(drawChizu(WORLD, options).includes('data-tone="selected"'));
// truetrue出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。