markersFromCsv関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { markersFromCsv } from "@johnmorrisdotca/hoshi-stars/chart";
定義
function markersFromCsv(text: string): SkyMarker[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | The CSV. |
戻り値
SkyMarker[]
The markers.
例
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'
}
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。