本文へ移動

Hoshi Stars星

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

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

目次

リファレンス · 距離で見る空 (10・50・100・500・1,000光年より近い星や銀河を層に分けて、距離の帯ごとに色分けします。距離がはっきりしないものは別にし、推測で置くことはしません)

limitFromText関数

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

The limit from the attribute distance-limit (and the address's dist), read as text: a number of light-years, or all. Off (undefined) when the attribute is missing, off, or not a number: nothing is limited and the sky is as it was, drawn with no layers.

インポート

import { limitFromText } from "@johnmorrisdotca/hoshi-stars/distance";

定義

function limitFromText(value: string | null | undefined): number | undefined

引数

名前型説明
valuestring | null | undefined

The text, or null when the attribute is missing.

戻り値

number | undefined

The limit in light-years (Infinity for all), or undefined for no layers.

例

import { limitFromText } from "@johnmorrisdotca/hoshi-stars/distance";

console.log(limitFromText("100"), limitFromText("all"), limitFromText(null), limitFromText("far"), limitFromText("-5"));
100 Infinity undefined undefined undefined

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

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

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