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

CalloutPlacetype

One place a circle could sit, and where it sits on the search grid.

The row and column are carried rather than recovered, so asking whether a place is too near a circle already put down is a look at the handful of cells around it instead of a walk through every circle on the map.

Import it

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

Definition

type CalloutPlace = {
    x: number;
    y: number;
    row: number;
    col: number;
    sea: number;
};

Members

NameTypeDescription
xnumber
ynumber
rownumber
colnumber
seanumber

Water between the circle's edge and the nearest land, in radii, up to CALLOUT_ROOMY.

Examples

import { calloutSpaces, type CalloutPlace } from "@johnmorrisdotca/chizu";

const [first]: CalloutPlace[] = calloutSpaces(4, { x: 0, y: 0, width: 100, height: 100 }, { bottom: 0, right: 0 }, []);
console.log(typeof first!.x, typeof first!.sea);
// number number
number number

What it prints (run when this page was built)

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