markerTracksfunction
The groups to join, each in date order, from the markers a range let through. A group with fewer than two dated markers has nothing to join. Markers with the same moment keep the order given.
Import it
import { markerTracks } from "@johnmorrisdotca/hoshi-stars/chart";
Definition
function markerTracks(visible: readonly VisibleMarker[], tracks: boolean | readonly string[] | undefined): MarkerTrack[]
Parameters
| Name | Type | Description |
|---|---|---|
visible | readonly VisibleMarker[] | What |
tracks | boolean | readonly string[] | undefined |
|
Returns
MarkerTrack[]
The tracks, in the order their groups first appear.
Examples
import { markerTracks, visibleMarkers } from "@johnmorrisdotca/hoshi-stars/chart";
const comet = [
{ ra: 10, dec: 5, date: "2026-11-03", group: "Comet" },
{ ra: 8, dec: 4, date: "2026-11-01", group: "Comet" },
{ ra: 40, dec: 20, date: "2026-11-02", group: "Log" },
];
console.log(markerTracks(visibleMarkers(comet), ["Comet"]).map((t) => t.items.map((i) => i.id)));
// [ [ 'm1', 'm0' ] ][ [ 'm1', 'm0' ] ]What it prints (run when this page was built)