リファレンス · 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>;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
title | string | The name for the picture's |
outlines | readonly (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 (省略可) | 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 |
neighbourOutlines (省略可) | readonly (readonly SkyPoint[])[] | undefined | The outlines of the neighbouring regions, drawn faint round the frame; leave out for none. |
segments | readonly (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 |
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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。