doxa-maps/library/utils
Doxa Maps c7c2c12cd0 Maps register under their own tags: <dxm-simple-map> and <dxm-research-map>
A host page can define a tag name before our bundle loads, and customElements.define is first come, first
served. DX Life's own scripts define <doxa-map>, <doxa-simple-map> and <doxa-research-map>, and our bundles
defined the same names behind a silent guard, so on those pages our define was skipped and the page drew the
host's element under our name (Prayer Progress on the Adopt page, and the Research page).
- The doxa-simple-map bundle defines <dxm-simple-map>; doxa-research-map defines <dxm-research-map>. Each is
  its bundle's first define, so the manifest, the leaf pages and the gallery mount them with no other change.
- The older names are defined only when the host asks: data-legacy-tags on the bundle's <script>, or
  window.DXM_LEGACY_TAGS = true before it loads. Off by default.
- library/elements/ownTags.js: a class is branded with its bundle; a re-load is silent; a tag held by a
  foreign class is reported (console.error), never adopted. whenTagDefined refuses a dxm- tag held by a
  foreign class rather than mounting it.
- research-map-plus-grid mounts <dxm-research-map>; the gallery and studio count the new tags as heavy
  (WebGL) elements; the studio's and the composite's composes lists name them.
- check:element-namespace (gates:pre; self-test in gates:post): no host name by default, each bundle's own
  tag first, the manifest mounts them, one bundle per tag (people-groups-grid is the one known exception),
  ownTags and whenTagDefined run against a stub registry.
2026-10-02 03:19:53 +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 P assembly: the widened census, stated neutrally 2026-10-01 05:42:24 +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 Shipped comments describe the behaviour instead of quoting a person 2026-09-28 17:40:35 +00:00
embedScript.js Maps register under their own tags: <dxm-simple-map> and <dxm-research-map> 2026-10-02 03:19:53 +00:00
formatCount.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
geoUtils.js Research tabs read at 15px; the status red is a step brighter 2026-09-17 02:38:38 -05:00
hostElement.js Move four identical bodies into the library 2026-09-29 09:19:04 +00: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
languageLabel.js The packet's generated description, and the language name it prints was index-ordered 2026-09-28 13:56:06 +00:00
languageRequest.js Shell header: a phone bar and a rail-bottom language slot for header-off shells, and a shared language menu that asks the host first 2026-09-30 23:28:52 +00:00
loadPinnedUmd.js Source comments state design history and measurements as facts, without quoting or naming anyone 2026-10-01 00:37:17 +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
peopleGroupName.js People-group names: the threshold pinned, no trust without Latin evidence, raw indexing flagged 2026-10-01 06:04:41 +00:00
peopleGroupPoints.js A country map you can drop on one page, without the dashboard around it 2026-09-29 01:38: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
scrollport.js Move four identical bodies into the library 2026-09-29 09:19:04 +00: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/.