doxa-maps/library/utils
Doxa Maps ed87323592 Big Picture speaks Arabic where it was still speaking English: chrome and data labels
rega's ?lang=ar pass (KA3, 3d64bcad) found English on a localized map in four places, and the census
behind it explains why no gate saw them. Catalogue coverage is COMPLETE: of the 760 keys my bundles
name across the 21 areas they reach, ZERO are missing from any of the ten non-English locales, and the
per-locale English-identical values are numerals, acronyms and cognates rather than debt. Everything
rega actually read was a string no catalogue ever held.

  · THE PROJECTION PILL said "🌐 Globe" / "▭ Flat" in all eleven locales. The icon is now the label.
    Neither word has a catalogue entry and authoring ten new strings for a two-state toggle to say what
    a glyph already says is the wrong trade — but mapui.enableGlobe / mapui.disableGlobe DO ship in all
    eleven, as the ACTION, which is what a button should announce. They become the accessible name and
    the tooltip. min-width joins min-height on the pill: the 24px used to come free from the text.

  · THE TABLE FOOTER said "Σ 2,107 groups". dashboard.groups has shipped in eleven locales all along
    (ar "مجموعة") and this one call site never read it. Written with the same singular/plural test as
    the header count so the two cannot disagree at one row.

  · THE REGION CHART labelled its bars with the prayer API's English region names. Seven regions is a
    closed set, so they are now CATALOGUED — five generated from vendored CLDR by
    internal/generate-wagf-region-names.mjs, which is the same data countryName.js already trusts.
    Generating is what keeps seventy translations out of my hands. middle_east and
    north_america_&_non-spanish_caribbean stay English: M49 145 is "Western Asia" and 021 is "Northern
    America", and neither means the region we draw. An English label a reader can match to the map beats
    a localized one that names the wrong territory. --check verifies the catalogue against CLDR.

  · TOP COUNTRIES labelled its bars with the API's English country names. By aggregation time the
    alpha-3 is gone, so countryName.js gains iso3ForEnglishName() — reversing its OWN table, exact where
    it matches and silent where it does not — which is precisely the ✓ case its header describes.

One thing found while wiring those: the BAR label was the only chart surface still printing the raw
facet key. The donut, its legend and both tooltips already went through legendLabel(); the bar list did
not, which is why these labels stayed English after the donut was fixed for rega's earlier survey. Both
new facets are projected there, so the two charts cannot disagree about a name again.

English is left EXACTLY as authored. Both projections return the key untouched at locale 'en', which
also keeps the 42 countries whose CLDR name differs from ours reading as they do today. Nothing
localizes a VALUE: data-key, isActive() and every click and filter path still carry the canonical
English, the rule the religion donut already followed.

Verified: gates:pre 12/12, check:i18n-keys-exist / parity / never-translated PASS, and the generator's
own --check PASS. Rendering on ?lang=ar goes to rega.
2026-09-28 02:01:46 +00:00
..
.gitkeep doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
apiBaseUrl.js doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
ClusterHelpers.js consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
colocation.js The prayer map's legends see the pins it draws 2026-09-27 02:17:35 +00:00
countries-meta.js Regions: one rollup, ported from theirs, instead of two copies 2026-09-24 04:01:34 +00:00
countryName.js Big Picture speaks Arabic where it was still speaking English: chrome and data labels 2026-09-28 02:01:46 +00:00
DataSourceManager.js Complete app-profiles->plugin-designs sweep across comments/docs; build green; layouts kept at root (load-bearing) 2026-09-17 18:18:19 +00:00
embedBase.js Dev server: every plugin reaches the asset pool again (no polygons, previews, fonts or tables in dev) 2026-09-25 23:17:35 +00:00
formatCount.js One place decides how a count is punctuated, and it still says en-US 2026-09-27 06:04:08 +00:00
geoUtils.js Research tabs read at 15px; the status red is a step brighter 2026-09-17 02:38:38 -05:00
html.js Map popups show data as text: a people-group name or country field can no longer run script 2026-09-26 05:50:24 +00:00
loadPinnedUmd.js One pinned-UMD loader for PPLR and the Wall: library/utils/loadPinnedUmd.js 2026-09-26 07:24:25 +00:00
MSTClusteringUtil.js "MST" clustering draws again: a true spanning tree in under a second instead of a 12-second freeze 2026-09-26 04:38:59 +00:00
NetworkClusteringUtil.js doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
README.md Host-agnostic share links, token-endpoint chain, dev playground as reusable modules, share/asset gates, validated profile-type vocabulary 2026-09-16 12:10:38 -05:00
viewportScrim.js Land the prayer facet and the scrim helper 2026-09-22 21:50:32 +00:00

library/utils/ — pure JS helpers

No Vue, no Pinia, no Mapbox. Anything reactive is a composable; anything stateful is a store.

File Purpose
apiBaseUrl.js Resolves the API base URL at runtime (window.MAP_APP_API_URL / VITE_API_BASE_URL)
embedBase.js Share/embed URL ladder — the built bundle derives its tree root from its own script url (profileConfig.shareUrl / embedBaseUrl / window.MAP_EMBED_BASE_URL override) so tree-relative <bundle>/<profile>/index.html links work on any host
geoUtils.js Centroid, bounds, validation, GeoJSON helpers
ClusterHelpers.js Shared helpers for the two clustering utilities below
MSTClusteringUtil.js Minimum-spanning-tree clustering for affinity blocks
NetworkClusteringUtil.js Network-line clustering — connect nearby pins with edges
  • No import { ref } from 'vue' and no import mapboxgl in this folder — operate on plain [lng, lat] arrays.
  • Named exports (for tree-shaking), JSDoc on every export.
  • Writing reactive logic or needing Mapbox APIs? That's a composable — move it to ../composables/.