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

featureChosenfunction

Whether a feature is among the choices.

Import it

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

Definition

function featureChosen(feature: Pick<ChizuFeature, "kind" | "group">, choices: readonly ChizuFeatureChoice[]): boolean

Parameters

NameTypeDescription
featurePick<ChizuFeature, "group" | "kind">

The physical feature being classified or tested.

choicesreadonly ChizuFeatureChoice[]

Native physical-feature groups, kinds, water or all selections.

Returns

boolean

Whether a feature is among the choices.

Examples

import { featureChosen, type ChizuFeature } from "@johnmorrisdotca/chizu";

const lake = { kind: "lake", group: "lakes" } as Pick<ChizuFeature, "kind" | "group">;
console.log(featureChosen(lake, ["water"]), featureChosen(lake, ["rivers"]), featureChosen(lake, ["lake"]));
// true false true
true false true

What it prints (run when this page was built)

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