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

MapBoxtype

A window on a map, in the map's own units: what an SVG viewBox says.

Import it

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

Definition

type MapBox = {
    x: number;
    y: number;
    width: number;
    height: number;
};

Members

NameTypeDescription
xnumber
ynumber
widthnumber
heightnumber

Examples

import WORLD from "@johnmorrisdotca/chizu/world";
import { boxToViewBox, type MapBox } from "@johnmorrisdotca/chizu";

const window: MapBox = { x: 0, y: 0, width: WORLD.width / 2, height: WORLD.height / 2 };
console.log(boxToViewBox(window));
// 0 0 500 244.5
0 0 500 244.5

What it prints (run when this page was built)

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