本文へ移動

Hoshi Stars星

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

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

目次

リファレンス

いちばん明るい星の名前と、うすい星座の線 (自分で描く空のために。個数か等級で選べます。ポインターが乗っている星座は濃く表示でき、空をおおうものにも対応し、見た目は設定だけで変えられます)

import { … } from "@johnmorrisdotca/hoshi-stars/sky-labels";

最小化と gzip 圧縮をしたサイズは 134.8 kB(読み込むものをすべて含み、esbuild で計測)

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

エクスポート

名前種類概要
Box型A rectangle in the page's pixels, for the boxes a figure's name must stay clear of (StarNames.labels are such boxes).
clampStrength関数A strength held to 0 up to 1.
CONSTELLATION_LINES_ATTRIBUTE定数The attribute a page offers for the lines, as a settings panel sets it: constellation-lines, a strength from 0 to 1.
CoverMask型How a page says that a spot of its screen is covered by a body in front of the sky (the Earth, a planet, a panel): true where a star would not be seen.
createFigureLines関数The constellation figures as lines for a sky of your own, faint, with the figure under the pointer at full strength and its name.
createStarNames関数The names of the brightest stars for a sky of your own.
Culture型A sky culture: a named set of figures.
DEFAULT_LABEL_STYLE定数The look a name has when nothing is asked for, chosen from several proposals, "Display with catalogue letters": the name in Michroma in small capitals with wide letter spacing, a thin ring round the star, and the star's catalogue letter under it in small monospace.
DEFAULT_LINE_STRENGTH定数The strength the lines have when a page asks for them and says no more: faint, so that most of the sky is seen without lines.
designationWidth関数The width a star's catalogue letter (α Ori) takes in pixels in the look's small monospace, 0.6 of its size a letter; 0 where it is not drawn.
discCover関数A mask for a round body, such as the Earth seen from space: every spot within radius pixels of its centre is covered.
FigureLines型The figures of one sky.
FigureLinesSettings型What the lines are.
FigureName型The name of the picked figure and where to draw it, centred on x, with its baseline at y: clear above the figure, and never over a star's name.
FigureOnScreen型One figure on the screen: where its lines are in FigureLines.segments, and its name's spot.
LABEL_SIDES定数The places a name may take, in the order they are tried: right of its star, left, above, below.
LABEL_STYLE_PROPERTIES定数The name of the CSS custom property for each part of the look, for a page that styles its labels from a stylesheet.
labelHeight関数The height a line of text takes in pixels: 1.2 times its size.
LabelSide型A place for a name.
labelStyle関数A complete look from a partial one: every part left out or not usable takes its default, and every number is held to its range, so a bad setting never breaks a label.
LabelStyle型The look of a name drawn on the sky.
labelStyleFrom関数A look read back from CSS custom properties: any property the page has not set keeps its default.
labelStyleVars関数A look as CSS custom properties, to set on the element that holds the labels (element.style.setProperty(name, value)), so a stylesheet can restyle them as well.
labelText関数A name with the look's case applied.
labelWidth関数The width a name takes in pixels, from its length and the look: a Latin letter is about 0.6 of the size wide (0.75 in small capitals, which are wide in Michroma), a Japanese letter the whole size, and the letter spacing is added after each letter.
lineStrengthFromAttribute関数The strength from the attribute constellation-lines, read as text.
NameLanguage型The language of the names: en for the IAU spelling (Sirius), ja for the katakana (シリウス, English where a star has no katakana).
placeLabel関数Put a name on one side of a star: right, left, above (centred over it) or below (centred under it), with the star's catalogue letter under the name when designation is true.
ScreenPoint型A place on the page's screen, in pixels from its top left corner.
SkyProjector型How a page says where a star is: it gets the star's right ascension and declination in degrees and writes the spot on its screen into out.
SkyView型The part of the screen names may use, in pixels.
STAR_NAMES_ATTRIBUTES定数The attributes a page offers for the names, as a settings panel sets them: star-names (a count) and star-names-magnitude (a limit).
StarNameLabel型One name to draw: the star, the text with the look's case applied, and where everything goes, in the page's pixels.
StarNames型The stars' names for one sky.
starNamesFromAttributes関数Settings from the two attributes a page offers, star-names (a count) and star-names-magnitude (a limit), read as text.
StarNamesSettings型What to name.

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

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