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

applyInsetTransformfunction

The same move, applied to a point: a centroid, so a handle follows its region.

Import it

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

Definition

function applyInsetTransform(point: readonly [number, number], transform: InsetTransform): [number, number]

Parameters

NameTypeDescription
pointreadonly [number, number]

The point in native canvas coordinates.

transformInsetTransform

The native inset scale and translation to apply.

Returns

[number, number]

The same move, applied to a point: a centroid, so a handle follows its region.

Examples

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

console.log(applyInsetTransform([100, 40], { scale: 0.5, x: 10, y: 20 }));
// [ 60, 40 ]
[ 60, 40 ]

What it prints (run when this page was built)

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