リファレンス
いちばん明るい星の名前と、うすい星座の線 (自分で描く空のために。個数か等級で選べます。ポインターが乗っている星座は濃く表示でき、空をおおうものにも対応し、見た目は設定だけで変えられます)
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。