Skip to the content

Chizu地図

Draw SVG maps, frame regions, place numbered callouts and build geography quizzes with English and Japanese names.

Chizu is the Japanese word 地図 for map. About the name

Contents

Reference · Framing, geometry and quiz tools

ChizuGrouptype

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 it

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

Definition

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

Members

NameTypeDescription
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 (optional)string | undefined
reading (optional)string | undefined

How nameJa is read, in kana.

aliases (optional)string[] | undefined

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

codesstring[]

The codes of the places in it, in order.

Examples

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

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chizu 1.5.0.