Dottype
One dot of a sheet: a star, where it is on the page and the numbers it carries (a star the lines pass again has more than one).
Import it
import type { Dot } from "@johnmorrisdotca/hoshi-stars/sheets";
Definition
interface Dot {
star: Star;
x: number;
y: number;
r: number;
numbers: number[];
label: {
x: number;
y: number;
anchor: "start" | "middle" | "end";
};
ring: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
star | Star | |
x | number | |
y | number | |
r | number | The radius, in millimetres, from the star's brightness. |
numbers | number[] | The visit numbers, in drawing order; empty on a hard sheet. |
label | { x: number; y: number; anchor: "start" | "middle" | "end"; } | Where the number is written (its left or middle and its baseline) and which way it is anchored. |
ring | boolean | A new line starts here: the child lifts the pencil. |
Examples
import { dotsFigure, type Dot } from "@johnmorrisdotca/hoshi-stars/sheets";
const first: Dot = dotsFigure("Cru", { widthMm: 180, heightMm: 150 }).dots[0];
console.log(first.star.name ?? first.star.designation, first.numbers);Gacrux [ 1 ]What it prints (run when this page was built)