Skip to the content

Hoshi Stars星

The stars you can see without a telescope, with names, colours and distances; the 88 constellations with their lines and boundaries; the Messier objects; and seven map projections to draw them on.

Hoshi is the Japanese word 星 for a star. About the name

Contents

Reference

Names on the brightest stars and the constellation figures as faint lines, for a sky you draw yourself: a count or a magnitude, the figure under the pointer at full strength, a body that covers part of the sky, and a look set by settings alone

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

134.8 kB minified and gzipped, with everything it imports (measured with esbuild)

Exports

NameKindWhat it is
BoxtypeA rectangle in the page's pixels, for the boxes a figure's name must stay clear of (StarNames.labels are such boxes).
clampStrengthfunctionA strength held to 0 up to 1.
CONSTELLATION_LINES_ATTRIBUTEconstantThe attribute a page offers for the lines, as a settings panel sets it: constellation-lines, a strength from 0 to 1.
CoverMasktypeHow 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.
createFigureLinesfunctionThe constellation figures as lines for a sky of your own, faint, with the figure under the pointer at full strength and its name.
createStarNamesfunctionThe names of the brightest stars for a sky of your own.
CulturetypeA sky culture: a named set of figures.
DEFAULT_LABEL_STYLEconstantThe 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_STRENGTHconstantThe 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.
designationWidthfunctionThe 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.
discCoverfunctionA mask for a round body, such as the Earth seen from space: every spot within radius pixels of its centre is covered.
FigureLinestypeThe figures of one sky.
FigureLinesSettingstypeWhat the lines are.
FigureNametypeThe 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.
FigureOnScreentypeOne figure on the screen: where its lines are in FigureLines.segments, and its name's spot.
LABEL_SIDESconstantThe places a name may take, in the order they are tried: right of its star, left, above, below.
LABEL_STYLE_PROPERTIESconstantThe name of the CSS custom property for each part of the look, for a page that styles its labels from a stylesheet.
labelHeightfunctionThe height a line of text takes in pixels: 1.2 times its size.
LabelSidetypeA place for a name.
labelStylefunctionA 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.
LabelStyletypeThe look of a name drawn on the sky.
labelStyleFromfunctionA look read back from CSS custom properties: any property the page has not set keeps its default.
labelStyleVarsfunctionA 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.
labelTextfunctionA name with the look's case applied.
labelWidthfunctionThe 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.
lineStrengthFromAttributefunctionThe strength from the attribute constellation-lines, read as text.
NameLanguagetypeThe language of the names: en for the IAU spelling (Sirius), ja for the katakana (シリウス, English where a star has no katakana).
placeLabelfunctionPut 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.
ScreenPointtypeA place on the page's screen, in pixels from its top left corner.
SkyProjectortypeHow 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.
SkyViewtypeThe part of the screen names may use, in pixels.
STAR_NAMES_ATTRIBUTESconstantThe attributes a page offers for the names, as a settings panel sets them: star-names (a count) and star-names-magnitude (a limit).
StarNameLabeltypeOne name to draw: the star, the text with the look's case applied, and where everything goes, in the page's pixels.
StarNamestypeThe stars' names for one sky.
starNamesFromAttributesfunctionSettings from the two attributes a page offers, star-names (a count) and star-names-magnitude (a limit), read as text.
StarNamesSettingstypeWhat to name.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hoshi-stars 0.47.0.