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

frameCapfunction

The frame rate cap for this device: maxFps (30 by default), lower on a small device.

Import it

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

Definition

function frameCap(maxFps?: number, device?: { deviceMemory?: number; hardwareConcurrency?: number; }): number

Parameters

NameTypeDescription
maxFps (optional)number

The most frames a second to allow.

device (optional){ deviceMemory?: number; hardwareConcurrency?: number; }

deviceMemory in gigabytes and hardwareConcurrency in cores, from navigator; either may be left out.

Returns

number

The frames a second to allow, at least 1; 20 at most on a small device.

Examples

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

console.log(frameCap(), frameCap(30, { deviceMemory: 1 }));
30 20

What it prints (run when this page was built)

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