本文へ移動

Chikyu Earth地球

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

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

目次

リファレンス

地球上の目印

import { … } from "@johnmorrisdotca/chikyu-earth/markers";

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

エクスポート

名前種類概要
attachMarkers関数Put markers on a globe, for either look: dots drawn in one pass on a canvas, a few labels as real buttons, crowded places gathered into clusters.
canvasRatio関数The pixel ratio for an overlay canvas: the device's, to 2, held to 4096 a side and 6 million pixels (the same budget as the 3D canvas).
Cluster型Several points gathered into one on the screen: where it is drawn and which points are in it.
clusterPoints関数Group the points indices (into xs and ys) by the grid cell they fall in.
GroupInfo型One group of markers: its name, how many it holds and whether it is shown.
LabelItem型One label to place: its dot's centre and radius, its box's size and its priority.
MarkerEventDetail型What the chikyu-marker-hover, chikyu-marker-click and chikyu-marker-focus events carry in event.detail.
MarkerIcon型The shapes a marker can be drawn as: dot, ring, square or diamond.
MarkerInput型A place on the Earth.
MarkerOptions型What attachMarkers may be asked: the most labels, how close markers gather, and the default colour.
Markers型The markers on one globe: add, update, remove and find them, show or hide groups, and detach.
OverlayElement型An element markers can be put on: any HTML element with an overlay (both <chikyu-earth> and <chikyu-earth-realistic> have one).
OverlayHost型What an element gives the markers (element.overlay): a box laid over its view, the pose of its last draw, and a way to hear the next ones.
OverlayPose型The pose of an element's last drawing, with the size of its box and the CSS transform its picture carries between redraws.
placeLabels関数Place up to max labels inside width x height.
Placement型Where one label goes: which item it is and its box's top-left corner.
Pose型The view: the point of the Earth at the middle of the disc, the disc's radius and its centre, in CSS pixels.
project関数Project a longitude and latitude (degrees) to the screen.
projectAll関数Project many points into flat arrays (reused between calls); z is the cosine used for a point's facing test.

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

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