FigureNametype
The name of the picked figure and where to draw it, centred on x, with its baseline at y: clear above the figure, and never over a star's name.
Import it
import type { FigureName } from "@johnmorrisdotca/hoshi-stars/sky-labels";
Definition
interface FigureName {
text: string;
x: number;
y: number;
anchor: "middle";
}
Members
| Name | Type | Description |
|---|---|---|
text | string | The name with the look's case applied. |
x | number | The centre of the text and its baseline, in the page's pixels. It sits above the top of the figure; where the figure reaches the top of the view it goes below; and it steps clear of any box passed to |
y | number | |
anchor | "middle" |
Examples
import type { FigureName } from "@johnmorrisdotca/hoshi-stars/sky-labels";
const draw = (name: FigureName): string => `${name.text} at ${Math.round(name.x)},${Math.round(name.y)}`;
console.log(typeof draw);functionWhat it prints (run when this page was built)