- https://siax.io
-
Process optimisation, operational improvement and automation. Founder of SIAX Technology AB. Business workflows, data, BI and system integration.
- Joined on
2026-07-02
@siax/maps (0.5.1)
Installation
@siax:registry=https://git.siax.app/api/packages/admin/npm/npm install @siax/[email protected]"@siax/maps": "0.5.1"About this package
@siax/maps
SiaxMap renders points, clusters, heatmaps, H3 cells and choropleth regions with
MapLibre and deck.gl. Its default background makes no external map requests.
The feature table remains usable when WebGL is unavailable.
SiaxMap includes MapLibre's required stylesheet from its component module.
Import SiaxMap through @siax/maps; applications do not need to add a second
MapLibre CSS import. The stylesheet positions the map canvas and navigation
controls inside the component's container. Bundlers must preserve CSS side
effects; the package manifest marks CSS accordingly. A WebGL failure still
shows the accessible feature table.
The root @siax/maps entry can emit the MapLibre stylesheet even when a
consumer imports only a planning helper (about 86 KB before minification in
the current bundle). MapLibre and deck.gl JavaScript remain tree-shaken from
that helper-only path. The stylesheet is an explicit package cost; it does
not certify that a deployed product has loaded its geometries or drawn its
polygons.
The choropleth uses the theme's muted foreground for its low endpoint, so minimum values remain visible against the map background. Null regions use the same hue at lower opacity and remain labelled as missing data in the feature table; they are never turned into numeric zero.
Controlled choropleth selection
Pass stable, domain-specific MapRegion.id values. Polygon clicks, feature-table
buttons and Clear selection all request changes through the same callback.
The host owns the controlled selection and can restore it from its URL, history
or session state. Updating selectedRegionIds does not emit a callback.
const [regionIds, setRegionIds] = useState<readonly string[]>([]);
<SiaxMap
label="Regions"
mode="choropleth"
regions={regions}
selectedRegionIds={regionIds}
onRegionSelectionChange={setRegionIds}
/>;
Unknown and time-filtered region ids are ignored. Without selectedRegionIds,
the component keeps its own region selection and still calls
onRegionSelectionChange when supplied. Point selection is separate: the
existing onSelect(bounds, points) callback continues to report shift-drag
bounding-box hits and never converts a bounding box into a region id.
onRegionSelectionChange only reports ids. A product can map them to its own
filter or URL contract without importing that product's provider into this
shared package. The event is a request; a controlled host must pass the new
ids back through selectedRegionIds to update the highlight.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @deck.gl/aggregation-layers | 9.3.11 |
| @deck.gl/core | 9.3.11 |
| @deck.gl/layers | 9.3.11 |
| @deck.gl/mapbox | 9.3.11 |
| @siax/geo | 0.9.0 |
| @siax/geo-client | 0.3.3 |
| maplibre-gl | 6.7.0 |
Development Dependencies
| ID | Version |
|---|---|
| @eslint/js | ^10.0.1 |
| @siax/config | 0.2.1 |
| @siax/ui | 0.16.9 |
| @storybook/react-vite | ^10.5.0 |
| @testing-library/dom | ^10.4.1 |
| @testing-library/react | ^16.3.2 |
| @testing-library/user-event | ^14.6.3 |
| @types/react | ^19.2.0 |
| @types/react-dom | ^19.2.0 |
| @vitejs/plugin-react | ^4.7.0 |
| eslint | ^10.0.0 |
| eslint-plugin-react-hooks | ^7.1.0 |
| globals | ^17.0.0 |
| jsdom | ^30.0.1 |
| react | ^19.2.0 |
| react-dom | ^19.2.0 |
| storybook | ^10.5.0 |
| typescript | ^5.7.2 |
| typescript-eslint | ^8.66.0 |
| vitest | ^3.0.0 |
Peer Dependencies
| ID | Version |
|---|---|
| @siax/ui | 0.16.9 |
| react | ^19.2.0 |
| react-dom | ^19.2.0 |