本文へ移動

Hoshi Stars星

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

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

目次

リファレンス · 88星座それぞれの絵 (明るい版と暗い版)

ThumbnailInput型

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

What to draw: the region to frame, the lines of the figure, and which stars belong to it. The IAU constellations come from constellationThumbnail; this is the shape another set of figures fills in.

インポート

import type { ThumbnailInput } from "@johnmorrisdotca/hoshi-stars/thumbnails";

定義

interface ThumbnailInput {
    title: string;
    outlines: ReadonlyArray<ReadonlyArray<SkyPoint>>;
    frame?: ReadonlyArray<SkyPoint>;
    neighbourOutlines?: ReadonlyArray<ReadonlyArray<SkyPoint>>;
    segments: ReadonlyArray<readonly [
        SkyPoint,
        SkyPoint
    ]>;
    owns: (star: Star) => boolean;
    leastSpan?: number;
    seeNeighbours?: boolean;
    ringed?: ReadonlyArray<number>;
}

メンバー

名前型説明
titlestring

The name for the picture's <title> and aria-label.

outlinesreadonly (readonly SkyPoint[])[]

The closed outlines of the region to frame (degrees, J2000), each with its first point repeated as the last. Their extent decides the frame; they are drawn with a faint wash inside. Leave empty, and give frame, for a figure that has no boundary (a Chinese asterism).

frame (省略可)readonly SkyPoint[] | undefined

Positions to frame when the figure has no outline: the picture is framed round them (with the same room, and a least width of 4 degrees) and no boundary or wash is drawn. Ignored where outlines has points.

neighbourOutlines (省略可)readonly (readonly SkyPoint[])[] | undefined

The outlines of the neighbouring regions, drawn faint round the frame; leave out for none.

segmentsreadonly (readonly [SkyPoint, SkyPoint])[]

The lines of the figure, each between two positions on the sky (the stars it joins).

owns(star: Star) => boolean

True for a star that belongs to the figure: it is drawn in full and carries its data-hr. Every other star in the frame is drawn faint.

leastSpan (省略可)number | undefined

The least width of the picture in degrees where it has outlines (default 13, so a small constellation still shows its neighbours).

seeNeighbours (省略可)boolean | undefined

True to widen the picture, a little at a time and no further than a constellation's 13 degrees, until a neighbouring boundary crosses it, so the faint boundary lines show in every picture (default false).

ringed (省略可)readonly number[] | undefined

Bright Star Catalogue (HR) numbers of stars to draw with a ring round them in the accent colour: a single named star inside its constellation's figure.

例

import { thumbnailSvg, type ThumbnailInput } from "@johnmorrisdotca/hoshi-stars/thumbnails";

const input: ThumbnailInput = {
  title: "A triangle",
  outlines: [[{ rightAscension: 80, declination: 0 }, { rightAscension: 90, declination: 0 }, { rightAscension: 85, declination: 8 }, { rightAscension: 80, declination: 0 }]],
  segments: [],
  owns: () => true,
};
console.log(thumbnailSvg(input).length > 100);
true

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

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

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