Weather rows play at the timeline's speed; the frame time shows under reduced motion; tidy the timeline's mark label

A weather row's play ran the world clock at whatever rate it had, and
going live set that back to 1, so the speed chosen on the timeline was
lost. The world clock now keeps its rate while paused and live, and the
timeline's speed sets it whenever it is chosen, so any play runs at it.
A row's play starts from the start of the covered time when live or at
its end, as the timeline's does, and does nothing while every product the
row shows is suspended, as its reduced-motion note says.

Live, the Weather panel's frame time is the newest of each product's
frames, suspended or not, so it no longer goes away under reduced motion,
on a hidden page or without an imagery host.

A weather layer made without a weather clock builds its own when first
enabled rather than when made, so a layer never turned on leaves the
world clock alone, and its own clock (createWeatherClock({ shared: false }))
leaves the world's time where it is when destroyed; only the last shared
weather clock sends the world live.

On the timeline, a zoom or a pan clears the hovered tick's label, a label
is never wider than the track and ends in an ellipsis, and a mark's label
is cut to 60 characters (WORLD_CLOCK_MARK_LABEL_LENGTH).

The changelog entry says what a row's step does, names the earthquake
layer's new exports and says it registers with the world clock.
This commit is contained in:
Sameh Khamis committed 2026-11-14 20:52:45 -08:00
1 parent 558e4a919a
commit 620a337ce8
14 files changed
+351 -71

No files matched your search

+17 -5
View File
@@ -33,6 +33,8 @@
*/
const MARK_TEXT = ['label', 'id', 'kind'];
/** The longest label a mark carries, ellipsis and all. */
export const WORLD_CLOCK_MARK_LABEL_LENGTH = 60;
/**
* A mark (a number, or `{time, label?, id?, kind?}`) in its one shape, or
@@ -51,6 +53,10 @@ function readMark(input) {
const value = input[key];
if (typeof value === 'string' && value.trim()) mark[key] = value.trim();
}
if (mark.label?.length > WORLD_CLOCK_MARK_LABEL_LENGTH)
mark.label = `${mark.label
.slice(0, WORLD_CLOCK_MARK_LABEL_LENGTH - 1)
.trimEnd()}…`;
return Object.freeze(mark);
}
@@ -235,15 +241,17 @@ export function createWorldClock({
jumps += 1;
changed();
},
/** Back to the wall clock; playback stops and its rate goes back to 1. */
/**
* Back to the wall clock; playback stops. The rate stays as chosen, so
* the next play, from wherever it starts, runs at it.
*/
goLive() {
if (live && !playing && rate === 1) return;
if (live && !playing) return;
const stepping = active;
live = true;
cursorMs = null;
playing = false;
active = null;
rate = 1;
jumps += 1;
// Its driven(false) finds nothing left to stop.
stepping?.driver.pause();
@@ -314,7 +322,10 @@ export function createWorldClock({
if (ms === null || ms === undefined) gates.delete(id);
else if (isWorldTime(ms)) gates.set(id, ms);
},
/** Simulated ms per real ms for continuous playback. */
/**
* Simulated ms per real ms for continuous playback. It holds while paused
* and live, so any play (`play()` with no rate) runs at the one chosen.
*/
setRate(nextRate) {
if (!Number.isFinite(nextRate) || nextRate <= 0)
throw new RangeError('World clock rate must be positive');
@@ -419,7 +430,8 @@ export function createWorldClock({
* `marks` are the moments in that span worth going to (a launch, a strong
* earthquake), drawn as ticks the timeline's arrow keys step to. Each is
* an epoch ms number, or `{time, label?, id?, kind?}`: `label` is short
* text the timeline shows for it (a name, `M6.4 · a place`), `id` the
* text the timeline shows for it (a name, `M6.4 · a place`; one longer
* than WORLD_CLOCK_MARK_LABEL_LENGTH is cut to it, ending in `…`), `id` the
* layer's own key for the event and `kind` what sort of event it is.
* Numbers and objects may be mixed; a mark with no finite time is
* ignored, as are a label, id or kind that is not a non-empty string.