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

starPortraitfunction

A star drawn from its numbers as SVG text: a disc in the colour of its temperature, darker toward the edge by its limb-darkening coefficient, with a generic surface texture of the right kind of cells for its type, and, for Altair and Regulus, the flattened and gravity-darkened shape that interferometers measured, and for Vega the round face of a star seen over its pole. The picture says, in its own words, that it is drawn from numbers and that the texture is generic. Nothing in it is a photograph or an artist's guess at one star's markings.

Import it

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

Definition

function starPortrait(profile: StarProfile, options?: PortraitOptions): string | undefined

Parameters

NameTypeDescription
profileStarProfile

A star's profile from starProfile.

options (optional)PortraitOptions

Size, language, name, background and captions.

Returns

string | undefined

An SVG document as a string, or undefined where the profile has no temperature to draw.

Examples

import { starByName } from "@johnmorrisdotca/hoshi-stars";
import { starProfile } from "@johnmorrisdotca/hoshi-stars/profile";
import { starPortrait } from "@johnmorrisdotca/hoshi-stars/portrait";

const svg = starPortrait(starProfile(starByName("Betelgeuse")!), { name: "Betelgeuse", size: 320 });
console.log(svg?.slice(0, 40));
<svg xmlns="http://www.w3.org/2000/svg"

What it prints (run when this page was built)

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