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 star drawn from its numbers as SVG, and next to the Sun

PortraitOptionstype

How a portrait or a comparison is drawn.

Import it

import type { PortraitOptions } from "@johnmorrisdotca/hoshi-stars/portrait";

Definition

interface PortraitOptions {
    size?: number;
    lang?: "en" | "ja";
    name?: string;
    background?: "space" | "none";
    captions?: boolean;
}

Members

NameTypeDescription
size (optional)number | undefined

The width in pixels (the picture scales, so this only sets its default size). Default 240 for a portrait and 360 for a comparison.

lang (optional)"en" | "ja" | undefined

The language of the words in the picture: "en" (default) or "ja".

name (optional)string | undefined

The star's name, used in the picture's title and, in the comparison, as the star's label.

background (optional)"none" | "space" | undefined

Draw the dark sky behind ("space", the default) or leave the picture transparent ("none").

captions (optional)boolean | undefined

Print the lines "drawn from its numbers, not a photo" and "a generic look, not this star's surface" under the portrait. Default true.

Examples

import type { PortraitOptions } from "@johnmorrisdotca/hoshi-stars/portrait";

const options: PortraitOptions = { size: 320, lang: "ja", name: "ベテルギウス" };
console.log(options.size);
320

What it prints (run when this page was built)

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