mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 08:30:05 +00:00
fix(atlas): name the globe hook dependencies, cover the mesh routes
The second run of the globe Atlas was red on: - Client lint: the engine getter is a stable callback now, so the hooks that call it name it (and the refs and setters they read); an unused navigate and a seven parameter label helper are gone. - Atlas coverage: the mesh controller and the people and flights routes get unit tests, an unused region name helper is removed. - The French "Atlas" is marked as the same word, index.css is back at its length, the server people service is formatted, and the baselines drop the deleted AtlasPage and follow the lower counts.
This commit is contained in:
@@ -46,14 +46,12 @@ export function placeLabels(
|
||||
const m = engine.manifest;
|
||||
if (!m) return;
|
||||
const zoom = engine.zoom;
|
||||
const { width, height } = engine.vp;
|
||||
const { width } = engine.vp;
|
||||
const cands: Candidate[] = [];
|
||||
const minArea = minAreaFor(zoom);
|
||||
const regionA = engine.regionAlpha;
|
||||
|
||||
const regionsOn = zoom >= (width < NARROW_WIDTH ? REGION_LABEL_ZOOM_PHONE : REGION_LABEL_ZOOM_WIDE);
|
||||
const named = regionsOn ? regionCandidates(engine, cands) : new Set<string>();
|
||||
countryCandidates(engine, cands, named, minArea, regionA, labelFor, labelRegionsOf);
|
||||
countryCandidates(engine, cands, named, labelFor, labelRegionsOf);
|
||||
cands.sort((a, b) => b.rank - a.rank);
|
||||
let regionCount = 0;
|
||||
|
||||
@@ -132,14 +130,14 @@ function countryCandidates(
|
||||
engine: GlobeEngine,
|
||||
cands: Candidate[],
|
||||
named: Set<string>,
|
||||
minArea: number,
|
||||
regionA: number,
|
||||
labelFor: (a2: string) => string | null,
|
||||
labelRegionsOf?: (a2: string) => boolean
|
||||
): void {
|
||||
const m = engine.manifest;
|
||||
if (!m) return;
|
||||
const { width, height } = engine.vp;
|
||||
const minArea = minAreaFor(engine.zoom);
|
||||
const regionA = engine.regionAlpha;
|
||||
for (const c of m.countries) {
|
||||
if (!c.a2 || !c.anchor || named.has(c.a2)) continue;
|
||||
const mine = labelRegionsOf ? labelRegionsOf(c.a2) : false;
|
||||
|
||||
Reference in New Issue
Block a user