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 · The data door: hand the package your own stars or objects as a source with its own licence and credit, and see whose data is on the screen

withObjectsfunction

Adds the deep-sky objects of outside sources to the page's own. Each source is checked by validateSource (a TypeError at once for an empty credit, no licence or a clashing id), read once, and every record is checked: a position that is not on the sky, a number that is not finite, no id, an unknown kind or an id that is taken is left out and counted, never returned. A source that throws or holds more than 200,000 records is failed and adds nothing. To switch a source off, leave it out of the next call.

Import it

import { withObjects } from "@johnmorrisdotca/hoshi-stars/door";

Definition

function withObjects(sources: readonly ObjectSource[], options?: { own?: readonly DeepSkyObject[]; signal?: AbortSignal; }): Promise<ObjectsRead>

Parameters

NameTypeDescription
sourcesreadonly ObjectSource[]

The object sources.

options (optional){ own?: readonly DeepSkyObject[]; signal?: AbortSignal; }

own: the objects the page already draws (for example messier()), which come first and keep their ids; signal: stops the reads.

Returns

Promise<ObjectsRead>

The objects, their credits, and what was left out.

Examples

import { messier } from "@johnmorrisdotca/hoshi-stars/deep-sky";
import { creditLine, withObjects, type ObjectSource } from "@johnmorrisdotca/hoshi-stars/door";

declare const myObjects: ObjectSource;
const read = await withObjects([myObjects], { own: messier() });
console.log(read.objects.length, read.skipped, creditLine(read.credits, "en"));

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