Reference · A picture of each of the 88 constellations, in light and dark
ThumbnailInputtype
What to draw: the region to frame, the lines of the figure, and which stars belong to it. The IAU constellations come from constellationThumbnail; this is the shape another set of figures fills in.
Import it
import type { ThumbnailInput } from "@johnmorrisdotca/hoshi-stars/thumbnails";
Definition
interface ThumbnailInput {
title: string;
outlines: ReadonlyArray<ReadonlyArray<SkyPoint>>;
frame?: ReadonlyArray<SkyPoint>;
neighbourOutlines?: ReadonlyArray<ReadonlyArray<SkyPoint>>;
segments: ReadonlyArray<readonly [
SkyPoint,
SkyPoint
]>;
owns: (star: Star) => boolean;
leastSpan?: number;
seeNeighbours?: boolean;
ringed?: ReadonlyArray<number>;
}
Members
| Name | Type | Description |
|---|---|---|
title | string | The name for the picture's |
outlines | readonly (readonly SkyPoint[])[] | The closed outlines of the region to frame (degrees, J2000), each with its first point repeated as the last. Their extent decides the frame; they are drawn with a faint wash inside. Leave empty, and give |
frame (optional) | readonly SkyPoint[] | undefined | Positions to frame when the figure has no outline: the picture is framed round them (with the same room, and a least width of 4 degrees) and no boundary or wash is drawn. Ignored where |
neighbourOutlines (optional) | readonly (readonly SkyPoint[])[] | undefined | The outlines of the neighbouring regions, drawn faint round the frame; leave out for none. |
segments | readonly (readonly [SkyPoint, SkyPoint])[] | The lines of the figure, each between two positions on the sky (the stars it joins). |
owns | (star: Star) => boolean | True for a star that belongs to the figure: it is drawn in full and carries its |
leastSpan (optional) | number | undefined | The least width of the picture in degrees where it has outlines (default 13, so a small constellation still shows its neighbours). |
seeNeighbours (optional) | boolean | undefined | True to widen the picture, a little at a time and no further than a constellation's 13 degrees, until a neighbouring boundary crosses it, so the faint boundary lines show in every picture (default false). |
ringed (optional) | readonly number[] | undefined | Bright Star Catalogue (HR) numbers of stars to draw with a ring round them in the accent colour: a single named star inside its constellation's figure. |
Examples
import { thumbnailSvg, type ThumbnailInput } from "@johnmorrisdotca/hoshi-stars/thumbnails";
const input: ThumbnailInput = {
title: "A triangle",
outlines: [[{ rightAscension: 80, declination: 0 }, { rightAscension: 90, declination: 0 }, { rightAscension: 85, declination: 8 }, { rightAscension: 80, declination: 0 }]],
segments: [],
owns: () => true,
};
console.log(thumbnailSvg(input).length > 100);trueWhat it prints (run when this page was built)