markersFromCsvfunction
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). A row that
cannot be read is dropped (see normaliseMarkers).
Import it
import { markersFromCsv } from "@johnmorrisdotca/hoshi-stars/chart";
Definition
function markersFromCsv(text: string): SkyMarker[]
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The CSV. |
Returns
SkyMarker[]
The markers.
Examples
import { markersFromCsv } from "@johnmorrisdotca/hoshi-stars/chart";
console.log(markersFromCsv('label,dec,ra,date\n"M42, Orion Nebula",-5.4,83.8,2026-11-01\n'));
// [ { ra: 83.8, dec: -5.4, date: '2026-11-01', label: 'M42, Orion Nebula' } ][
{
ra: 83.80000000000001,
dec: -5.4,
date: '2026-11-01',
label: 'M42, Orion Nebula'
}
]What it prints (run when this page was built)