本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · データの入口(自分で用意した地球の地図や軌道データを、ライセンスと出典つきのソースとして渡し、いま画面にあるのは誰のデータかを示します)

loadRecords関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Reads a record source once, when it is added: the list is frozen, a record with a non-finite number (a NaN or an infinity in any number finite names) is skipped and counted, and a list over MAX_RECORDS is refused whole (bigger data must be tiles). It never throws: a source that throws or rejects is a failed read, and a read the signal aborted is aborted.

インポート

import { loadRecords } from "@johnmorrisdotca/chikyu-earth/door";

定義

function loadRecords<R>(source: RecordSource<R>, signal: AbortSignal, finite?: (record: R) => readonly number[]): Promise<RecordsRead<R>>

引数

名前型説明
sourceRecordSource<R>

The record source.

signalAbortSignal

Aborts the read (the source is removed or switched off).

finite (省略可)((record: R) => readonly number[]) | undefined

The numbers of one record that must be finite, if any: (star) => [star.ra, star.dec, star.mag].

戻り値

Promise<RecordsRead<R>>

What was found: the status, the frozen records, how many were skipped and, for a failed read, why.

例

import { loadRecords } from "./data-door.ts";

const read = await loadRecords(source, controller.signal, (star) => [star.ra, star.dec]); // read.records is frozen; read.skipped counts the NaNs

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.51.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。