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

starComparisonfunction

The star beside the Sun at one scale, as SVG text. A star smaller than about a hundred Suns is drawn as a disc next to the Sun's disc. A bigger one fills the picture, with the Sun a dot at its centre and the orbits of Earth (and Mars and Jupiter where they fit) drawn over it, so a supergiant's size can be read against the solar system. The picture says how many times the Sun's radius the star is.

Import it

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

Definition

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

Parameters

NameTypeDescription
profileStarProfile

A star's profile from starProfile.

options (optional)PortraitOptions

Size, language, name and background.

Returns

string | undefined

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

Examples

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

const svg = starComparison(starProfile(starByName("Aldebaran")!), { name: "Aldebaran" });
console.log(svg?.includes("Earth's orbit"));
false

What it prints (run when this page was built)

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