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

insetHoldsWholefunction

Whether a box holds its region whole, rather than only some of its pieces (outlyingBelow, within).

Import it

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

Definition

function insetHoldsWhole(inset: ChizuInset): boolean

Parameters

NameTypeDescription
insetChizuInset

The native inset placement and optional restriction to part of a region.

Returns

boolean

Whether a box holds its region whole, rather than only some of its pieces (outlyingBelow, within).

Examples

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

const box = { x: 0, y: 0, width: 10, height: 10 };
console.log(insetHoldsWhole({ code: "AK", box }), insetHoldsWhole({ code: "46", box, outlyingBelow: 900 }));
// true false
true false

What it prints (run when this page was built)

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