本文へ移動

Chizu地図

SVGの地図を描き、地域を表示範囲に収め、番号付きの注記や地理クイズを英語と日本語の名前で作れます。

「地図」は、土地や場所を図で表したものです。 名前について(英語)

目次

リファレンス · 表示範囲・形・クイズの道具

ChizuGroup型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A named group of places: a continent, a UN M49 subregion, or any set of codes a page names (the countries of the EU, Japan's Kanto region). The continents and subregions are CHIZU_CONTINENTS and CHIZU_SUBREGIONS; a map's own groups are regionGroups(map); and any list of codes works with groupMap, groupBox and groupTones.

インポート

import type { ChizuGroup } from "@johnmorrisdotca/chizu";

定義

interface ChizuGroup {
    code: string;
    kind: "continent" | "subregion" | "region";
    name: string;
    nameJa?: string;
    reading?: string;
    aliases?: string[];
    codes: string[];
}

メンバー

名前型説明
codestring

Its code: AS for a continent, the UN M49 number for a subregion (030), the English name for a group of a map's regions.

kind"continent" | "subregion" | "region"

What kind of group it is.

namestring
nameJa (省略可)string | undefined
reading (省略可)string | undefined

How nameJa is read, in kana.

aliases (省略可)string[] | undefined

Other names it goes by, in either language: Kansai and 関西 for Kinki.

codesstring[]

The codes of the places in it, in order.

例

import { CHIZU_SUBREGIONS } from "@johnmorrisdotca/chizu/names";
import type { ChizuGroup } from "@johnmorrisdotca/chizu";

const eastAsia: ChizuGroup = CHIZU_SUBREGIONS.find((group) => group.code === "030")!;
console.log(eastAsia.name, eastAsia.nameJa, eastAsia.codes.join(" "));
// Eastern Asia 東アジア CN HK JP KP KR MN MO TW
Eastern Asia 東アジア CN HK JP KP KR MN MO TW

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chizu 1.5.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。