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 · Names on the brightest stars and the constellation figures as faint lines, for a sky you draw yourself: a count or a magnitude, the figure under the pointer at full strength, a body that covers part of the sky, and a look set by settings alone

StarNameLabeltype

One name to draw: the star, the text with the look's case applied, and where everything goes, in the page's pixels. The objects are reused by the next update; copy what you keep.

Import it

import type { StarNameLabel } from "@johnmorrisdotca/hoshi-stars/sky-labels";

Definition

interface StarNameLabel {
    hr: number;
    text: string;
    magnitude: number;
    x: number;
    y: number;
    textX: number;
    textY: number;
    anchor: "start" | "end" | "middle";
    designation: string;
    designationX: number;
    designationY: number;
    ring: number;
    x0: number;
    y0: number;
    x1: number;
    y1: number;
    leader: boolean;
    leaderX0: number;
    leaderY0: number;
    leaderX1: number;
    leaderY1: number;
}

Members

NameTypeDescription
hrnumber

The star's Bright Star Catalogue number.

textstring

The name to draw, with the look's case applied.

magnitudenumber

The star's visual magnitude.

xnumber

Where the star is on the screen.

ynumber
textXnumber

Where to draw the text: its baseline start (anchor start), end (end) or middle (middle, for a name above or below its star).

textYnumber
anchor"start" | "middle" | "end"
designationstring

The catalogue letter to write under the name (α Ori), or an empty text when the look leaves it out or the star has none; where its baseline starts (anchor as for the name).

designationXnumber
designationYnumber
ringnumber

The radius of the ring to draw round the star; 0 for none.

x0number

The box the name and its catalogue letter take together.

y0number
x1number
y1number
leaderboolean

The short line from the star to the text, from (leaderX0, leaderY0) to (leaderX1, leaderY1); leader is false when the look has none.

leaderX0number
leaderY0number
leaderX1number
leaderY1number

Examples

import type { StarNameLabel } from "@johnmorrisdotca/hoshi-stars/sky-labels";

const show = (label: StarNameLabel): string => `${label.text} at ${Math.round(label.x)},${Math.round(label.y)}`;
console.log(typeof show);
function

What it prints (run when this page was built)

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