markerTracks関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The groups to join, each in date order, from the markers a range let through. A group with fewer than two dated markers has nothing to join. Markers with the same moment keep the order given.
インポート
import { markerTracks } from "@johnmorrisdotca/hoshi-stars/chart";
定義
function markerTracks(visible: readonly VisibleMarker[], tracks: boolean | readonly string[] | undefined): MarkerTrack[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
visible | readonly VisibleMarker[] | What |
tracks | boolean | readonly string[] | undefined |
|
戻り値
MarkerTrack[]
The tracks, in the order their groups first appear.
例
import { markerTracks, visibleMarkers } from "@johnmorrisdotca/hoshi-stars/chart";
const comet = [
{ ra: 10, dec: 5, date: "2026-11-03", group: "Comet" },
{ ra: 8, dec: 4, date: "2026-11-01", group: "Comet" },
{ ra: 40, dec: 20, date: "2026-11-02", group: "Log" },
];
console.log(markerTracks(visibleMarkers(comet), ["Comet"]).map((t) => t.items.map((i) => i.id)));
// [ [ 'm1', 'm0' ] ][ [ 'm1', 'm0' ] ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。