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

placesFromTextfunction

The regions a paste names. Order is the paste's, because somebody who wrote them in lesson order meant that order. A name written twice adds the place once.

Import it

import { placesFromText } from "@johnmorrisdotca/chizu";

Definition

function placesFromText(text: string, regions: readonly Named[], options?: MatchOptions): PastedPlaces

Parameters

NameTypeDescription
textstring

Pasted names or serialized attribute text specified by this signature.

regionsreadonly Named[]

The native regions available for matching or layout.

options (optional)MatchOptions

The optional native drawing, matching, layout or quiz settings described by this signature.

Returns

PastedPlaces

The regions a paste names. Order is the paste's, because somebody who wrote them in lesson order meant that order. A name written twice adds the place once.

Examples

import WORLD from "@johnmorrisdotca/chizu/world";
import { placesFromText } from "@johnmorrisdotca/chizu";

console.log(placesFromText("Japan, フランス\nBrazil, Narnia", WORLD.regions));
// { codes: [ 'JP', 'FR', 'BR' ], missing: [ 'Narnia' ] }
{ codes: [ 'JP', 'FR', 'BR' ], missing: [ 'Narnia' ] }

What it prints (run when this page was built)

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