Reference · Framing, geometry and quiz tools
HandleSpottype
A numbered region’s label position, native land anchor and leader geometry.
Import it
import type { HandleSpot } from "@johnmorrisdotca/chizu";
Definition
type HandleSpot = {
x: number;
y: number;
hx: number;
hy: number;
};
Members
| Name | Type | Description |
|---|---|---|
x | number | The region's own centre, where the stem starts. |
y | number | |
hx | number | Where the circle and its number sit. |
hy | number |
Examples
import { placeHandles, type HandleSpot } from "@johnmorrisdotca/chizu";
const [spot]: HandleSpot[] = placeHandles([{ item: "a", centroid: [50, 50] }], 5);
console.log(spot!.x, spot!.y, spot!.hx !== spot!.x || spot!.hy !== spot!.y);
// 50 50 true50 50 trueWhat it prints (run when this page was built)