Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

Reference · The realistic Earth's pure parts

Gatetype

A rate gate for the draw: what createGate returns.

Import it

import type { Gate } from "@johnmorrisdotca/chikyu-earth/realistic";

Definition

interface Gate {
    request(): void;
    soon(): void;
    cancel(): void;
    setMinMs(minMs: number): void;
}

Members

NameTypeDescription
request(): void

Ask for fire to run: now if the last run was minMs ago or more, else once, when that time has passed.

soon(): void

Like request, but every ask made in one task is one ask, made when the task ends: a time and a view set together are one draw.

cancel(): void

Forget a run that is waiting.

setMinMs(minMs: number): void

Change the least time between runs (a lower frame rate on a battery).

Examples

import { createGate, type Gate } from "@johnmorrisdotca/chikyu-earth/realistic";

const gate: Gate = createGate(33, () => console.log("draw"));
gate.request();
gate.cancel();
draw

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.11.0.