visibleMarkersfunction
The markers a time range lets through, in the order given, each with how strongly it is drawn. Pure: the range is always the page's own.
Import it
import { visibleMarkers } from "@johnmorrisdotca/hoshi-stars/chart";
Definition
function visibleMarkers(markers: readonly SkyMarker[], range?: MarkerRange): VisibleMarker[]
Parameters
| Name | Type | Description |
|---|---|---|
markers | readonly SkyMarker[] | The markers. |
range (optional) | MarkerRange | undefined | The moments to show; every marker when left out. |
Returns
VisibleMarker[]
The markers that can be drawn and are in the range.
Examples
import { visibleMarkers } from "@johnmorrisdotca/hoshi-stars/chart";
const log = [
{ ra: 83.8, dec: -5.4, date: "2026-11-01" },
{ ra: 88.8, dec: 7.4, date: "2026-11-09" },
{ ra: 101.3, dec: -16.7 },
];
console.log(visibleMarkers(log, { from: "2026-11-05", to: "2026-11-30" }).map((m) => m.id));
// [ 'm1', 'm2' ][ 'm1', 'm2' ]What it prints (run when this page was built)