ChizuMap型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A map: a canvas and its regions. What every file of data holds, and what every function of the engine takes.
インポート
import type { ChizuMap } from "@johnmorrisdotca/chizu";
定義
interface ChizuMap {
id: string;
kind: "world" | "country" | "divisions" | "local";
name: string;
nameJa?: string;
regionName: string;
regionNamePlural: string;
viewBox: string;
width: number;
height: number;
wraps: boolean;
projection: ChizuProjection;
insets: ChizuInset[];
source: string;
regions: ChizuRegion[];
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | string |
|
kind | "world" | "country" | "divisions" | "local" | What its regions are: the whole |
name | string | The map's name in English and Japanese. |
nameJa (省略可) | string | undefined | |
regionName | string | What a region is called here, singular and plural, in English: |
regionNamePlural | string | |
viewBox | string | The canvas: |
width | number | |
height | number | |
wraps | boolean | Whether its east edge is its west edge: a map of the earth is a cylinder cut open, and pans round without stopping. |
projection | ChizuProjection | |
insets | ChizuInset[] | The regions drawn in boxes of their own. |
source | string | Where the outlines come from, in a line. |
regions | ChizuRegion[] |
例
import WORLD from "@johnmorrisdotca/chizu/world";
import type { ChizuMap } from "@johnmorrisdotca/chizu";
const map: ChizuMap = WORLD;
console.log(map.id, map.kind, map.viewBox, map.regions.length, map.wraps);
// world world 0 0 1000 489 173 trueworld world 0 0 1000 489 173 true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。