ChizuPortPlaced型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A placed mark: where it is on the canvas, in the copy of the canvas it was drawn in.
インポート
import type { ChizuPortPlaced } from "@johnmorrisdotca/chizu";
定義
type ChizuPortPlaced = {
port: ChizuPort;
x: number;
y: number;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
port | ChizuPort | |
x | number | |
y | number |
例
import WORLD from "@johnmorrisdotca/chizu/world";
import { placePorts, wholeMapBox, type ChizuPortPlaced } from "@johnmorrisdotca/chizu";
const kobe = { id: "kobe", kind: "harbour", name: { en: "Kobe" }, country: "JP", lat: 34.68, lon: 135.2, tier: 1 } as const;
const placed: ChizuPortPlaced[] = placePorts(WORLD, [kobe], wholeMapBox(WORLD), [0]);
console.log(placed[0]?.port.id, placed.length);
// kobe 1kobe 1出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。