1.5 KiB
1.5 KiB
library/api/ — where map data comes from
One of the three customization seams (colors/, api/, i18n/). This one decides where
people-group data comes from and how its raw fields map onto the field names the map reads.
The components are source-agnostic — only the connection knows the source's shape.
sources.json DataSourceManager.js the map
┌──────────────────┐ ┌───────────────────┐ ┌──────────────┐
│ your connection │──►│ fetch → normalize │──────►│ map · legend │
│ (type, endpoint, │ │ → cache │ │ · detail card │
│ fieldMappings) │ └───────────────────┘ └──────────────┘
└──────────────────┘ maps raw rows → system field names
sources.jsonis your surface — add a connection (csv,api, orrest-api) and setactiveSource. No code.DataSourceManager.jsis shared machinery — you never edit it.- Import through
_registry.js(SOURCES,getSourceConfig(),listSources(), …).
Adding or overriding a connection? The full contract (required fields, checklist, integration) is in ../../documentation/architecture/data-sources.md.