HANDLE_SLOTS定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Positions a handle will try, in order, measured in radii from the centroid.
Straight above is the ordinary answer and straight below was the whole of the fallback, which is one position more than none: it was added for two small provinces whose handles landed in the same few pixels, and it fixed exactly that pair. A third crowded region found both taken and went back on top of the first.
Every vertical slot is tried before any sideways one, which is not about looks. The handles are numbered west to east so they read as a row, and a handle shoved sideways can cross the one it was supposed to follow - moving it up or down instead keeps the numbers in the order the player reads them. Sideways is still there for the cluster that runs out of column.
インポート
import { HANDLE_SLOTS } from "@johnmorrisdotca/chizu";
定義
const HANDLE_SLOTS: readonly (readonly [number, number])[] = [
[0, -2.1],
[0, 2.1],
[0, -4.4],
[0, 4.4],
[0, -6.7],
[0, 6.7],
[-1.9, -1.5],
[1.9, -1.5],
[-1.9, 1.5],
[1.9, 1.5],
[-2.6, 0],
[2.6, 0],
]
例
import { HANDLE_SLOTS } from "@johnmorrisdotca/chizu";
// Where a number may sit, in radii from its region's centre, nearest first.
console.log(HANDLE_SLOTS.length, HANDLE_SLOTS[0]);
// 12 [ 0, -2.1 ]12 [ 0, -2.1 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。