本文へ移動

Hoshi Stars星

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

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

目次

リファレンス · 星座の文化 (図形と文化の型、自分で作る文化)

Culture型

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

A sky culture: a named set of figures. Import one from its own entry point and pass it to constellations, constellation, starsIn, figures and figureOf.

インポート

import type { Culture } from "@johnmorrisdotca/hoshi-stars/culture";

ほかのエクスポート元: @johnmorrisdotca/hoshi-stars/sky-labels

定義

interface Culture {
    readonly id: string;
    readonly names: Readonly<{
        en: string;
        ja: string;
    }>;
    asterisms(): readonly Asterism[];
    find(text: string): Asterism | undefined;
}

メンバー

名前型説明
idstring

A short key for an address or a setting: western, japanese, chinese.

namesReadonly<{ en: string; ja: string; }>

The culture's name in English and in Japanese.

asterisms(): readonly Asterism[]

The culture's figures, in a fixed order. Parsed once.

find(text: string): Asterism | undefined

One figure by any of its names (ignoring case, accents, tone marks and katakana against hiragana), its reading or its id; undefined where there is none, or where the text names two figures.

例

import { japanese } from "@johnmorrisdotca/hoshi-stars/cultures/japanese";

console.log(japanese.id, japanese.names.ja, japanese.asterisms().length);
japanese 日本の伝統 106

出力(このページを作ったときに実行した結果)

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

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