markersToCsvfunction
The markers as CSV, one row each, with a header: id,ra,dec,date,label,color,size,group. A Date is written as ISO 8601.
Import it
import { markersToCsv } from "@johnmorrisdotca/hoshi-stars/chart";
Definition
function markersToCsv(markers: readonly SkyMarker[]): string
Parameters
| Name | Type | Description |
|---|---|---|
markers | readonly SkyMarker[] | The markers. |
Returns
string
The CSV text, rows ending in a newline.
Examples
import { markersToCsv } from "@johnmorrisdotca/hoshi-stars/chart";
console.log(markersToCsv([{ ra: 83.8, dec: -5.4, date: "2026-11-01", label: "M42, Orion Nebula" }]));
// id,ra,dec,date,label,color,size,group
// ,83.8,-5.4,2026-11-01,"M42, Orion Nebula",,,id,ra,dec,date,label,color,size,group
,83.8,-5.4,2026-11-01,"M42, Orion Nebula",,,What it prints (run when this page was built)