本文へ移動

Hoshi Stars星

肉眼で見える星の名前・色・距離、88星座の線と境界、メシエ天体、そしてそれらを描くための7種類の図法を使えます。

「星」(ほし) は、夜空に光って見えるものです。 名前について(英語)

目次

リファレンス · データの入口(自分で用意した星やディープスカイ天体を、ライセンスと出典つきのソースとして渡し、いま画面にあるのは誰のデータかを示します)

withObjects関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { withObjects } from "@johnmorrisdotca/hoshi-stars/door";

定義

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

引数

名前型説明
sourcesreadonly ObjectSource[]

The object sources.

options (省略可){ 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.

戻り値

Promise<ObjectsRead>

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

例

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"));

ソースを見るGitHub で編集@johnmorrisdotca/hoshi-stars 0.47.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。