Skip to the content

Hoshi Stars星

The stars you can see without a telescope, with names, colours and distances; the 88 constellations with their lines and boundaries; the Messier objects; and seven map projections to draw them on.

Hoshi is the Japanese word 星 for a star. About the name

Contents

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

NameTypeDescription
titlestring

The name for the picture's <title> and aria-label.

outlinesreadonly (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, for a figure that has no boundary (a Chinese asterism).

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 outlines has points.

neighbourOutlines (optional)readonly (readonly SkyPoint[])[] | undefined

The outlines of the neighbouring regions, drawn faint round the frame; leave out for none.

segmentsreadonly (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 data-hr. Every other star in the frame is drawn faint.

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);
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hoshi-stars 0.47.0.