Reference
The sky out to a distance, in layers: the stars and galaxies nearer than 10, 50, 100, 500 or 1,000 light-years, each distance band its own colour, the ones with an uncertain distance kept apart, and none placed at a guess
import { … } from "@johnmorrisdotca/hoshi-stars/distance";
1.2 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
bandOf | function | The band of a distance: 0 under 10 light-years, 1 under 50, 2 under 100, 3 under 500, 4 under 1,000 and 5 beyond (a distance of exactly the edge is in the nearer band). |
Certainty | type | How well a distance is known: good (under 5%), fair (5% to 20%) or rough (over 20%, or no error stated). |
CERTAINTY_LIMITS | constant | The relative errors that divide a distance's certainty, the same as QUALITY_LIMITS of the constellation in 3D: a parallax known to under 5% is good, to 20% is fair, and worse (or with no error stated) is rough. |
certaintyOf | function | The certainty of a parallax known to a relative error (the error over the parallax): good under 5%, fair up to 20%, rough over it. |
deepSkyInput | function | A deep-sky object with a galaxy's distance (galaxyDistance of /deep-sky) as a thing with a distance. |
DISTANCE_ATTRIBUTE | constant | The attribute a page offers for the limit, as a settings panel sets it: distance-limit. |
DISTANCE_LIMITS | constant | The limits the sky map steps through, in light-years: 10, 50, 100, 500 and 1,000. |
DistanceInput | type | Something with a place on the sky and perhaps a distance, as layersByDistance takes it. |
DistanceLayers | type | What layersByDistance gives back. |
LayeredThing | type | A thing in a layer: where it is, how far, and which band it is in. |
LayerKind | type | The kind of thing in a layer: a bright star of the Yale catalogue, a nearby star of the Yale parallax catalogue (/nearby), or a deep-sky object with a distance (a galaxy). |
layersByDistance | function | The things out to a limit, each in the band of its distance. |
limitAtSlider | function | The limit at a slider's position, 0 to 1, on a scale where each step is the same ratio (4 light-years to 3 million). |
limitFromText | function | The limit from the attribute distance-limit (and the address's dist), read as text: a number of light-years, or all. |
limitText | function | A limit as the text the address keeps: all, or the light-years rounded (to the step where it is a step, else to 2 significant figures). |
nearbyInput | function | A nearby star (/nearby) as a thing with a distance. |
SLIDER_RANGE | constant | The nearest and farthest limits a free slider reaches, in light-years: from Alpha Centauri's neighbourhood to past the Andromeda Galaxy; beyond the last is all. |
sliderOfLimit | function | Where a limit sits on the slider, 0 to 1; all is 1 and a limit under the slider's start is 0. |
starInput | function | A bright star of the Yale catalogue as a thing with a distance, from its parallax and its error. |
stepLimit | function | The next limit up or down the steps (10, 50, 100, 500, 1,000, then all). |