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 · /chart

normaliseBodiesfunction

Cleans a list that came as text (the bodies attribute is JSON): an entry with no id, no place or no brightness is dropped; a missing name falls back to the other language, else the id; a bad phase counts as full; a bad size or brightLimb is dropped; of two entries with the same id the first is kept. Anything that is not a list gives an empty one.

Import it

import { normaliseBodies } from "@johnmorrisdotca/hoshi-stars/chart";

Definition

function normaliseBodies(value: unknown): SkyBody[]

Parameters

NameTypeDescription
valueunknown

The parsed JSON, or anything.

Returns

SkyBody[]

The bodies that can be drawn.

Examples

import { normaliseBodies } from "@johnmorrisdotca/hoshi-stars/chart";

const list = normaliseBodies([{ id: "mars", names: { en: "Mars" }, ra: 10, dec: -5, magnitude: 1.1, phase: 0.9 }, { id: "bad" }]);
console.log(list.length, list[0]?.names.ja);
// 1 Mars
1 Mars

What it prints (run when this page was built)

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