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 · /meteors

readMeteorStrengthfunction

What a page's meteors-strength attribute means: a number from 0 (no streaks are drawn) to 1 (the full look), given as it is written; with none, or something that is not a number, METEOR_STRENGTH_DEFAULT. A number outside the range is brought to its nearest end.

Import it

import { readMeteorStrength } from "@johnmorrisdotca/chikyu-earth/meteors";

Definition

function readMeteorStrength(given: string | null): number

Parameters

NameTypeDescription
givenstring | null

The attribute's value, or null when the page has none.

Returns

number

How strongly the streaks are drawn, between 0 and 1.

Examples

import { readMeteorStrength } from "@johnmorrisdotca/chikyu-earth/meteors";

console.log(readMeteorStrength(null), readMeteorStrength("0.3"), readMeteorStrength("7"), readMeteorStrength("-1"), readMeteorStrength("soft")); // 1 0.3 1 0 1
1 0.3 1 0 1

What it prints (run when this page was built)

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