regionGroups関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The groups a map's regions fall in, by their group, in the order the map first names them: the continents on the
world, the eight regions on Japan's prefectures, the four Census regions on the United States'.
インポート
import { regionGroups } from "@johnmorrisdotca/chizu";
定義
function regionGroups(map: Pick<ChizuMap, "regions">): ChizuGroup[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
map | Pick<ChizuMap, "regions"> | The native map or map fields required by this signature; coordinates and region codes belong to its canvas. |
戻り値
ChizuGroup[]
The groups a map's regions fall in, by their group, in the order the map first names them: the continents on the world, the eight regions on Japan's prefectures, the four Census regions on the United States'.
例
import WORLD from "@johnmorrisdotca/chizu/world";
import { regionGroups } from "@johnmorrisdotca/chizu";
const groups = regionGroups(WORLD);
console.log(groups.map((group) => `${group.name} ${group.codes.length}`).join(", "));
// Asia 46, Europe 39, Africa 50, North America 18, South America 13, Oceania 7Asia 46, Europe 39, Africa 50, North America 18, South America 13, Oceania 7出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。