normaliseMarkersfunction
Markers from a list: what JSON.parse gave, or any array. An entry with no finite ra and dec (numbers or numeric text) is dropped; right ascension is wrapped to 0 up to 360 and declination held to -90 to 90;
text fields are kept as text. A date is kept as given, when it is a text, a number or a Date.
Import it
import { normaliseMarkers } from "@johnmorrisdotca/hoshi-stars/chart";
Definition
function normaliseMarkers(input: unknown): SkyMarker[]
Parameters
| Name | Type | Description |
|---|---|---|
input | unknown | The list. |
Returns
SkyMarker[]
The markers that could be read.
Examples
import { normaliseMarkers } from "@johnmorrisdotca/hoshi-stars/chart";
console.log(normaliseMarkers(JSON.parse('[{"ra":"370","dec":12,"label":"A"},{"ra":null,"dec":1}]')));
// [ { ra: 10, dec: 12, label: 'A' } ][ { ra: 10, dec: 12, label: 'A' } ]What it prints (run when this page was built)