import { type ViewController } from "@johnmorrisdotca/kazoku-ui/view-controls"; import type { GeoPoint } from "../types.ts"; import { type BodyLabelSettings } from "../realistic/body-label.ts"; import type { SkyKeepClear } from "../sky/keep-clear.ts"; import type { SkyLabelStyle } from "../sky/style.ts"; import { type Place, type PlaceLook } from "../markers/places.ts"; import { type CityNamesStyle } from "../cities/host.ts"; import { type BorderSets } from "../borders/lines.ts"; import type { BorderData, BorderStats } from "../borders/layer.ts"; import { type RouteLeg } from "../route.ts"; import type { GridStats } from "../grid/layer.ts"; import type { BeamStats } from "../beam/layer.ts"; import { type CountryNamesStats, type CountryNamesStyle } from "../country-names/host.ts"; import { type SeaNamesStats } from "../sea-names/host.ts"; import type { TileStats } from "../realistic/tile-set.ts"; import { setThreeLoader } from "../realistic/shared.ts"; import type { LightMode } from "../realistic/earth.ts"; import type { SatelliteInfo, SatelliteRef, Satellites } from "../satellites/types.ts"; import { type PlanetName } from "./ephemeris.ts"; import { type SatelliteScreen, type SatelliteStyle } from "./satellite-layer.ts"; import { type SatelliteOthers } from "./satellite-focus.ts"; import { type PathStats } from "./path-controls.ts"; import { type PathHit, type PathRequest, type PathStyle } from "./paths.ts"; import { type RideFace, type RideLook, type RideModelSize, type RideViewpoint } from "./ride.ts"; import { type ScaleMode } from "./scale.ts"; import { BODY_NAMES, type CameraMode, type BodyName, type BodyPainter, type RideTarget, type SatellitePainter } from "./scene.ts"; import { type PaintSpec } from "../paint/buffer.ts"; export { BODY_NAMES, type BodyName, type CameraMode, type RideTarget }; /** * Change 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`). Left alone, they are plain spheres in the right colours. * * @param next - The painter to use, or `undefined` for the plain one. * * @example * ```ts no-run * import { plainPainter } from "@johnmorrisdotca/chikyu-earth/space"; * import { setBodyPainter } from "@johnmorrisdotca/chikyu-earth/space/element"; * * setBodyPainter({ make: (three, name) => plainPainter.make(three, name) }); * ``` */ export declare function setBodyPainter(next: BodyPainter | undefined): void; /** * Where the 3D models of large satellites come from if the page has any: the package ships none. With a painter set, a satellite followed (`ride(ref, { view: "follow" })`) that the painter has a model for is drawn as that model, in the middle * of the picture at a size that reads, pointed the way it flies, lit by the Sun; a satellite it has none for stays a dot. See `SatellitePainter`. * * @param next - The painter, or `undefined` for none. * * @example * ```ts no-run * import { setSatellitePainter } from "@johnmorrisdotca/chikyu-earth/space/element"; * * setSatellitePainter({ has: (norad) => norad === 25544, make: async () => null }); * ``` */ export declare function setSatellitePainter(next: SatellitePainter | undefined): void; /** * What a page can tell a reader about a body now. * * @example * ```ts no-run * import type { BodyInfo } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const info: BodyInfo = { name: "Mars", radiusKm: 3389.5, distanceKm: 225_000_000 }; * console.log(`${info.name}: ${info.radiusKm} km`); * ``` */ export interface BodyInfo { name: BodyName; /** Mean radius, kilometres. */ radiusKm: number; /** Distance from the Earth's centre now, kilometres (0 for the Earth). */ distanceKm: number; } export { setThreeLoader }; /** * What 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). * * @example * ```ts no-run * import type { ChikyuSpace, SpaceState } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const stateOf = (space: ChikyuSpace): SpaceState => space.stats.state; * console.log(typeof stateOf); * ``` */ export type SpaceState = "loading" | "live" | "unavailable" | "lost" | "idle"; /** * A 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). * * @example * ```ts no-run * import type { ChikyuSpace, SpacePreset } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const zoomTo = (space: ChikyuSpace, preset: SpacePreset): number => space.zoomFor(preset); * console.log(typeof zoomTo); * ``` */ export type SpacePreset = "earth" | "moon" | "sun" | "inner" | "solar-system" | `${Exclude}-moons`; /** * How 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); `above` (a satellite only; a body is followed) puts it on the line from the Earth's centre through the satellite, `distanceKm` (divided by the zoom) above it, looking straight down at it with the way it is going at the top * of the picture, the satellite held in the middle while the Earth turns beneath (a drag turns the picture about the satellite and tips the camera back or ahead of it); `look` `down` (the default) or `horizon` is where a camera at the body points; `face` opens looking one way (see `face`); `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. * * @example * ```ts no-run * import type { RideOptions } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const options: RideOptions = { view: "from", look: "horizon" }; * console.log(options.look); * ``` */ export interface RideOptions { view?: "from" | "follow" | "above"; look?: RideLook; /** Face this way as the ride opens (`face`). */ face?: RideFace; /** The radius of the ridden satellite's model as a share of the picture's height (0.02 to 1.2), for this ride: the element's `ride-model-share` when not given. Along the way it goes the default is 0.22, above the satellite 0.17 (its size at the lowest height). */ modelShare?: number; /** Where the model's middle sits, as a share of the picture's height from the top (0.5 to 1.4: 0.5 the middle, 1 the bottom edge), for this ride along the way it goes: the element's `ride-model-seat` when not given; 0.86 by default. */ modelSeat?: number; /** `outside` (the default, or the element\'s `ride-viewpoint`) shows the satellite: with `view: "from"` the camera is a little behind and above it (straight above it with `look: "down"`), and a satellite the page has no model for is drawn small from the package's own sketch of its kind. `inside` is the camera at the satellite, as before, and no sketch. A body is always ridden from inside. */ viewpoint?: RideViewpoint; /** `distance` (the default, or the element's `ride-model-size`) lets the model of a satellite seen from above shrink as the camera rises and hand over to the ordinary mark, ring and name, between 1,000 and 2,000 km; `fixed` keeps one share of the picture at every height. */ modelSize?: RideModelSize; distanceKm?: number; smooth?: boolean; } /** * What the camera is riding along with now: the body or satellite, how (`from`, `follow` or `above`), where it looks, the facing it looks round from (`null` when none was chosen), and the distance kept for a satellite. * * @example * ```ts no-run * import type { Riding } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const describe = (ride: Riding | null): string => (ride ? `${ride.view} ${typeof ride.target === "string" ? ride.target : ride.target.group}` : "not riding"); * console.log(typeof describe); * ``` */ export interface Riding { target: RideTarget; view: "from" | "follow" | "above"; look: RideLook; face: RideFace | null; distanceKm: number; /** `outside` or `inside` (see `RideOptions`). */ viewpoint: RideViewpoint; /** `distance` or `fixed` (see `RideOptions`). */ modelSize: RideModelSize; } type SatelliteStats = { groups: number; placed: number; segments: number; tooFast: boolean; dotScale: number; longestStreakPx: number; streakCapPx: number; weight: number; fade: number; earthPx: number; epochMs: number; propagations: number; lastBatchMs: number; maxBatchMs: number; updateMs: number; maxUpdateMs: number; averageUpdateMs: number; updates: number; selectedRing: boolean; hoverPath: boolean; hoverOpacity: number; selectedOpacity: number; orbitLines: number; estimated: number; }; /** * The `` 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. It takes `center`, `time` (`now` or an ISO date), `speed` (1 is real time, 0 holds, 86400 is a day a second, negative runs backwards), `scale` (`compressed` or `true`), `labels` and `orbits` (`off` hides them); positions are computed in the browser by astronomy-engine, an optional peer dependency. It draws only when something changes, and nothing while it is out of sight. * * It carries kazoku-ui's controls itself: a drag turns the view, two fingers pinch, Ctrl and the wheel zoom (a plain wheel at Fit scrolls the page) and the arrow keys, + and - work once it is focused. The zoom runs from a millionth of Fit (the whole solar system) to 2.5 times, and from 0.5 to 6 times while riding from a body. `controls="none"` turns the hands off; `zoom-min` and `zoom-max` change the range. A `` on the element takes the hands over, and the page applies its events with `setView`. `immersive` is the full-screen mode: any shape of box, a plain wheel zooms and a drag anywhere turns. * * With a body painter that carries a `credit` (`setBodyPainter`), the credit of its pictures is written under the picture while it draws the bodies; `bodies-credit="off"` takes the line away. * * While time runs (`speed` is not 0) it sends `chikyu-timechange` with `detail: { time, running: true }`, `time` being the moment shown in milliseconds since 1970, at most four times a second however fast the picture is * drawn (and, with the clock at real time, as often as it steps: once a minute, or once a second with satellites or a ride on show), only while the tab is shown, and once with `running: false` when the clock holds * (`speed` set to 0): a page writes the date into its date box from it. It is not sent for a `time` the page sets itself. `chikyu-time` is the older event of every step the clock takes (up to thirty a second): * it is kept for pages that use it, but a page that shows the date wants `chikyu-timechange`. * * `borders` draws the borders on the Earth's land as thin lines that turn with it, as on ``: `countries`, `regions` (from the page's `borderData.regions`, once the Earth is * large enough), or both with a bare attribute; `chikyu-borders-unavailable` is sent when the shapes cannot be loaded. * * `beam` draws a beam of light from the chosen satellite (the one marked, or the one ridden) down to the ground below it: a soft cone ending in a lit footprint, the circle from which the satellite is above * `beam-elevation` degrees (25), with `beam-cells` spot cells inside it (an illustration, never an operator's plan), `beam-cell-size`, `beam-color` and `beam-strength` (the property `beam` and its siblings, and `stats.beam`). * * `grid` draws the meridians and parallels on the Earth, and `country-names` names its countries, as on ``: the names keep clear of the bodies', the places' and the * cities' names and stay on the Earth's disc; `chikyu-country-names-unavailable` is sent when the outlines cannot be loaded. * * @example * ```ts no-run * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.createElement("chikyu-space") as ChikyuSpace; * space.setAttribute("time", "2026-11-02T12:00Z"); * space.setAttribute("speed", "86400"); * space.placeGroups = false; // place-groups="off": every place keeps its own ring * space.paint = { id: "25544", length: "1w", swath: "coverage" }; * space.clearPaint(); * space.setAttribute("star-names", "12"); * space.addEventListener("chikyu-sky-pick", (event) => { * const pick = (event as CustomEvent<{ kind: string; name?: string; abbreviation?: string }>).detail; * console.log(pick.kind, pick.name ?? pick.abbreviation); * }); * space.addEventListener("chikyu-timechange", (event) => { * const { time, running } = (event as CustomEvent<{ time: number; running: boolean }>).detail; * console.log(new Date(time).toISOString(), running ? "running" : "held"); * }); * document.body.append(space); * ``` */ export declare class ChikyuSpace extends HTMLElement { #private; static observedAttributes: string[]; /** The controller behind the element's own hands (`set`, `fit`, `state`), while it is in a page. */ get controller(): ViewController | undefined; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, _old: string | null, value: string | null): void; /** Where the finer map tiles are served from (a folder with `manifest.json`), or `null` for none; the attribute `tiles`. The Earth lays only the tiles in view over its own picture, at the level the camera's height needs, so a ride a few hundred kilometres above the ground sees sharp ground. */ get tiles(): string | null; set tiles(value: string | null); /** * Finer imagery than the package's own tiles, read by the browser from NASA's imagery service. `gibs` turns it on. See `` for the layer and the day. */ get tilesFiner(): string | null; set tilesFiner(value: string | null); /** * True for the full-screen mode (the `immersive` attribute): the element fills its box in any shape (the Earth fits the shorter side with its glow inside it, `earth-size`), a plain wheel zooms instead of scrolling * the page, a drag anywhere on it turns the view, and a touch drag turns it instead of scrolling. A notch of the wheel is about 1.2 times; out far enough the Moon, the Sun and the planets come into view. */ get immersive(): boolean; set immersive(value: boolean); /** * Meteors seen from space, on or off (the attribute `meteors`): short streaks where meteors burn, on the dark side of the Earth and in its twilight, more of them under an active shower, only while the * clock runs, and for a reader who prefers reduced motion only once the page has set a `speed` (a Play). Each streak's place and moment are drawn at random, and a line under the picture says so * (`meteors-label="off"` takes it away); how often they appear, where, how high and when follow real data (`@johnmorrisdotca/chikyu-earth/meteors`). None are drawn while the Earth is under 40 pixels in radius. * `chikyu-meteors` is sent when the strongest active shower changes, with `detail: { shower, zhr }`. Off by default, and nothing of theirs is made until they are first switched on. */ get meteors(): boolean; set meteors(value: boolean); /** * How strongly the meteors are drawn, from 0 to 1 (the attribute `meteors-strength`; 1, the full look, when the page says nothing): it scales how bright each streak is and how many are drawn, so 0.3 is * fewer and fainter and 0 draws none. It changes nothing that is real: the rates, the showers and `chikyu-meteors` are the same at every strength, and the line under the picture still says the streaks are an illustration. * A number outside the range is brought to its nearest end; setting the property writes the attribute. */ get meteorsStrength(): number; set meteorsStrength(value: number); /** * The name written on the Earth, as the family's body label: `EARTH` (`地球` on a Japanese page) laid on the globe so it turns with it, the surface showing through the letters. Off (`null`) unless the page sets it. The plain attributes are the family's: * `body-label` (`painted`, `etched`, `outline` or `burned`; absent, no label), `body-label-strength` (0 to 1, 0.5), `body-label-repeat` (`once`, `both` or `around`), `body-label-latitude` (degrees), `body-label-facing` (present: always facing the reader), * `body-label-font` (a CSS font family the page has loaded; Michroma, fetched once, when left out) and `body-label-fallback-font` (for letters the font has none of, such as Japanese). The property is the same options as an object, or `null`; setting it writes the attributes. * Nothing of it is fetched or made until it is first set, it is not drawn while the Earth is under 24 pixels in radius, and nothing is drawn at rest. A three.js handed over with `setThreeLoader` must include `CanvasTexture`, `SphereGeometry`, `MeshLambertMaterial`, `SRGBColorSpace`, `NormalBlending` * and `AdditiveBlending`; without them `chikyu-body-label-unavailable` is sent and the name is not drawn. */ get bodyLabel(): BodyLabelSettings | null; set bodyLabel(value: Partial | null); /** * The names of the brightest stars and the constellations as faint lines, laid over the sky the page draws (hoshi-stars' `sky-labels`, an optional peer loaded only when one of these is set). The plain attributes are hoshi's: `star-names` (a count of the brightest stars in view and not covered by the * Earth, the Moon or the Sun; bare is 10), `star-names-magnitude` (only stars at least that bright) and `constellation-lines` (the 88 figures as lines at this strength, 0 to 1; bare is 0.16): none of them, and nothing is loaded. The figure under the pointer or touched is at full strength and shows its name. Names are in the * page's language and never overlap. Nothing is redrawn at rest. `chikyu-sky-unavailable` is sent when hoshi-stars is not there. The property is the look of the names, a partial `SkyLabelStyle` (font, size, case, ring, leader and the rest). */ get skyStyle(): Partial; set skyStyle(value: Partial); /** * The constellation that is picked, by its IAU abbreviation (`Ori`), or `null`. A reader picks one by a click or a tap on its lines or inside its figure (and with the key `C`, or `Shift`+`C` for the previous, while the element has the focus); a click on empty sky, or `Escape`, lets it go. The picked figure's lines are lit and its name is * shown at the middle of the part of it in view, until another is picked or it is let go. A page sets the property to pick one itself, which sends no event. `chikyu-constellation-pick` is sent at each pick of the reader's, with `detail` `{ abbreviation, id, name, english, japanese, kind, culture }` (`culture` is `iau` unless `constellation-culture` names another), and `null` when it is let go; `chikyu-constellation-hover` is sent the same way as a mouse rests on a figure and leaves it. * A press or a tap on a named star, or on a figure, also sends `chikyu-sky-pick`: a star is `{ kind: "star", hr, name, designation, x, y, pointerType }` (`name` as drawn, `x` and `y` CSS pixels inside the element) and a figure is `{ kind: "constellation", abbreviation, pointerType }`. Each named star and each figure in view is a button, so a keyboard reaches it and Enter picks it, and the pick is read out; the keys `C` and `Shift`+`C` (the next and the previous figure) send it too. Nothing is drawn at rest. * Needs `constellation-lines` set. `constellation-culture` (`iau` by default, `western`, `japanese` or `chinese`; each is fetched only when asked for, and the value is exactly what the page sets) makes the figures, the pick and the names those of that sky culture. The attribute `constellation-names` (off by default) writes the name of every figure in view at the middle of the part of it that is on the picture, quieter than the star names and clear of them, of the Earth, the Moon, the Sun, the places and satellites named, and of the places kept clear (`keepClear`). */ get constellation(): string | null; set constellation(value: string | null); /** * Places on the picture where the sky's names must not go: a page's own text laid over the element, say. Each is a rectangle in the element's own CSS pixels from its top left (`{ x, y, width, height }`), or an element of the page whose box is read. A star name whose box touches * one is left out, and so is a star whose point is in one (the next star is named instead); the picked constellation's name is moved clear of it. The lines are still drawn. The boxes are read when the list changes, when the page or an element is resized or scrolled, and not at each frame: a * page that moves its text without resizing it sets the property again. The attribute `keep-clear` takes a CSS selector for the same (`keep-clear=".hero h1, .hero .lead"`). Nothing is redrawn at rest. */ get keepClear(): SkyKeepClear[]; set keepClear(value: readonly SkyKeepClear[] | null); /** * Places marked on the Earth (the attribute `places`, a JSON array): each `{ id, lon, lat, label, kind, color }`, `kind` being `here` (where the reader is: drawn bright and taller, with a quiet pulse) or `favourite` * (the default: quieter), and `color` an optional CSS colour of its own. The first `PLACE_MARKS` in sight (`here` first, then in the order given) stand up out of the ground with their names; every other place * is a ring on the ground, all of them one draw call, and places that crowd are gathered into one ring with their count. They turn with the Earth, are hidden on its far side, are dimmer on its night side * and keep their size in pixels at any zoom. Names never overlap one another or the bodies' names; one with no room is left out. The element stores nothing and sends nothing: the page hands the places * over and keeps them where it likes. Setting the property writes the attribute; at most `MAX_PLACES` are drawn. Nothing is drawn again at rest: the pulse is the page's own animation, stopped out of sight * and for a reader who asked for less motion. */ get places(): Place[]; set places(value: readonly Place[]); /** * Name each `here` place with the nearest city (the attribute `here-city`). `false` (the default) leaves the page's label and loads nothing. * `true` looks within 100 km (`HERE_CITY_KM`). A number is that limit in kilometres, at most 20,000 (`HERE_CITY_MAX_KM`); a city further away is not used, and the page's label stays. * The cities are kuni's capitals, the other cities of a million and the others of 100,000, an optional peer loaded only when this is on and a `here` place is set. The name follows the page's language * (the short Japanese name, then the Japanese name, else English). `places` is not changed: only the drawn name is. Nothing is drawn again at rest. * * @example * ```ts no-run * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.querySelector("chikyu-space") as ChikyuSpace; * space.hereCity = true; * console.log(space.hereCity); // 100 * space.hereCity = false; * ``` */ get hereCity(): false | number; set hereCity(value: false | true | number); /** * A route between two places (the attribute `route`, `lon,lat,lon,lat`). Null, the default, draws none. The line is the WGS84 geodesic, split at the date line, and it turns with the Earth. * Setting the property writes the attribute. Nothing is drawn again at rest: the line is drawn with the picture, and only when the route or the view changes. */ get route(): { from: GeoPoint; to: GeoPoint; } | null; set route(value: { from: GeoPoint; to: GeoPoint; } | null); /** The distance, bearings and flight-time estimate for `route`, or null when none is set. The flight time assumes 900 km/h. */ get routeInfo(): RouteLeg | null; /** * Turn the view so a place of `places` is in the middle, at a pace a reader can follow (at once with `smooth: false`, for a reader who asked for less motion, or before the picture is live); the zoom stays. * The place is named by its `id`, or by its label in any case. The camera must be looking at the Earth: while it rides along or looks at another body nothing moves. The tilt is held to 90 degrees either * way, so a place more than 90 degrees of latitude from `center` comes as near the middle as that allows. * * @param text - The place's id or label. * @param options - `smooth` (true by default). * @returns The place, once the turn has started; `undefined` when there is no such place or the camera is not looking at the Earth. */ goToPlace(text: string, options?: { smooth?: boolean; }): Promise; /** * Whether places that crowd are gathered into one ring with their count (the attribute `place-groups`): on by default, `off` leaves every place its own ring. Setting the property writes the attribute. * * @example * ```ts no-run * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.querySelector("chikyu-space") as ChikyuSpace; * space.placeGroups = false; * space.getAttribute("place-groups"); // "off" * space.placeGroups = true; * space.hasAttribute("place-groups"); // false * ``` */ get placeGroups(): boolean; set placeGroups(value: boolean); /** How the places are drawn (the attribute `places-look`): `beam` (a light rising out of the ground with a ring at its foot, the default), `pin` (a thin stick with a round head) or `ring` (only the ring on the ground). */ get placesLook(): PlaceLook; set placesLook(value: PlaceLook); /** * The look of the names of cities (`city-names`): font, size, weight, colour, the outline round the text, and the dot's colour and size. Any of them may be left out; the Earth's size, the language and the data are not set here. */ get cityNamesStyle(): CityNamesStyle; set cityNamesStyle(value: CityNamesStyle); /** * Whether a beam of light is drawn from the chosen satellite down to the ground below it (the attribute `beam`, off unless set). The chosen satellite is the one marked with `selectSatellite` or a press, * or the one ridden (Ride along and Ride above, where the camera looks down the beam). The beam is a soft cone, brighter at the satellite and fading towards the ground, ending in a lit ring on the * surface: the footprint, the circle from which the satellite stands above `beamElevation` degrees (25), true to its height. Behind the Earth it is cut off by the limb. It is drawn with the draw that * moves the satellite, and nothing is drawn at rest. Setting it writes the attribute, or takes it away; `stats.beam` says the footprint's radius in kilometres. * * @example * ```ts no-run * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.querySelector("chikyu-space")!; * space.beam = true; * space.beamElevation = 30; * console.log(space.stats.beam.radiusKm); * ``` */ get beam(): boolean; set beam(value: boolean); /** The least elevation, in degrees, from which the footprint counts the satellite as seen (the attribute `beam-elevation`, 25). Setting it writes the attribute. */ get beamElevation(): number; set beamElevation(value: number); /** How many spot cells are drawn inside the footprint, 0 for none (the attribute `beam-cells`, up to 91). They are an illustration of a satellite that serves the ground in cells, not any operator's plan. */ get beamCells(): number; set beamCells(value: number); /** A spot cell's radius on the ground in kilometres, at most what fits (the attribute `beam-cell-size`, 0 for the fit). */ get beamCellSize(): number; set beamCellSize(value: number); /** The beam's colour, any CSS colour (the attribute `beam-color`, a pale blue). */ get beamColor(): string; set beamColor(value: string); /** How strong the beam is, from 0 to 1 (the attribute `beam-strength`, 0.6). */ get beamStrength(): number; set beamStrength(value: number); /** Whether the meridians and parallels are drawn on the Earth (the attribute `grid`). Setting it writes the attribute, or takes it away. */ get grid(): boolean; set grid(value: boolean); /** * The look of the names of countries (`country-names`): font, weight, colour, the outline round the text, and the smallest and largest text size. Any of them may be left out; the Earth's size, the * language and the data are not set here. */ get countryNamesStyle(): CountryNamesStyle; set countryNamesStyle(value: CountryNamesStyle); /** * Names of oceans, seas and continents (the attribute `sea-names`). Off unless set: a bare attribute is on. Oceans and continents from far out, seas once the Earth is large on the screen. A city name keeps the space where both fit only one. Nothing is drawn again at rest. * * @example * ```ts no-run * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.querySelector("chikyu-space") as ChikyuSpace; * space.seaNames = true; * console.log(space.seaNames); * space.seaNames = false; * ``` */ get seaNames(): boolean; set seaNames(value: boolean); /** * Which borders are drawn on the Earth (the attribute `borders`): the countries' at any size, and the regions' (provinces, states, prefectures) once the Earth is large enough on the screen to tell them apart. * Setting it writes the attribute: both sets as `borders="countries regions"`, one as its own word, none takes the attribute away. */ get borders(): BorderSets; set borders(value: BorderSets); /** * Where the borders' shapes come from (see `BorderData`): `countries` in place of chizu's `world-geo`, and `regions`, a country's regions by its code, which draws the regions; without it none are drawn. * Set it before `borders` is switched on: shapes already loaded are kept. */ get borderData(): BorderData; set borderData(value: BorderData); /** * How many times its real thickness the air is drawn, from 1 (the true thickness) to 5 (the attribute `air-thickness`; 3 when the page says nothing): see ``. While it is above 1 the element says so in a line * under the picture (`air-label="off"` takes the line away, for a page that says it itself). */ get airThickness(): number; set airThickness(value: number); get centre(): GeoPoint; set centre(value: GeoPoint); /** * How the camera is held (the `camera` attribute). `space` (the default): held in the stars, looking at the place `center` names as it is at the moment the camera is set (when the element opens, and again when `time` or `center` is set), so the Earth * turns beneath it as the clock runs, with the day and night line where the Sun really is. `ground`: held over `center` on the ground, so the Earth keeps still and the clock moves the light across it. `sun`: held on the Sun's side, `center` being the * longitude and latitude from the sub-solar point (`0,0` looks straight at the noon place), so the day and night line keeps its place on the screen while the Earth turns beneath. */ get camera(): CameraMode; set camera(value: CameraMode); /** * How much of the Earth's turn the space camera takes, from 0 to 1. 0, the default, holds the stars: the Earth turns beneath the camera, which is what `camera="space"` already does, so a page that sets nothing keeps that. * 1 turns with the Earth, so the ground under the middle stays. A value between takes that share of the turn. Changing it does not move the longitude under the middle. `follow-ease` is how many seconds the change takes (0.4 when left out, 0 for none; at once when the reader asks for reduced motion). It asks for no frame of its own once the change has settled, and none while the clock is stopped. */ get follow(): number; set follow(value: number); /** Seconds `follow` takes to change. Left out, 0.4. `0` changes at once. */ get followEase(): number; set followEase(value: number); /** The longitude, in degrees, under the middle of the view, or null before the first draw. */ get centreLongitude(): number | null; /** The moment of the last draw, in milliseconds, or null before the first. The longitude under the middle belongs to this moment. */ get shownTime(): number | null; /** The share of the view's shorter side the Earth's disc fills at zoom 1 (the `earth-size` attribute): 0.9 by default, so the atmosphere's glow is never cut at any shape of box. Above 1 the Earth is larger than the view. */ get earthSize(): number; set earthSize(value: number); /** Where the Earth's centre is across the view (the `earth-x` attribute): 0 at the left edge, 0.5 in the middle (the default), 1 at the right edge. */ get earthX(): number; set earthX(value: number); /** Where the Earth's centre is down the view (the `earth-y` attribute): 0 at the top, 0.5 in the middle (the default), 1 at the bottom. */ get earthY(): number; set earthY(value: number); /** The moment shown: milliseconds since the epoch, or "now" to follow the clock. Setting it points the camera at the same place on the ground again. */ get time(): number; set time(value: number | Date | "now"); /** Seconds of game time per second: 1 is real time, 0 holds still, negative runs backwards. */ get speed(): number; set speed(value: number); get scale(): ScaleMode; set scale(value: ScaleMode); get labels(): boolean; set labels(value: boolean); /** * How the Sun, the planets, Pluto and their moons are drawn: one of the `looks` of the body painter set with `setBodyPainter` (wakusei-planets has `realistic` and `painted`), or `plain` (the sphere in the right colour, no moons); empty for the painter's first. * With no painter they are plain spheres and this does nothing. Changing it draws the bodies again with the new look. */ get bodies(): string; set bodies(value: string); /** * Dim the name of a satellite the Earth hides, and leave its ring off (the attribute `dim-occluded`). On by default. `off` leaves that name out. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.createElement("chikyu-space") as ChikyuSpace; * space.dimOccluded = false; * console.log(space.dimOccluded); * ``` */ get dimOccluded(): boolean; set dimOccluded(value: boolean); /** How the Earth is lit: `sun` (true, the default), `lit` (always lit, as if by daylight from the camera's side, so a ride on the night side is never a black frame) or `boost` (the true terminator, with the night side raised). The Sun, the Moon and the planets keep their true places. */ get light(): LightMode; set light(value: LightMode); /** The looks the body painter offers (empty with no painter), for a page to build its choice from. */ get bodyLooks(): readonly string[]; get orbits(): boolean; set orbits(value: boolean); /** * The shared controls' camera: yaw and tilt turn the view (the Earth's surface moves right for a drag right and up for a drag up), zoom brings the camera in (1 shows the Earth, less shows the sky round it). Pan is not used. A turn that moves nothing on the screen by half a pixel is kept * for the next draw but does not cause one unless `final` is true (the default), so an Auto-turn at the Earth's own rate costs a draw every half minute, not thirty a second. * * @param view - The controls' yaw and tilt in degrees and zoom. * @param final - False for the frames of a turn that is still going on (Auto-turn, a drag); true when it has settled. */ setView(view: { yaw: number; tilt: number; zoom: number; }, final?: boolean): void; /** The body the camera looks at: at zoom 1 it fills the view; the yaw and tilt turn the camera round it. */ get body(): BodyName; set body(name: BodyName); /** * Ride along with a body or a satellite. By default the camera sits at it and looks at the Earth, with the way it is going at the top of the picture, at its real place for the moment shown, so the * Earth turns and slides beneath as it moves along its orbit (an ISS view goes round about every 90 minutes). A drag looks about from there (a drag right turns the camera to its left and a drag up tips it towards the bottom of its picture, so the ground follows the pointer), the shared controls' zoom narrows the view. * A satellite is `{ group, index }` of a group set with `setSatellites`; it is placed exactly, one SGP4 call a frame, at any speed. Another call switches smoothly; `null` stops. The draw rate follows how * fast the picture moves, never more than 30 a second (one a second for a reader who asked for reduced motion), and nothing is drawn out of sight. * * @param target - A body name (`"Moon"`, `"Mars"`, ...) or a satellite `{ group, index }`, or `null` to stop. * @param options - `view`, `look`, `distanceKm`, `smooth` (see `RideOptions`). */ ride(target: RideTarget | null, options?: RideOptions): void; /** * Face one way while riding: `ahead` along the way it goes, `behind`, `left` or `right` (as seen facing ahead), `down` straight at the Earth, `up` straight away from it. * In the `above` view, `down` looks straight down at the satellite and the Earth below it. The camera glides there in half a second (at once for a reader who asked for reduced motion) and keeps the zoom. * The facing stays pressed until the view is turned or tipped. `chikyu-ride-face` is sent with `{ face }` (`null` when it is let go). Keys, while the element is focused: W ahead, S behind, A left, D right, R up, F down. The arrow keys stay with the view controls. * * @param face - The way to face. * Following a body (a planet, the Moon) there is no way to face: it returns `false`. Held keys do not repeat, and keys typed in a field or in editable text are left to it. * * @returns Whether the camera faces that way now (`true` too when it already did, and nothing moves). */ face(face: RideFace): boolean; /** The facing (`face`), while the view has not been turned or tipped from it; `null` otherwise. */ get facing(): RideFace | null; /** * The satellites the page has a model for (`setSatellitePainter`) in the groups now set, each with its name in the page's language: the large satellites that can be followed as a model. Empty with no painter. */ largeSatellites(): { ref: SatelliteRef; noradId: number; name: string; }[]; /** * Follow the next (or, with a negative `step`, the previous) of the large satellites in `largeSatellites()`, going round: the first when none is followed yet. The followed satellite stays in the middle of the picture, as a model where the page has one, * with the Earth turning and sliding beneath. Returns the satellite now followed, or `null` when there is none to follow. * * @param step - How many places to hop: 1 (the default) is the next. */ followNext(step?: number): { ref: SatelliteRef; noradId: number; name: string; } | null; /** * Where a ride puts the camera: `outside` (the default; the attribute `ride-viewpoint`) shows the satellite, `inside` puts the camera at it. It is the default for the next `ride` and, set while riding, moves the ride there in one eased glide (a jump for a reader who asked for reduced motion), keeping the ride and the clock. * See `RideOptions.viewpoint`. */ get rideViewpoint(): RideViewpoint; set rideViewpoint(value: RideViewpoint); /** * How the model of a satellite seen from above is sized as the camera rises: `distance` (the default; the attribute `ride-model-size`) lets it shrink with the height and hand over to the ordinary mark (ring and name) between 1,000 and 2,000 km, `fixed` keeps the same share of the picture at every height, as 0.46.1 did. * It is the default for the next `ride` and, set while riding, changes the one ridden at the next draw. See `RideOptions.modelSize`. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.createElement("chikyu-space") as ChikyuSpace; * space.rideModelSize = "fixed"; * console.log(space.rideModelSize); * ``` */ get rideModelSize(): RideModelSize; set rideModelSize(value: RideModelSize); /** * The radius of the ridden satellite's model as a share of the picture's height, 0.02 to 1.2 (the attribute `ride-model-share`), or `null` for the ride's own: 0.22 along the way it goes, 0.17 above the satellite (its size at the lowest height; `ride-model-size="distance"` still shrinks it as the ride rises). * Set while riding it glides in 0.4 s (at once for a reader who asked for less motion). `stats.followModel.share` is the share in use. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.createElement("chikyu-space") as ChikyuSpace; * space.rideModelShare = 0.4; * console.log(space.rideModelShare); * ``` */ get rideModelShare(): number | null; set rideModelShare(value: number | null); /** * Where the middle of the ridden model sits in a ride along the way it goes, as a share of the picture's height from the top, 0.5 to 1.4 (the attribute `ride-model-seat`; 0.5 the middle, 1 the bottom edge), or `null` for the ride's own (0.86). The camera moves to keep the satellite there. * Set while riding it glides in 0.4 s (at once for a reader who asked for less motion). `stats.followModel.seat` is the seat in use. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.createElement("chikyu-space") as ChikyuSpace; * space.rideModelSeat = 1; * console.log(space.rideModelSeat); * ``` */ get rideModelSeat(): number | null; set rideModelSeat(value: number | null); /** * The zoom of a ride, 0.5 to 40 (the attribute `ride-zoom`): the field of view is 60 degrees over it from the satellite, so 40 looks at 1.5 degrees of the ground below. Set while riding the view glides in 0.4 s (at once for a reader who asked for less motion). * It is the shared controls' zoom, so their pinch, wheel and keys move it too. `stats.ride.groundKm` says how many kilometres of ground the picture spans, to stop where the tiles stop being sharp. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.createElement("chikyu-space") as ChikyuSpace; * space.rideZoom = 8; * console.log(space.rideZoom); * ``` */ get rideZoom(): number; set rideZoom(value: number); /** What the camera is riding along with now, or null. */ get riding(): Riding | null; /** * Colour each satellite by its orbit class (low, medium, geostationary, highly elliptical, other). Off by default, so a group keeps the colour it was given. The attribute is `satellite-tint="orbit"`. */ get satelliteTint(): "off" | "orbit"; set satelliteTint(value: "off" | "orbit"); /** * The longest a satellite's streak may be on the screen, in CSS pixels (the attribute `satellite-streak-max`; 8 when the page says nothing; `0` or `off` for no cap). Above 60 times real time each satellite is drawn as a streak along its orbit * for the stretch one frame spans, and at a fast clock that stretch is long: at an hour a second a low satellite would cross a tenth of the Earth in one frame. The cap is a length on the screen, so a low and a high satellite are drawn equally long, and the streak keeps the look it has at 10 minutes a second at any speed. It is the smaller of this number of pixels and 0.025 of the Earth's drawn radius (about 160 km of orbit, what a low satellite covers in a frame at 10 minutes a second), so as the Earth is drawn smaller the streak shrinks in proportion, to a dot, instead of staying as long on a small Earth as on a large one. The marks also lose weight on a small Earth: below a drawn radius of 150 pixels the streaks are fainter and the dark rim of the dots fades, gone at 40 pixels, and a crowd of satellites on a small Earth is drawn fainter in proportion so thousands of them do not wash it. Pointing along the orbit and ending at the satellite, it is the same length at any frame rate. Off restores the whole stretch. * * @example * ```ts * import "@johnmorrisdotca/chikyu-earth/space/element"; * * const space = document.querySelector("chikyu-space")!; * space.satelliteStreakMax = 12; * ``` */ get satelliteStreakMax(): number; set satelliteStreakMax(value: number); /** * Show a group of satellites (made by `createSatellites`) under a name, or take the group away with `null`. A group is one draw call however many satellites it holds. Giving the name of a group * that is already shown replaces it. `style`: `color` and `size` (CSS pixels) of the dots, and `orbits` to draw every orbit (only for a group of 40 or fewer, such as the stations). * The groups are placed by SGP4 about once a second and interpolated between. Above `MAX_SATELLITE_SPEED` each satellite is a short streak along its orbit instead of being hidden. * * @param group - The group's name, for `showSatellites`, `selectSatellite` and the events. * @param satellites - The group, or `null` to remove it. * @param style - How to draw it. */ /** * Paint one satellite's path on the Earth. `id` is a NORAD catalogue number or `group:index`. `length` is how long the trail is kept, in simulated time (`1d` when left out, or `1w`, `1m`). `swath` is `track` (the point under the satellite, the default) or `coverage` (where it is at least 10° above the horizon). Setting another satellite clears the trail. `null` clears it. */ get paint(): PaintSpec | null; set paint(value: PaintSpec | null); /** Take the painted trail off the Earth. */ clearPaint(): void; /** Texels the trail has painted. 0 after `clearPaint`, and again when the painted satellite changes. */ get paintPixels(): number; setSatellites(group: string, satellites: Satellites | null, style?: Partial): void; /** Show or hide a group without losing it. */ showSatellites(group: string, on: boolean): void; /** * The groups now set. `count` is how many satellites the group holds, `visible` is the shown state from `showSatellites` (a focus does not change it), `placed` is how many the last draw placed (0 when the group is not drawn) and `emphasis` is how a focus treats it: `focus`, `dim`, `hidden` or `plain` (no focus). */ get satelliteGroups(): { name: string; count: number; visible: boolean; placed: number; emphasis: "focus" | "dim" | "hidden" | "plain"; }[]; /** The group `focusSatelliteGroup` is showing on its own, or `null`. */ get focusedSatelliteGroup(): string | null; /** * Show one group on its own. The others are drawn dimmer (`others: "dim"`, the default, through the same dimming an old element set uses) or not drawn (`"hide"`). `frame` (true by default) pulls the camera back, by this view's own zoom, until the group's orbits fit: the distance is the greatest apogee of the group, from each satellite's mean motion and eccentricity, and it stops at 8 Earth radii. `null` puts every group back to the shown state it had, and puts the camera back when it was moved. A name that `setSatellites` has not set returns `{ ok: false, reason: "not-set" }` and changes nothing. It does not throw. When the choice changes, `chikyu-satellite-focus` is sent with `{ group, count }`. * * @param name - The group's name, or `null` to clear the focus. * @param options - `others` and `frame`. * @returns `{ ok: true, group, count }` when the group is set (`group` is `null` and `count` is 0 when cleared). `{ ok: false, reason: "not-set" }` when it is not. */ focusSatelliteGroup(name: string | null, options?: { others?: SatelliteOthers; frame?: boolean; }): { ok: true; group: string | null; count: number; } | { ok: false; reason: "not-set"; }; /** * Draw a faint orbit while the pointer rests on a satellite. On unless `hover-path="off"`. Left unset, it is on when `names-on-hover` is on. * The colour and the opacity are the custom properties `--chikyu-hover-path` and `--chikyu-hover-path-opacity`. */ get hoverPath(): boolean; set hoverPath(value: boolean); /** Show a satellite's name while the pointer rests on it. On unless `names-on-hover="off"`. A touch does not rest, so it shows nothing. */ get namesOnHover(): boolean; set namesOnHover(value: boolean); /** Mark one satellite: a larger ring round it, its orbit drawn, and its name beside it. `null` lets it go. */ selectSatellite(ref: SatelliteRef | null): void; /** * Keep placing satellites that are far from their element sets, as an estimate (the attribute `estimate-far`, off unless set; `estimate-far="off"` is off). A satellite is left out when the moment shown is more than `maxAgeDays` (30) from its elements; on, it is carried forward or back by the same SGP4 code * instead, and drawn lighter than a dimmed one. **An estimate is where the satellite would be if its orbit had not changed since the elements were taken.** It is worst for low orbits (drag changes them within days, and a manoeuvre moves the satellite along its path, so after weeks the estimate can be far along the orbit from the truth, and a satellite that has re-entered is not there at all) and for a long time away; a high orbit changes slowly and is close for months. Never before a satellite's launch or after its decay when its elements carry `LAUNCH_DATE` and `DECAY_DATE` (else the year of its `OBJECT_ID` is the earliest); * one SGP4 cannot carry that far, or brings down below about 120 km, is left out and is not counted as placed. Each estimated satellite is `estimated: true`, with `estimatedDays`, in `placeSatellite`, `satelliteInfo`, `chikyu-satellite-visibility` and `chikyu-satellite-click`, and `stats.satellites.estimated` counts them. * It applies to every group, those the page made with `createSatellites(sets, { estimateFar: true })` too. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space"; * * const farFromToday = (space: ChikyuSpace): void => { * space.estimateFar = true; * space.addEventListener("chikyu-satellite-click", (event) => console.log((event as CustomEvent).detail.estimated, (event as CustomEvent).detail.estimatedDays)); * }; * console.log(typeof farFromToday); * ``` */ get estimateFar(): boolean; set estimateFar(value: boolean); /** The satellite marked by `selectSatellite` or by a press on it, if any. */ get selectedSatellite(): SatelliteRef | null; /** * Draw these satellites' orbits at once, each in a look from the table (`pathStyles`), without a satellite being chosen. One draw call for all of them and the chosen satellite's own orbit, and nothing is drawn at rest. At most 16 are kept, the last of the list. * `id` is a NORAD catalogue number or `group:index` (`stations:0`); an id that matches no satellite is skipped (`stats.paths.unresolved`). A satellite asked for twice is drawn once, in the later look. `style` is the name of a look (`selected`, `hovered`, `favourite`, `path`, or one of the page's own) * or a partial look over `path`. `[]` takes them all away. Where the pointer is on one, `chikyu-path-hover` and `chikyu-path-click` say which (`path-hit`). * * @param list - The paths, oldest first. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space"; * * const show = (space: ChikyuSpace): void => space.setPaths([{ id: 25544, style: "favourite" }, { id: "stations:1", style: { color: "#7fdbff", dash: [8, 4] } }]); * console.log(typeof show); * ``` */ setPaths(list: readonly PathRequest[]): void; /** The paths in use, as set (the last 16). Setting it is `setPaths`. */ get paths(): PathRequest[]; set paths(list: readonly PathRequest[]); /** * Change the looks the paths are drawn in, by name. Each entry is a partial look over the built-in one of that name (or over `path`, for a name of the page's own); `null` takes the page's entry away. Without `replace` the entries are added to those already set. * The built-in looks differ by width and dash as well as colour: `selected` (white, 2 px, solid, also the look of the chosen satellite's own orbit), `hovered` (white, 1.5 px, dashed), `favourite` (amber, 1.75 px, dotted) and `path` (white, 1.5 px, solid). * A look is `{ color, width (0.5 to 8 CSS pixels), opacity (0 to 1), dash ([dash, gap] in CSS pixels, or null) }`. * * @param table - The entries by name. * @param replace - `true` to drop the entries set before. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space"; * * const quiet = (space: ChikyuSpace): void => space.setPathStyles({ selected: { color: "#ffd166", width: 3, dash: null } }); * console.log(typeof quiet); * ``` */ setPathStyles(table: Readonly | null>>, replace?: boolean): void; /** The table of looks in use, whole: the built-in ones with the page's own over them. A copy. */ get pathStyles(): Record; set pathStyles(table: Readonly | null>>); /** * Draw the chosen satellite's own orbit (the attribute `selected-path`; on unless `off`). Off, `selectSatellite` still rings and names the satellite and a ride still follows it, but no line is drawn: the page draws it, with `setPaths` and the `selected` look, or its own. The look of the line when it is on is the `selected` entry of `pathStyles`. */ get selectedPath(): boolean; set selectedPath(value: boolean); /** * How near, in CSS pixels, the pointer has to be to a path for the pick and hover events to report it (the attribute `path-hit`; 8 when left out, 0 to 40; `0` or `off` turns the test off). A touch is given twice that, and at least 16. * The test covers the page's paths and the chosen satellite's own orbit, not the part of an orbit the Earth hides, and a satellite's dot under the pointer comes first. In a ride from a satellite the test is off unless the attribute is set. */ get pathHit(): number; set pathHit(value: number); /** * Which is heard first where a satellite's dot and a path lie under the pointer (the attribute `path-priority`): `dots`, the default, or `paths`. With `dots` a press or a hover is the dot's, and a path is heard only where no dot is within 12 px: at the Low level, with thousands of dots crowding a line, a path can go unheard. * With `paths` a path of the page's (`setPaths`, or the chosen satellite's own orbit) is heard before a dot, **except** a dot of a satellite that is itself one of the paths' satellites or the chosen or ridden one: that satellite's own dot still wins, and a press on it is `chikyu-satellite-click`. * Either way one press has one meaning, in this order. `dots`: any dot, then a path, then the sky. `paths`: a listed or chosen satellite's dot, then a path, then any other dot, then the sky. Anything but `paths` reads as `dots`. */ get pathPriority(): "dots" | "paths"; set pathPriority(value: "dots" | "paths"); /** * The path under a point of the element, from the last draw: its id as given, the satellite (`ref`, the same shape as in `chikyu-satellite-click`), the name of its look, the nearest point on it and the distance to it, or `null`. * * @param x - CSS pixels from the element's left. * @param y - CSS pixels from its top. * @param radiusPx - How near the point must be, 0 to 200; `path-hit` when left out. * @returns The path, or `null` when none is within reach. * * @example * ```ts * import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space"; * * const name = (space: ChikyuSpace, x: number, y: number): string => space.pathAt(x, y, 10)?.style ?? "none"; * console.log(typeof name); * ``` */ pathAt(x: number, y: number, radiusPx?: number): PathHit | null; /** * Ring and name every satellite of a group (or stop): a ring round each and its name beside it, in the page's language (the ISS, Tiangong and Hubble by their short names, the rest as their elements name them, or as `satelliteNames` says), never over another name, a place's or a ring's. * Names and rings are drawn with the places, only for satellites that are in the picture and not behind the Earth, and nothing is drawn at rest. `chikyu-satellite-visibility` is sent with `detail: { ref, visible }` when a labelled satellite comes into view or goes out of it (not at every frame). * At most 80 satellites are ringed, over all the groups. A group that is not set, or is not shown, has none. * * @param group - The group's name, as given to `setSatellites`. * @param on - `true` to ring and name its members (the default), `false` to stop. */ labelSatellites(group: string, on?: boolean): void; /** * Ring and name these satellites, besides any group `labelSatellites` names. Pass an empty list to take them off. One draw, then nothing at rest. * * @param refs - The satellites, by group and index, as `setSatellites` knows them. */ ringSatellites(refs: readonly SatelliteRef[]): void; /** The groups whose satellites are ringed and named now (`labelSatellites`). */ get labelledSatellites(): string[]; /** * The names written beside the ringed satellites, by NORAD number, for a page in another language or with names of its own (`{ 25544: "Space Station" }`). One left out keeps its short name (the ISS, Tiangong and Hubble) or the name in its elements. */ get satelliteNames(): Record; set satelliteNames(value: Record); /** * Where a satellite is on the screen as of the last draw: `{ x, y, visible, heightKm, edge, behind, occluded }` in CSS pixels from the view's top left. `visible` means it is inside the box, in front of the camera and not behind the Earth. `edge` is `top`, `right`, `bottom` or `left` when the place lies beyond that edge, and `null` when it is inside the box. `behind` is true when it is behind the camera (the picture would mirror it, so `edge` is read from the camera's own axes). `occluded` is true when the Earth hides the satellite and false at the limb, in front, and when it is only behind the camera. `x` and `y` may lie outside the box. `null` when its group is not set or not shown, or it cannot be placed (its elements are too old). It is the picture's own camera maths and its own test for the Earth in the way, so a page that draws its own rings, or a mark on the edge, need not repeat either. */ placeSatellite(ref: SatelliteRef): SatelliteScreen | null; /** Facts about one satellite at the moment shown (name, number, element age, height, speed, period, and `ownerCountry` when the owner is one country); undefined if it cannot be placed then. */ satelliteInfo(ref: SatelliteRef): SatelliteInfo | undefined; /** The words shown beside each body, for a page in another language (`{ Mars: "火星" }`). A body left out keeps its English name. */ get bodyNames(): Partial>; set bodyNames(value: Partial>); /** What a screen reader hears after a body's name: "choose to look at it" by default, or the page's own words. */ get bodyHint(): string; set bodyHint(value: string); /** The radius and the distance from the Earth of a body now, for a page's own caption. */ bodyInfo(name: BodyName): BodyInfo; /** The zoom that shows a part of the sky: the Earth alone, the Moon's orbit, the Sun, the planets out to Mars, or all of them, at this scale and moment. */ zoomFor(preset: SpacePreset): number; /** What the element is doing, for a page or a test. */ get stats(): { state: SpaceState; draws: number; contexts: number; canvas: { width: number; height: number; pixels: number; }; tiers: Record; distance: number; assets: { entries: number; refs: number; }; time: number; lookups: number; satellites: SatelliteStats; /** The cross-fade when `light` changes to or from `lit` (300 ms, a cut under reduced motion): `mix` is 0 for the true light and 1 for `lit`, and `fading` is true while it moves and another frame is wanted. */ lightFade: { mix: number; fading: boolean; }; /** The page's paths: asked for, drawn (with the chosen satellite's own), left out over the cap of 16, unmatched, whether the chosen satellite's own orbit is drawn, draw calls they took at the last draw (0 or 1), the path under the mouse and the `chikyu-path-click` events sent. */ paths: PathStats; ride: { riding: boolean; lost: boolean; gliding: boolean; facing: RideFace | null; groundKm: { across: number; tall: number; } | null; }; /** The camera as the last draw left it: its place in Earth radii from the Earth's centre, the way it is turned (a unit quaternion, x y z w) and its field of view in degrees. */ camera: { position: [number, number, number]; quaternion: [number, number, number, number]; fov: number; }; /** What the body painter has made at the last draw: the Sun and planets with a drawing, the moons shown round a planet that is near and the moons held (shown, or gone from the view for less than four seconds), whether the Moon is the painter's (`moon`), and the bodies with finer map tiles on them (`tiles`). `mapped` is how many drawings are the painter's, with its pictures: a body out of the view, or too small to show its map, is a plain sphere and the painter is not asked for it. `pending` is how many pictures asked of the painter have not yet arrived, and one more while a gathered draw (reduced motion) waits for its second: while it is above 0 a draw is still to come that nothing but the view itself asked for. */ bodies: { look: string; painted: number; moons: number; held: number; moon: boolean; tiles: number; mapped: number; pending: number; }; /** The meteors: whether they are on, the streaks alive now and started so far, the streaks a second being drawn, and the strongest active shower's code and rate. */ meteors: { on: boolean; strength: number; alive: number; spawned: number; perSecond: number; shower: string | null; zhr: number; }; /** The name written on the Earth: whether `body-label` is set, its text, the label is made, and it is showing (it is hidden while the Earth is small). */ bodyLabel: { on: boolean; text: string; made: boolean; showing: boolean; }; /** The names of the stars and the constellation lines: whether one is asked for, whether hoshi-stars is loaded, the names and figures laid out at the last draw, the figure picked, how many times the layer was drawn, the language its names were last laid out in, and the named stars' own points on the screen (`stars`). */ sky: { on: boolean; loaded: boolean; names: number; figures: number; picked: string | null; pick: string | null; hover: string | null; constellations: number; culture: string; renders: number; lang: string; stars: { text: string; x: number; y: number; }[]; }; /** The followed satellite's model (`setSatellitePainter`), when one is drawn: where its middle is on the screen, in CSS pixels, as of the last draw; `null` otherwise. */ followModel: { x: number; y: number; shown: boolean; parts: number; share: number; seat: number; weight: number; radiusPx: number; box: { left: number; top: number; right: number; bottom: number; }; axes: { x: readonly number[]; y: readonly number[]; z: readonly number[]; }; } | null; /** The finer map tiles (`tiles`): the level wanted now (`null` while the package's own pictures are sharp enough), the tiles held and shown, and the fetches made. */ tiles: TileStats; /** * The places: how many were handed over, how many are in sight at the last draw (`shown`, those gathered into groups included), how many stand up as markers of their own (`marks`) and are named (`labels`), * how many rings the one draw call draws (`sprites`; 0 when the picture cannot draw them), how many circles the page draws instead (`dots`) and how many of the rings are groups (`groups`), the satellites ringed and named, and how many times they were laid out. */ places: { places: number; shown: number; labels: number; renders: number; rings: number; satelliteNames: number; marks: number; groups: number; sprites: number; dots: number; omitted: number; }; /** The nearest city on a `here` marker (`here-city`): whether it is on, the kilometre limit (0 when off), whether kuni's cities have arrived, and whether that load is still going. */ hereCity: { on: boolean; maxKm: number; loaded: boolean; pending: boolean; }; /** The names of cities: whether `city-names` is set and the most it asks for, the Earth's radius on the screen, the tiers of kuni's cities that have arrived and how many cities, the names shown at the last draw and how many times the layer was drawn. */ cityNames: { on: boolean; max: number; radius: number; tiers: string[]; cities: number; names: number; renders: number; }; /** The borders: the segments of each set, whether each was drawn at the last draw, the countries whose regions have arrived, how many times a set's lines were made, and whether a set could not be loaded. */ borders: BorderStats; /** The grid: whether it was drawn at the last draw, whether every 15 degrees (else 30), its segments then, how many times its lines were made, and whether it could not be made. */ grid: GridStats; /** The beam: whether it was drawn at the last draw, the chosen satellite's height, the footprint's radius in kilometres and its angle at the Earth's centre, the elevation, the cells drawn and a cell's radius, and how many times its geometry was made. */ beam: BeamStats; /** The route between two places: whether one is set, and its geodesic distance, great-circle distance and flight time at 900 km/h. */ route: { on: boolean; kilometres: number; greatCircleKm: number; flightHours: number; }; /** The names of countries: whether `country-names` is set and the most it asks for, the countries loaded, the names shown at the last draw, how many times they were laid out, and whether the outlines could not be loaded. */ countryNames: CountryNamesStats; /** The names of oceans, seas and continents: whether `sea-names` is on, the Earth's radius on the screen, the names shown at the last draw, and how many times the layer was laid out. */ seaNames: SeaNamesStats; }; } declare global { interface HTMLElementTagNameMap { "chikyu-space": ChikyuSpace; } }