本文へ移動

Chizu地図

SVGの地図を描き、地域を表示範囲に収め、番号付きの注記や地理クイズを英語と日本語の名前で作れます。

「地図」は、土地や場所を図で表したものです。 名前について(英語)

目次

リファレンス · 表示範囲・形・クイズの道具

insetHoldsWhole関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

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

定義

function insetHoldsWhole(inset: ChizuInset): boolean

引数

名前型説明
insetChizuInset

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

戻り値

boolean

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

例

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chizu 1.5.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。