Merge main and switch Cesium and Navara in place through Vue

Preserve the camera, map source and layer selection across engine sessions. Restore the previous engine if startup fails and retain local history navigation.
This commit is contained in:
German Khokhlov committed 2026-11-02 13:10:36 +04:00
commit b8f4d097c4
1691 files changed
+225876 -41594

No files matched your search

+57 -68
View File
@@ -22,6 +22,7 @@ import {
placementVariants,
} from './worldOverlayDraw.js';
import { WORLD_OVERLAY_STYLE } from './worldOverlayTokens.js';
import { t } from '../i18n/index.js';
/**
* @module worldOverlay
@@ -38,9 +39,6 @@ import { WORLD_OVERLAY_STYLE } from './worldOverlayTokens.js';
const ROOT_ID = 'world-overlay-root';
const CANVAS_ID = 'world-overlay-canvas';
const DETECTION_SURFACE_ID = 'world-overlay-detection-surface';
const ACCESSIBILITY_ROOT_ID = 'world-overlay-actions';
const ACCESSIBILITY_LIST_ID = 'world-overlay-action-list';
const ACCESSIBILITY_STATUS_ID = 'world-overlay-status';
const PAINT_TARGET_SHARED = 'shared';
const PAINT_TARGET_DETECTION = 'detection';
const OCCLUDER_PADDING_PX = 6;
@@ -119,7 +117,6 @@ export const WORLD_OVERLAY_OCCLUDER_SELECTORS = Object.freeze([
'.hud-top-right',
'.hud-bottom-left',
'.hud-bottom-right',
'.hud-top-bar',
'.hud-bottom-bar',
'#space-mission-panel',
'#space-mission-panel-host',
@@ -162,12 +159,16 @@ let _root = null;
let _canvas = null;
/** @type {CanvasRenderingContext2D|null} */
let _ctx = null;
/** @type {HTMLElement|null} Focusable mirror of painted actionable cards. */
let _accessibilityRoot = null;
/** @type {HTMLElement|null} */
let _accessibilityList = null;
/** @type {HTMLElement|null} */
let _accessibilityStatus = null;
/**
* The focusable mirror of painted actionable cards, as its view renders it:
* `{owner, items, status, announced}`, or null without a host. `announced`
* counts accepted focuses, so a repeated announcement is spoken again. Subscribers (the
* application shell, which publishes it to a store) receive every change;
* the module itself needs no Vue, for the portable transit entry.
* @type {?{owner: object, items: object[], status: string, announced: number}}
*/
let _actions = null;
const _actionsListeners = new Set();
let _accessibilitySignature = '';
const _accessibleActivatorByKey = new Map();
/** @type {HTMLCanvasElement|null} Host-owned detection blend-isolation surface. */
@@ -1174,11 +1175,7 @@ export function isOverlayPointVisible(
* Return true when a rectangle intersects any cached UI exclusion box.
* `count` lets pooled buffers expose a live prefix without truncating.
*/
export function overlayRectIntersectsAny(
rect,
exclusions,
count = exclusions.length,
) {
function overlayRectIntersectsAny(rect, exclusions, count = exclusions.length) {
for (let i = 0; i < count; i++) {
const other = exclusions[i];
if (
@@ -1196,7 +1193,7 @@ export function overlayRectIntersectsAny(
* Like `overlayRectIntersectsAny`, but only against exclusions that composite
* BELOW the host — the ones a placement may never overlap at any cost.
*/
export function overlayRectIntersectsAnyHard(
function overlayRectIntersectsAnyHard(
rect,
exclusions,
count = exclusions.length,
@@ -1284,30 +1281,10 @@ function ensureOverlayDom() {
_root.setAttribute('aria-hidden', 'true');
_canvas.setAttribute('aria-hidden', 'true');
_detectionSurface.setAttribute('aria-hidden', 'true');
_accessibilityRoot = document.getElementById(ACCESSIBILITY_ROOT_ID);
if (!_accessibilityRoot) {
_accessibilityRoot = document.createElement('div');
_accessibilityRoot.id = ACCESSIBILITY_ROOT_ID;
_accessibilityRoot.className = 'world-overlay-accessibility';
_accessibilityRoot.setAttribute('role', 'region');
_accessibilityRoot.setAttribute('aria-label', 'Visible map targets');
document.body.appendChild(_accessibilityRoot);
}
_accessibilityList = document.getElementById(ACCESSIBILITY_LIST_ID);
if (!_accessibilityList) {
_accessibilityList = document.createElement('div');
_accessibilityList.id = ACCESSIBILITY_LIST_ID;
_accessibilityRoot.appendChild(_accessibilityList);
}
_accessibilityStatus = document.getElementById(ACCESSIBILITY_STATUS_ID);
if (!_accessibilityStatus) {
_accessibilityStatus = document.createElement('div');
_accessibilityStatus.id = ACCESSIBILITY_STATUS_ID;
_accessibilityStatus.setAttribute('role', 'status');
_accessibilityStatus.setAttribute('aria-live', 'polite');
_accessibilityStatus.setAttribute('aria-atomic', 'true');
_accessibilityRoot.appendChild(_accessibilityStatus);
}
// Each host owns its action list; a click from an earlier host's list is
// ignored.
if (!_actions)
presentActions({ owner: {}, items: [], status: '', announced: 0 });
_ctx = _canvas.getContext('2d', { alpha: true, desynchronized: true });
_detectionCtx = _detectionSurface.getContext('2d', {
alpha: true,
@@ -2378,9 +2355,46 @@ function publishPaintRect(item) {
if (record.entry.interactive) _hitRects[_hitRectCount++] = rect;
}
/** Publish the action list to every subscriber. */
function presentActions(next) {
_actions = next && Object.freeze(next);
for (const listener of _actionsListeners) listener(_actions);
}
/**
* Receive the visible map target list now and after every change.
* @param {(view: ?object) => void} listener
* @returns {() => void} Unsubscribe.
*/
export function subscribeWorldOverlayActions(listener) {
_actionsListeners.add(listener);
listener(_actions);
return () => _actionsListeners.delete(listener);
}
/**
* Focus a listed target, as its button does, announcing an accepted focus.
* @param {object} owner The `owner` of the list the button belongs to.
* @param {string} key The item's key.
*/
export function activateWorldOverlayAction(owner, key) {
if (!_actions || owner !== _actions.owner) return;
const item = _actions.items.find((candidate) => candidate.key === key);
const activate = _accessibleActivatorByKey.get(key);
if (!item || !activate) return;
const accepted = activate();
if (accepted !== false && _actions?.owner === owner) {
presentActions({
..._actions,
status: t('Focusing {label}', { label: item.label }),
announced: _actions.announced + 1,
});
}
}
/** Keep a stable, bounded accessible mirror of currently painted actions. */
function syncAccessibleActions() {
if (!_accessibilityList) return;
if (!_actions) return;
_accessibleActivatorByKey.clear();
const items = [];
for (let i = _hitRectCount - 1; i >= 0; i--) {
@@ -2404,29 +2418,7 @@ function syncAccessibleActions() {
.join('\u0001');
if (signature === _accessibilitySignature) return;
_accessibilitySignature = signature;
if (typeof _accessibilityList.replaceChildren === 'function') {
_accessibilityList.replaceChildren();
} else {
while (_accessibilityList.firstChild)
_accessibilityList.removeChild(_accessibilityList.firstChild);
}
for (const item of items) {
const button = document.createElement('button');
button.type = 'button';
button.textContent = item.label;
button.setAttribute('aria-label', item.label);
button.setAttribute('aria-pressed', String(item.selected));
button.dataset.overlayActionKey = item.key;
button.addEventListener?.('click', () => {
const activate = _accessibleActivatorByKey.get(item.key);
if (!activate) return;
const accepted = activate();
if (accepted !== false && _accessibilityStatus) {
_accessibilityStatus.textContent = `Focusing ${item.label}`;
}
});
_accessibilityList.appendChild(button);
}
presentActions({ ..._actions, items });
}
let _detectionSurfacePrepared = false;
@@ -2742,7 +2734,6 @@ export function destroyWorldOverlay() {
if (_occluderRefreshTimer != null) clearTimeout(_occluderRefreshTimer);
_occluderRefreshTimer = null;
_root?.remove?.();
_accessibilityRoot?.remove?.();
// The detection surface is not a child of `_root` (it lives in the Cesium
// container so its `screen` blend reaches the scene), so it has to be torn
// down explicitly rather than by the root's removal.
@@ -2790,9 +2781,7 @@ export function destroyWorldOverlay() {
_root = null;
_canvas = null;
_ctx = null;
_accessibilityRoot = null;
_accessibilityList = null;
_accessibilityStatus = null;
if (_actions) presentActions(null);
_detectionSurface = null;
_detectionCtx = null;
_occluder = null;
+32 -14
View File
@@ -1,5 +1,5 @@
import { createNamedMarkers } from '../layers/installations/render/cesium/namedMarkers.js';
import { expandApplicationHtml } from '../../build/application-html.js';
import { renderApplicationHtml } from '../testSupport/applicationHtml.mjs';
import { readStylesheet } from '../testSupport/readStylesheet.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
@@ -22,7 +22,9 @@ import {
getOverlayPaintRect,
getWorldOverlayDiagnostics,
hitTestWorldOverlay,
activateWorldOverlayAction,
initWorldOverlay,
subscribeWorldOverlayActions,
isOverlayPointVisible,
normalizeOverlayEntry,
paintLaneForOverlayEntry,
@@ -452,7 +454,7 @@ test('destroying before the first init leaves pre-init buffering intact', () =>
env.cleanup();
});
test('lifecycle is idempotent and teardown removes listeners, observers, and DOM', () => {
test('lifecycle is idempotent and teardown removes listeners, observers, and DOM', async () => {
const env = installMockEnvironment();
assert.equal(env.document.getElementById('world-overlay-detection-surface'), null);
initWorldOverlay(env.engine);
@@ -470,7 +472,7 @@ test('lifecycle is idempotent and teardown removes listeners, observers, and DOM
assert.deepEqual(root.children, [canvas],
'the overlay root carries only the shared card canvas');
assert.doesNotMatch(
expandApplicationHtml(readFileSync(new URL('../../index.html', import.meta.url), 'utf8')),
await renderApplicationHtml(readFileSync(new URL('../../index.html', import.meta.url), 'utf8')),
/world-overlay-detection-surface/,
'the surface is runtime host-owned, not static markup',
);
@@ -1024,7 +1026,14 @@ test('accessible actions announce only accepted focus and expose selected state'
const env = installMockEnvironment();
let acceptedActivations = 0;
let staleActivations = 0;
let actions = null;
const unsubscribe = subscribeWorldOverlayActions((view) => {
actions = view;
});
initWorldOverlay(env.engine);
assert.deepEqual(actions.items, []);
assert.equal(actions.status, '');
assert.equal(actions.announced, 0);
setOverlayEntries('accessible-actions', [selectedEntry('vessel:123', {
interactive: true,
accessibilityLabel: 'Focus vessel TEST, MMSI 123',
@@ -1035,15 +1044,20 @@ test('accessible actions announce only accepted focus and expose selected state'
})]);
env.postRender.raise();
const list = env.document.getElementById('world-overlay-action-list');
const status = env.document.getElementById('world-overlay-status');
assert.equal(list.children.length, 1);
assert.equal(list.children[0]['aria-pressed'], 'true');
list.children[0].click();
assert.equal(actions.items.length, 1);
const [item] = actions.items;
assert.equal(item.label, 'Focus vessel TEST, MMSI 123');
assert.equal(item.selected, true);
const owner = actions.owner;
activateWorldOverlayAction({}, item.key);
assert.equal(acceptedActivations, 0, 'a list from another host cannot activate');
activateWorldOverlayAction(owner, item.key);
assert.equal(acceptedActivations, 1);
assert.equal(status.textContent, 'Focusing Focus vessel TEST, MMSI 123');
assert.equal(actions.status, 'Focusing Focus vessel TEST, MMSI 123');
assert.equal(actions.announced, 1);
activateWorldOverlayAction(owner, item.key);
assert.equal(actions.announced, 2, 'a repeated focus is a new announcement');
status.textContent = 'Focus unchanged';
setOverlayEntries('accessible-actions', [selectedEntry('vessel:123', {
selected: false,
interactive: true,
@@ -1054,12 +1068,16 @@ test('accessible actions announce only accepted focus and expose selected state'
},
})]);
env.postRender.raise();
assert.equal(list.children.length, 1);
assert.equal(list.children[0]['aria-pressed'], 'false');
list.children[0].click();
assert.equal(actions.items.length, 1);
assert.equal(actions.items[0].selected, false);
assert.equal(actions.status, 'Focusing Focus vessel TEST, MMSI 123', 'the list keeps its last announcement');
activateWorldOverlayAction(owner, actions.items[0].key);
assert.equal(staleActivations, 1);
assert.equal(status.textContent, 'Focus unchanged');
assert.equal(actions.status, 'Focusing Focus vessel TEST, MMSI 123', 'a refused focus announces nothing');
assert.equal(actions.announced, 2);
env.cleanup();
assert.equal(actions, null, 'teardown withdraws the list');
unsubscribe();
});
test('viewport and horizon culling obey explicit policy inputs', () => {
@@ -0,0 +1,122 @@
// src/overlays/worldOverlayActionsView.test.mjs — the scene chrome's visible
// map target list renders what the world overlay presents and activates the
// target of the list each button belongs to.
import '../testSupport/registerDom.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
import { createApp, nextTick } from 'vue';
import { createPinia } from 'pinia';
import { useWorldOverlayActionsStore } from '../ui/stores/worldOverlayActions.js';
import SceneChromeView from '../ui/views/SceneChromeView.vue';
function mount(t) {
document.body.replaceChildren();
const pinia = createPinia();
const store = useWorldOverlayActionsStore(pinia);
const app = createApp(SceneChromeView).use(pinia);
app.mount(document.body.appendChild(document.createElement('div')));
t.after(() => app.unmount());
const $ = (selector) => document.querySelector(selector);
return { store, $ };
}
test('the target list renders each painted action and the last announcement', async (t) => {
const { store, $ } = mount(t);
const region = $('#world-overlay-actions');
assert.equal(region.getAttribute('role'), 'region');
assert.equal(region.className, 'world-overlay-accessibility');
assert.equal($('#world-overlay-action-list').children.length, 0);
assert.equal($('#world-overlay-status').textContent, '');
const owner = {};
store.publish({
owner,
items: [
{ key: 'vessel\u0000123', label: 'Focus vessel TEST', selected: true },
{ key: 'fire\u000042', label: 'Focus fire 42', selected: false },
],
status: 'Focusing Focus vessel TEST',
announced: 1,
});
await nextTick();
const buttons = [...$('#world-overlay-action-list').children];
assert.deepEqual(
buttons.map((button) => [
button.type,
button.textContent,
button.getAttribute('aria-label'),
button.getAttribute('aria-pressed'),
button.dataset.overlayActionKey,
]),
[
[
'button',
'Focus vessel TEST',
'Focus vessel TEST',
'true',
'vessel\u0000123',
],
['button', 'Focus fire 42', 'Focus fire 42', 'false', 'fire\u000042'],
],
);
assert.equal(
$('#world-overlay-status').textContent,
'Focusing Focus vessel TEST',
);
});
test('a button activates its own list’s target', async (t) => {
const { store, $ } = mount(t);
const calls = [];
store.connect({ activate: (owner, key) => calls.push([owner, key]) });
const owner = {};
store.publish({
owner,
items: [{ key: 'a', label: 'Focus A', selected: false }],
status: '',
});
await nextTick();
$('#world-overlay-action-list button').click();
assert.equal(calls.length, 1);
assert.ok(calls[0][0] === owner);
assert.equal(calls[0][1], 'a');
store.publish(null);
await nextTick();
assert.equal($('#world-overlay-action-list').children.length, 0);
assert.ok($('#world-overlay-actions'), 'the region itself stays');
});
test('a repeated focus rewrites the status so it is announced again', async (t) => {
const { store, $ } = mount(t);
const owner = {};
const list = (announced) => ({
owner,
items: [{ key: 'a', label: 'Focus A', selected: false }],
status: 'Focusing Focus A',
announced,
});
store.publish(list(1));
await nextTick();
const status = $('#world-overlay-status');
assert.equal(status.textContent, 'Focusing Focus A');
let writes = 0;
new MutationObserver((records) => (writes += records.length)).observe(
status,
{
childList: true,
characterData: true,
subtree: true,
},
);
store.publish({
...list(1),
items: [{ key: 'a', label: 'Focus A', selected: true }],
});
await nextTick();
await new Promise((resolve) => setTimeout(resolve));
assert.equal(writes, 0, 'a list change alone announces nothing');
store.publish(list(2));
await nextTick();
await new Promise((resolve) => setTimeout(resolve));
assert.ok(writes > 0, 'the second focus of the same target is written again');
assert.equal(status.textContent, 'Focusing Focus A');
});
+20 -1
View File
@@ -2,7 +2,7 @@ import test from 'node:test';
import assert from 'node:assert/strict';
import { spawnSync } from 'node:child_process';
import { fileURLToPath } from 'node:url';
import { LOCAL_OVERLAY_COHORT_LIMIT } from '../data/localGeojson.js';
import { LOCAL_OVERLAY_COHORT_LIMIT } from '../data/localGeojsonCore.js';
import { FIRMS_AMBIENT_COHORT_LIMIT } from '../data/firmsLabels.js';
import { vesselOverlayCohortLimit } from '../data/vesselLabels.js';
import { CCTV_AMBIENT_CARD_MAX } from '../data/cctvLod.js';
@@ -11,6 +11,7 @@ import { EARTHQUAKE_OVERLAY_COHORT_LIMIT } from '../data/earthquakes.js';
import { ROCKET_MISSION_AMBIENT_OVERLAY_COHORT_LIMIT } from '../data/rocketLaunches.js';
import { RADIO_OVERLAY_COHORT_LIMIT } from '../data/radio.js';
import { CABLE_REFERENCE_LABEL_WINNER_CAP } from '../data/telegeographySubmarineCables.js';
import { AIR_QUALITY_OVERLAY_COHORT_LIMIT } from '../layers/airQuality/model.js';
import { isCalibratedAllocationRuntime } from '../../scripts/run-unit-tests.mjs';
/**
@@ -34,6 +35,7 @@ import { isCalibratedAllocationRuntime } from '../../scripts/run-unit-tests.mjs'
* ---------------------+---------+------------+---------+----------------+-------------+-------------
* generic below cap | 60 | 60 | 60 | 3182 | 53.0 | 4,100
* generic above cap | 250 | 250 | 96 | 10022 | 40.1 | 13,000
* air quality | 48 | 48 | 32 | 3900 | 81.3 | 5,200
* local infrastructure | 320 | 320 | 192 | 39478 | 123.4 | 49,000
* Phase 3 + FIRMS | 338 | 338 | 210 | 41220 | 122.0 | 53,600
* Phase 3 + vessels | 451 | 451 | 311 | 67252 | 149.1 | 87,500
@@ -271,6 +273,23 @@ const WORKLOADS = [
maxBytesPerFrame: 19_000,
saturated: true,
},
{
// The air-quality station cohort on its own. Measured standalone rather
// than stacked on the Phase-5 host (the submarine-cable precedent): these
// stations are sparse and, with the single registered provider,
// continental, so what matters is its own cohort cost.
//
// Re-measured against the current worker: median 3,900 B/frame, max 4,114,
// and 85.7 B/candidate at the ceiling — inside the shared 154 B/candidate
// bound, so no per-source exception is taken. The 5,200 frame budget
// carries 26.4% headroom over the measured maximum.
name: 'with the air-quality station cohort live',
profile: 'air-quality',
entries: AIR_QUALITY_OVERLAY_COHORT_LIMIT,
candidates: AIR_QUALITY_OVERLAY_COHORT_LIMIT,
maxBytesPerFrame: 5_200,
saturated: true,
},
{
name: 'with the Dense detection lane active over 5,000 observations',
profile: 'phase6-detection',
+81 -1
View File
@@ -33,6 +33,12 @@ import {
TRACKED_OVERLAY_SOURCE_OPTIONS,
} from '../data/trackedReadout.js';
import { CCTV_AMBIENT_CARD_MAX } from '../data/cctvLod.js';
import {
AIR_QUALITY_OVERLAY_COHORT_LIMIT,
AIR_QUALITY_OVERLAY_COLLISION_CAPACITY,
AIR_QUALITY_OVERLAY_SOURCE_ID,
createAirQualityOverlayEntry,
} from '../layers/airQuality/model.js';
import {
CCTV_OVERLAY_SOURCE_ID,
createCctvThumbnailOverlayEntry,
@@ -360,6 +366,7 @@ function buildWorkload(count) {
id: `mover-${index}`,
position: () => position,
variant: 'label',
// i18n-ignore: benchmark fixture
title: `TRK ${1000 + index}`,
details: [`ALT ${10_000 + index * 25}`],
priority: index % 7,
@@ -470,6 +477,7 @@ function buildPhase3FirmsWorkload(count) {
position,
gapPx: 10,
accent: '224, 82, 82',
// i18n-ignore: benchmark fixture
title: `▲ ${50 + fireIndex} MW`,
details: ['high · 2h · N20'],
selected: false,
@@ -560,6 +568,7 @@ function buildPhase3VesselsWorkload(count) {
position,
gapPx: 10,
accent: '224, 82, 82',
// i18n-ignore: benchmark fixture
title: `▲ ${50 + fireIndex} MW`,
details: ['high · 2h · N20'],
selected: false,
@@ -579,6 +588,7 @@ function buildPhase3VesselsWorkload(count) {
position,
gapPx: selected ? 12 : 10,
accent: '57, 213, 255',
// i18n-ignore: benchmark fixture
title: selected ? 'SELECTED VESSEL' : `VESSEL ${vesselIndex}`,
details: selected
? ['CARGO · 14.5KT · 231°', 'MMSI 353136000 · POS: LIVE']
@@ -653,6 +663,7 @@ function buildPhase3TrackedWorkload(count) {
gevTrackedId: 'flights:allocation-probe',
gevDisplayPosition: selected.position,
gevLabelModel: {
// i18n-ignore: benchmark fixture
title: 'ALLOC01',
details: ['FL350 · 451 kts', 'TEST AIR · A320'],
accent: '#39d0ff',
@@ -703,6 +714,7 @@ function buildPhase4CctvWorkload(count) {
const entry = createCctvThumbnailOverlayEntry({
id: active ? 'cctv:active' : `cctv:${index}`,
position,
// i18n-ignore: benchmark fixture
title: active ? 'ACTIVE CAMERA' : `CAMERA ${index}`,
frameSlot: slot,
rank: index,
@@ -876,6 +888,7 @@ function buildPhase5CivilWorkload(count) {
const entry = registration?.entries[0];
if (!entry)
throw new Error('phase5-civil requires the protected tracked entry');
// i18n-ignore: benchmark fixture
entry.title = 'ALLOC01 · FL350 · 451 kts';
entry.details = ['TEST AIR · A320', 'AUS → LAX'];
return workload;
@@ -890,6 +903,7 @@ function buildPhase5MilitaryWorkload(count) {
if (!entry)
throw new Error('phase5-military requires the protected tracked entry');
entry.id = 'military:allocation-probe';
// i18n-ignore: benchmark fixture
entry.title = 'RCH451';
entry.details = ['C17 · 05-8152', 'USAF · 28000 ft · 400 kt'];
entry.accent = '#ffd166';
@@ -1076,6 +1090,7 @@ function appendSubmarineCableWorkload(workload, count) {
id: `${kind}-reference-${index}-alloc`,
kind,
label:
// i18n-ignore: benchmark fixture
kind === 'cable' ? `Cable System ${index}` : `Landing Point ${index}`,
tip: position,
distanceM: 200_000 + index * 40_000,
@@ -1110,6 +1125,69 @@ function buildSubmarineCablesWorkload(count) {
);
}
/**
* The air-quality station cohort at full size.
*
* Measured standalone (the submarine-cable precedent) rather than stacked on
* the Phase-5 host: air-quality stations are sparse and, with the single
* currently-registered provider, continental — so the question a budget has to
* answer is what its own cohort costs, not what it adds to a worldwide worst
* case it never shares a viewport with. The entry shape is the same static
* `ambient-label` the earthquake layer publishes, so the per-candidate ceiling
* is the meaningful gate.
*/
function buildAirQualityWorkload(count) {
if (count !== AIR_QUALITY_OVERLAY_COHORT_LIMIT) {
throw new Error(
`air-quality requires ${AIR_QUALITY_OVERLAY_COHORT_LIMIT} entries`,
);
}
const workload = {
entries: [],
positions: [],
drifts: [],
registrations: [],
};
const columns = Math.max(1, Math.ceil(Math.sqrt((count * 16) / 9)));
const rows = Math.max(1, Math.ceil(count / columns));
const spanX = columns > 1 ? 1.68 / (columns - 1) : 0;
const spanY = rows > 1 ? 1.56 / (rows - 1) : 0;
const stations = [];
for (let index = 0; index < count; index++) {
const column = index % columns;
const row = Math.floor(index / columns);
const baseX = -0.84 + column * spanX;
const baseY = -0.78 + row * spanY;
const position = new Cesium.Cartesian3(baseX, baseY, 0);
workload.positions.push(position);
workload.drifts.push({
baseX,
baseY,
phase: index * 0.27,
rate: 0.32 + (index % 6) * 0.04,
});
const entry = createAirQualityOverlayEntry({
id: `air-${index}`,
position,
// i18n-ignore: benchmark fixture
title: `Station ${index} ${1 + (index % 10)}`,
accent: '#4cc9f0',
value: 1 + (index % 10),
});
entry.horizonCull = false;
stations.push(entry);
}
workload.registrations.push({
sourceId: AIR_QUALITY_OVERLAY_SOURCE_ID,
entries: stations,
options: {
cohortLimit: AIR_QUALITY_OVERLAY_COHORT_LIMIT,
collisionCapacity: AIR_QUALITY_OVERLAY_COLLISION_CAPACITY,
},
});
return workload;
}
function buildPhase6DetectionWorkload(count) {
const random = makeRandom(0xd37ec710);
const positions = [];
@@ -1281,7 +1359,9 @@ function main() {
? buildNavaraProjectorWorkload(
ENTRY_COUNT,
)
: buildWorkload(ENTRY_COUNT);
: PROFILE === 'air-quality'
? buildAirQualityWorkload(ENTRY_COUNT)
: buildWorkload(ENTRY_COUNT);
const { entries, positions, drifts } = workload;
const solveIntervalMs = Number(process.env.GEV_ALLOC_SOLVE_MS) || 125;
const detectionActive = !!workload.detectionLayer;
+10 -7
View File
@@ -7,6 +7,9 @@
*/
/** Shared visual tokens used by every world-overlay source. */
// Map-card fonts: JetBrains Mono has no Arabic glyphs and the generic
// monospace fallback is a fixed-pitch Arabic face that stretches every word;
// Arabic text falls through to Noto Sans Arabic (loaded with the page fonts).
export const WORLD_OVERLAY_STYLE = Object.freeze({
background: 'rgba(4, 12, 16, 0.82)',
selectedBackground: 'rgba(5, 18, 24, 0.94)',
@@ -16,13 +19,13 @@ export const WORLD_OVERLAY_STYLE = Object.freeze({
detail: 'rgba(147, 161, 173, 0.92)',
leader: 'rgba(147, 213, 228, 0.58)',
accent: '#6be8ff',
fontLabel: '500 10px "JetBrains Mono", monospace',
fontTrack: '600 10px "JetBrains Mono", monospace',
fontTitle: '600 12px "JetBrains Mono", monospace',
fontDetail: '500 10.5px "JetBrains Mono", monospace',
fontSelected: '600 13px "JetBrains Mono", monospace',
fontTrackedTitle: '600 13px "JetBrains Mono", monospace',
fontTrackedDetail: '500 11px "JetBrains Mono", monospace',
fontLabel: '500 10px "JetBrains Mono", "Noto Sans Arabic", monospace',
fontTrack: '600 10px "JetBrains Mono", "Noto Sans Arabic", monospace',
fontTitle: '600 12px "JetBrains Mono", "Noto Sans Arabic", monospace',
fontDetail: '500 10.5px "JetBrains Mono", "Noto Sans Arabic", monospace',
fontSelected: '600 13px "JetBrains Mono", "Noto Sans Arabic", monospace',
fontTrackedTitle: '600 13px "JetBrains Mono", "Noto Sans Arabic", monospace',
fontTrackedDetail: '500 11px "JetBrains Mono", "Noto Sans Arabic", monospace',
radius: 4,
anchorDotRadius: 3.2,
anchorDotStrokeWidth: 1,