ChikyuEarthclass
The <chikyu-earth> custom element: the line globe, drawn as SVG in its shadow root.
Every export of every entry point, each with its own page. This page keeps the addresses the old one-page reference had.
@johnmorrisdotca/chikyu-earth/elementChikyuEarthclassThe <chikyu-earth> custom element: the line globe, drawn as SVG in its shadow root.
@johnmorrisdotca/chikyu-earth/realisticATMOSPHERE_OUTERconstantThe glow reaches this many radii from the centre; the globe at 1x is drawn to fit inside it.
chooseTierfunctionThe width to hold for a layer when the globe's disc has radius radiusPx device pixels: the smallest shipped width that gives TEXELS_PER_RADIUS_PIXEL texels per pixel, else the largest, never more than cap, never less than the smallest.
createGatefunctionA rate gate for the draw: asks that come faster than minMs apart become one, and the last ask is never lost, so a burst of changes costs one draw.
discRadiusfunctionThe disc's radius in CSS pixels in a box of width x height at zoom: it fits the glow in the box at 1x.
frameCapfunctionThe frame rate cap for this device: maxFps (30 by default), lower on a small device.
GatetypeA rate gate for the draw: what createGate returns.
julianDayfunctionJulian day number of a moment in milliseconds since the Unix epoch.
LayertypeOne of the pictures the realistic Earth and the space view draw with: day, night, clouds, water and moon.
LightModetypeHow the Earth is lit: sun (the true light, with the night side dark and the city lights on it), lit (always lit, as if by daylight from the camera's side, the day picture and no city lights: the night side is never a black frame) or boost (the true terminator, with the night side raised so the land and coasts read).
lookAtfunctionWhere the view is centred on the globe: the home centre, turned by yaw (west) and tipped by tilt (south), held to the poles; a drag right is yaw and a drag up is tilt, and the ground follows the pointer.
MAX_TEXTUREconstantThe most pixels across a texture the package ever asks the GPU for.
subsolarPointfunctionThe point where the Sun is at the zenith at ms: latitude is the Sun's declination, longitude runs west at 15 degrees an hour.
TEXELS_PER_RADIUS_PIXELconstantTexels across the whole circumference wanted per device pixel of the globe's radius: 3 is a little under 2 pi, so a texel is a little larger than a pixel.
textureBytesfunctionBytes of GPU memory a texture of this width costs, with its mipmaps, at 4 bytes a pixel (the most it can be).
textureCapfunctionThe cap for this device: low-memory phones stop at 2048, and the GPU's own limit and the option are never passed.
ThreePartstypeThe parts of three.js the Earth and the space view use.
TIERSconstantThe widths each layer is shipped in (every picture is 2:1, so the height is half).
unitVectorfunctionA point on the globe as a unit vector: +z is longitude 0 on the equator, +x east, +y north.
@johnmorrisdotca/chikyu-earth/realistic/elementChikyuEarthRealisticclassThe <chikyu-earth-realistic> custom element: the Earth from space, drawn with three.js through kazoku-ui's shared renderer (one WebGL context for the page).
EarthStatetypeWhat the realistic Earth is doing: loading its pictures, live and drawing, unavailable (no WebGL), lost (the GPU took the context; it comes back by itself) or idle (another view has the page's one WebGL context; press or focus it to take it).
readTimefunctionA time attribute: "now" (or none) follows the clock, else an ISO date such as 2026-06-21T12:00:00Z.
setSharedRendererfunctionHands the elements a renderer the page made, so a page that draws other things with kazoku-ui's shared renderer keeps one WebGL context for all of them.
setThreeLoaderfunctionWhere three.js comes from, if a page wants to hand it over itself (before the first element connects).
@johnmorrisdotca/chikyu-earth/markersattachMarkersfunctionPut 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.
canvasRatiofunctionThe 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).
ClustertypeSeveral points gathered into one on the screen: where it is drawn and which points are in it.
clusterPointsfunctionGroup the points indices (into xs and ys) by the grid cell they fall in.
GroupInfotypeOne group of markers: its name, how many it holds and whether it is shown.
LabelItemtypeOne label to place: its dot's centre and radius, its box's size and its priority.
MarkerEventDetailtypeWhat the chikyu-marker-hover, chikyu-marker-click and chikyu-marker-focus events carry in event.detail.
MarkerIcontypeThe shapes a marker can be drawn as: dot, ring, square or diamond.
MarkerInputtypeA place on the Earth.
MarkerOptionstypeWhat attachMarkers may be asked: the most labels, how close markers gather, and the default colour.
MarkerstypeThe markers on one globe: add, update, remove and find them, show or hide groups, and detach.
OverlayElementtypeAn element markers can be put on: any HTML element with an overlay (both <chikyu-earth> and <chikyu-earth-realistic> have one).
OverlayHosttypeWhat 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.
OverlayPosetypeThe pose of an element's last drawing, with the size of its box and the CSS transform its picture carries between redraws.
placeLabelsfunctionPlace up to max labels inside width x height.
PlacementtypeWhere one label goes: which item it is and its box's top-left corner.
PosetypeThe view: the point of the Earth at the middle of the disc, the disc's radius and its centre, in CSS pixels.
projectfunctionProject a longitude and latitude (degrees) to the screen.
projectAllfunctionProject many points into flat arrays (reused between calls); z is the cosine used for a point's facing test.
@johnmorrisdotca/chikyu-earth/spaceAU_IN_EARTH_RADIIconstantEarth radii in one astronomical unit.
blendfunctionA frame between two others, t from 0 to 1.
BodyDrawingtypeOne body as drawn by a painter: an object of radius 1 at the origin, which the scene places, scales and (for the Sun) turns to face the camera.
BodyMoontypeOne moon of a planet at a moment: its name, where it is from the planet's centre and how big it is, both in radii of the planet, in scene axes.
BodyPaintertypeThe seam for drawing the Sun, the planets and their moons.
compressfunctionThe same direction at a compressed distance from the Earth: the Moon is 10 Earth radii away, and a body k times further than the Moon is k^0.25 times as far here.
createTrackfunctionAnswers for any moment from two real ones: at(ms) asks astronomy-engine only when ms leaves the span the last two answers cover, and then looks stepMs ahead, so playing time at a steady rate costs one pair of lookups every stepMs and every draw in between is arithmetic.
EARTH_RADIUS_KMconstantThe Earth's radius in kilometres, the unit of the scene's distances.
FrametypeWhere everything is at one moment: positions in astronomical units from the Earth's centre, in scene axes (x to the vernal equinox, y north, z toward -y of the equator).
frameAtfunctionThe state of the sky at ms: nine vectors and an angle, in a few tenths of a millisecond.
MOON_COMPRESSEDconstantThe Moon's distance in a compressed view, in Earth radii (the true one is about 60).
orbitPathfunctionThe path a planet takes round the Sun, as count points around the orbit that starts where the planet is at ms, relative to the Sun (scene axes, AU).
PaintContexttypeWhat the scene tells a painter when it makes a body.
placeAroundfunctionA place helio astronomical units from the Sun (a planet, or a point on its orbit), round the Sun at sun.
placeMoonfunctionThe Moon, from the Earth's centre.
placeSunfunctionThe Sun, from the Earth's centre: in a compressed view always 44 Earth radii away, in its real direction.
plainPainterconstantThe default look: a sphere in the planet's colour, lit by the Sun, and for the Sun a glowing disc.
PlanetNametypeOne of the planets drawn (Pluto too), by name.
PLANETSconstantThe planets drawn, nearest the Sun first.
RADIUSconstantRadii in Earth radii: the real ones, and ones large enough to see in a compressed view.
RIDE_FOVconstantThe field of view, in degrees, of a camera riding along at zoom 1 (the Earth's view from outside is 35).
RideInputtypeWhat ridePose is asked: the camera's place and its way of travel (any length), where it looks, and the shared controls' yaw, tilt and zoom.
RideLooktypeWhere a riding camera looks: down straight at the Earth's centre (the ground goes by under the camera), or horizon tipped forward along the way it is going until the horizon is a little above the middle of the view.
ridePosefunctionThe camera of a body-borne view: at position, looking at the Earth, with the way the body is going at the top of the picture.
RidePosetypeThe camera ridePose works out: where it is, which way it looks, which way is up in the picture, its field of view in degrees, and how big the Earth looks from there (its angular radius in degrees).
ScaleModetypeThe scale the space view is drawn in: compressed squeezes the distances so the Moon, the Sun and Neptune fit one view, and true keeps the real ones.
SUN_COMPRESSEDconstantThe Sun's distance from the Earth in a compressed view, in Earth radii (the true one is about 23,500).
truePositionfunctionA place in astronomical units from the Earth's centre, at true distance, in Earth radii.
Vec3typeA position or direction as [x, y, z], in the scene's axes (x toward the vernal equinox, y north).
@johnmorrisdotca/chikyu-earth/space/elementBODY_NAMESconstantThe eleven bodies the space view places, names and lets a reader choose: the Earth, the Sun, the Moon, the seven other planets and Pluto.
BodyInfotypeWhat a page can tell a reader about a body now.
BodyNametypeThe name of one of the bodies in BODY_NAMES.
ChikyuSpaceclassThe <chikyu-space> custom element: the Earth, the Moon, the Sun and the planets where they are at a date and time, drawn with three.js through the shared renderer.
RideOptionstypeHow a ride along is done: view from (the default) puts the camera at the body looking at the Earth, follow keeps it a fixed distance from the body looking at it (distanceKm, 3000 by default, for a satellite; a planet or the Moon is kept at the distance the zoom says); look down (the default) or horizon is where a camera at the body points; smooth (the default) glides from the old camera to the new one in about a second and a bit, and jumps instead for a reader who asked for reduced motion.
RideTargettypeWhat a camera can ride along with: the name of one of the bodies, or a satellite of a group ({ group, index }).
RidingtypeWhat the camera is riding along with now: the body or satellite, how (from or follow), where it looks, and the distance kept for a satellite.
setBodyPainterfunctionChange how the Sun and the planets are drawn (before the first element connects): the space view keeps their places, sizes, light, names and orbits and asks the painter only for what to draw at each place (see BodyPainter).
setThreeLoaderfunctionWhere three.js comes from, if a page wants to hand it over itself (before the first element connects).
SpacePresettypeA named distance for zoomFor: the Earth, the Moon, the Sun, the inner planets, the whole solar system, or a planet with its nearer moons (Jupiter-moons: the zoom that shows them, when a body painter that draws moons is set).
SpaceStatetypeWhat the space view is doing: loading, live, unavailable (no WebGL), lost (the GPU took the context; it comes back by itself) or idle (another view has the page's one context).
@johnmorrisdotca/chikyu-earth/satellitescreateSatellitesfunctionMake a group of satellites from their element sets.
DEFAULT_MAX_AGE_DAYSconstantHow old, in days, an element set may be at the moment shown before the satellite is left out: SGP4's error grows by a few kilometres a day, so a fortnight is as far as a picture should trust.
ElementSettypeOne satellite's orbital elements in the "GP" format that CelesTrak and Space-Track both serve as JSON (CCSDS OMM, one object per satellite).
MAX_SATELLITE_SPEEDconstantThe fastest clock, in game seconds a second, at which the space view still places a group of satellites: above it the two moments SGP4 is run at would be too far apart to interpolate, so the group is hidden rather than drawn wrongly.
RefusedElementSettypeA satellite the group could not use, and why: its elements did not start SGP4 (bad numbers), or it had decayed at its own epoch.
SatelliteInfotypeWhat a page can tell a reader about one satellite at a moment: its name, its number, how old its elements are, how high and how fast it is.
SatelliteReftypeA satellite chosen from a group: which group and which place in it.
SatellitestypeA group of satellites, ready to give positions for any moment: what createSatellites returns, and what <chikyu-space> takes in setSatellites.
SatellitesOptionstypeWhat createSatellites can be told.
@johnmorrisdotca/chikyu-earthcentreRotationfunctionThe rotation that puts centre in the middle of the disc: d3-geo's rotate is the negative of the point.
cleanStylefunctionA value from outside (an attribute, a query parameter) as a style's name: the default for anything else.
COUNTRIESconstantEvery country the globe draws, as GeoJSON in longitude and latitude (177 features, Antarctica included), each with its English name, its Japanese name and its two-letter code.
countryListfunctionEvery country the globe draws, with its kuni name and code.
CountryPropstypeWhat one country's outline carries: its English and Japanese name and its ISO alpha-2 code, all from kuni.
DEFAULT_STYLEconstantThe style a drawing is in when none is named.
DEGREES_PER_MSconstantHow far the Earth turns in one millisecond, in degrees.
GeoPointtypeA point on the globe, in degrees: lon from -180 to 180 (east is positive), lat from -90 to 90 (north is positive).
globefunctionThe globe as an SVG string, turned to rotation and drawn in style, size pixels square.
globeBaseScalefunctionThe radius of an unzoomed globe in a square of size pixels.
GlobeOptionstypeWhat globe() may be asked.
GlobeViewtypeWhat a shared view controller tells the globe: its turn (yaw, degrees), tip (tilt, degrees), zoom (1 is Fit) and pan (panX and panY, CSS pixels).
HOME_VIEWconstantThe view when it opens: the home centre, upright, at 1x with no pan.
projectionViewfunctionWhat the projection is given for a view: yaw turns longitude, tilt tips latitude, zoom scales and pan moves the disc in CSS pixels.
ProjectionViewtypeWhat d3-geo's orthographic projection is given for a view: its rotation, scale and translation.
RotationtypeHow the globe is turned: [lambda, phi] in degrees, the pair d3-geo's rotate takes.
rotationAtfunctionThe rotation at now for a globe that was centred on centre at start.
SIDEREAL_DAY_MSconstantOne sidereal day — the Earth's turn against the stars, 23 h 56 min 4.0905 s — in milliseconds.
spinAtfunctionHow far the Earth has turned after ms milliseconds, in degrees.
StyletypeThe lines and fills of one look: colours and widths only, never the geometry.
STYLE_NAMESconstantEvery style's name, in the order they are listed.
StyleNametypeThe name of a look: "line" or "thick".
STYLESconstantThe looks the globe is drawn in, by name: line (thin outlines) and thick.