Reference
/chart
import { … } from "@johnmorrisdotca/hoshi-stars/chart";
201.8 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
bodyRadius | function | How big a body's dot is drawn, in pixels: a star's rule (brighter is larger), carried to magnitude -4.6 so that Venus is larger than Sirius. |
CHART_LAYERS | constant | The layers a published chart draws: the Milky Way, the figures' lines, the constellation boundaries, the names, the deep-sky objects, the black holes, the ecliptic (the Sun's yearly path, dashed) and the grid. |
ChartLayer | type | One of CHART_LAYERS. |
chartSvg | function | The sky chart as a complete SVG element, as a string: the stars, and the layers asked for, laid out for width by height, on the night background. |
ChartSvgOptions | type | What to draw. |
dimsForUncertainty | function | Whether the "show uncertainty" look draws a star dimmer: a grade C star (a rough or missing distance) is, grades A and B are not. |
eclipticLine | function | The ecliptic as points of the equatorial sky, a degree of longitude apart by default, closed (the last is the first). |
eclipticToEquatorial | function | A point of the ecliptic frame in the equatorial one (both J2000): the rotation of the sphere about the equinox by the obliquity. |
MarkerRange | type | The moments to show: markers dated from from to to, both ends included. |
markersFromCsv | function | Markers from CSV text, the way markersToCsv writes it: a header row naming the columns (ra and dec are needed; id, date, label, color, size and group are used when present, in any order). |
markerSpan | function | The first and last moment among the markers: what a time slider spans. |
markersToCsv | function | The markers as CSV, one row each, with a header: id,ra,dec,date,label,color,size,group. |
markerTime | function | A moment in milliseconds since 1970. |
MarkerTrack | type | A group joined in date order. |
markerTracks | function | The groups to join, each in date order, from the markers a range let through. |
MarkerWhen | type | A moment: an ISO 8601 text (2026-11-08 or 2026-11-08T21:30:00Z), milliseconds since 1970 (what Date.now() and getTime() give), or a Date. |
normaliseBodies | function | Cleans a list that came as text (the bodies attribute is JSON): an entry with no id, no place or no brightness is dropped; a missing name falls back to the other language, else the id; a bad phase counts as full; a bad size or brightLimb is dropped; of two entries with the same id the first is kept. |
normaliseMarkers | function | Markers from a list: what JSON.parse gave, or any array. |
OBLIQUITY_J2000 | constant | The mean obliquity of the ecliptic at J2000, the tilt of the Earth's axis to its orbit, in degrees: 84,381.406 arc-seconds, the value the IAU 2006 precession model (Capitaine, Wallace and Chapront 2003) fixes. |
pickAccuracy | function | The grade and the ± of a star, for a pick: the grade, the distance range and the position resolution. |
PickAccuracy | type | The grade and the ± of a picked star: what hoshi-pick carries in accuracy for a star. |
SkyBody | type | One body to draw over the stars: a planet, the Moon, a dwarf planet. |
SkyBodyNames | type | The names of a body in the two languages of the chart. |
SkyMarker | type | One point of your own on the chart. |
UNCERTAIN_OPACITY | constant | How much of its own strength a grade C star is drawn at when the uncertainty is shown (its fill-opacity). |
VisibleMarker | type | A marker the range lets through: the marker, its place in the list, the id it answers to, its moment in milliseconds and how strongly it is drawn. |
visibleMarkers | function | The markers a time range lets through, in the order given, each with how strongly it is drawn. |