CityLayoutOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What the names are laid out with: the most names, the text size in pixels and the dot's radius, and how squarely a city must face the viewer (0.12 by default).
インポート
import type { CityLayoutOptions } from "@johnmorrisdotca/chikyu-earth/realistic";
定義
interface CityLayoutOptions {
max: number;
size: number;
dot: number;
facing?: number;
measure?: (text: string) => number;
taken?: readonly {
left: number;
top: number;
width: number;
height: number;
}[];
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
max | number | |
size | number | |
dot | number | |
facing (省略可) | number | undefined | Cities that face the viewer less squarely than this are left out, so none crowds the limb (0.12). |
measure (省略可) | ((text: string) => number) | undefined | The width of a name as the browser draws it, in the font the name is drawn in (a canvas's |
taken (省略可) | readonly { left: number; top: number; width: number; height: number; }[] | undefined | Boxes another layer's names, rings and marks already take (left, top, width and height from the picture's top left): no name is put over one. |
例
import type { CityLayoutOptions } from "@johnmorrisdotca/chikyu-earth/realistic";
const options: CityLayoutOptions = { max: 24, size: 12, dot: 3 };
console.log(options.max);24出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。