@rcpch/imd-map 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +6 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +6 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/rcpch-imd-map.min.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,24 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.4.0] — 2026-05-16
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Added `channel_islands` as a supported nation value across the public API (`initialNation`, `setNation`, and nation-aware styling).
|
|
16
|
+
- Added resolver and filter support for `channel_islands` in nation filtering and era resolution.
|
|
17
|
+
- Added automated smoke tests for standalone example pages to verify they are served and include expected map initialization and patient plotting hooks.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Updated Channel Islands era behavior to honour the requested era (`2011` or `2021`) while rendering 2024 boundaries in both table families.
|
|
22
|
+
- Included Channel Islands in all-UK nation color matching so all-UK choropleth rendering handles `nation: channel_islands` explicitly.
|
|
23
|
+
- Added default neutral base color wiring for Channel Islands to support no-IMD-data rendering.
|
|
24
|
+
|
|
25
|
+
### Documentation
|
|
26
|
+
|
|
27
|
+
- Updated README and AGENTS guidance for Channel Islands nation support and era semantics.
|
|
28
|
+
|
|
11
29
|
## [0.3.1] — 2026-04-28
|
|
12
30
|
|
|
13
31
|
### Added
|
package/README.md
CHANGED
|
@@ -236,22 +236,23 @@ Bring your own overlay configuration (custom overlay table/layer names via libra
|
|
|
236
236
|
|
|
237
237
|
The `era` option refers to the boundary year used for the LSOA geography, not the IMD publication year.
|
|
238
238
|
|
|
239
|
-
For England, the supported pairings are:
|
|
239
|
+
For England and Channel Islands, the supported pairings are:
|
|
240
240
|
|
|
241
|
-
- `2011` era = 2011 LSOA boundaries + 2019 IMD data
|
|
242
|
-
- `2021` era = 2021 LSOA boundaries + 2025 IMD data
|
|
241
|
+
- `2011` era = 2011 LSOA boundaries + 2019 IMD data (England only)
|
|
242
|
+
- `2021` era = 2021 LSOA boundaries + 2025 IMD data (England only); Channel Islands on 2024 boundaries
|
|
243
243
|
|
|
244
244
|
| Nation | Requested era | Effective era |
|
|
245
245
|
|---|---|---|
|
|
246
246
|
| `all` | `2011` or `2021` | as requested |
|
|
247
247
|
| `england` | `2011` or `2021` | as requested |
|
|
248
|
+
| `channel_islands` | `2011` or `2021` | as requested (2024 boundaries in both) |
|
|
248
249
|
| `wales` | any | always `2011` |
|
|
249
250
|
| `scotland` | any | always `2011` |
|
|
250
251
|
| `northern_ireland` | any | always `2011` |
|
|
251
252
|
|
|
252
253
|
When the effective era differs from the requested era, `onWarning` is called with code `ERA_OVERRIDE`.
|
|
253
254
|
|
|
254
|
-
For all-UK maps, `initialEra: '2021'` now uses the mixed-vintage `uk_master_2021_*` tables: England renders with 2021 LSOA boundaries and 2025 IMD data, while Wales, Scotland, and Northern Ireland continue to render from their existing older datasets within the same UK tile family. Use `initialEra: '2011'` when you want the older England 2011 LSOA + 2019 IMD view alongside the existing Welsh and other nation data.
|
|
255
|
+
For all-UK maps, `initialEra: '2021'` now uses the mixed-vintage `uk_master_2021_*` tables: England renders with 2021 LSOA boundaries and 2025 IMD data, Channel Islands renders with 2024 boundaries, while Wales, Scotland, and Northern Ireland continue to render from their existing older datasets within the same UK tile family. Use `initialEra: '2011'` when you want the older England 2011 LSOA + 2019 IMD view alongside the existing Welsh and other nation data.
|
|
255
256
|
|
|
256
257
|
This means you can instantiate two separate UK maps in the same application, choosing the England boundary/IMD pairing by era:
|
|
257
258
|
|
|
@@ -294,6 +295,7 @@ createImdMap({
|
|
|
294
295
|
wales: '#1a9641',
|
|
295
296
|
scotland: '#2b83ba',
|
|
296
297
|
northern_ireland: '#7f7f7f',
|
|
298
|
+
channel_islands: '#d1d5db',
|
|
297
299
|
},
|
|
298
300
|
// 10 hex colors, index 0 = decile 1 (most deprived)
|
|
299
301
|
fallbackDecileColors: ['#7a0036', ...],
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FeatureCollection, Point, Feature } from 'geojson';
|
|
2
2
|
|
|
3
|
-
type Nation = 'all' | 'england' | 'wales' | 'scotland' | 'northern_ireland';
|
|
3
|
+
type Nation = 'all' | 'england' | 'wales' | 'scotland' | 'northern_ireland' | 'channel_islands';
|
|
4
4
|
type Era = '2011' | '2021';
|
|
5
5
|
interface ChoroplethStyleOptions {
|
|
6
6
|
/** Per-nation arrays of 10 hex colors, index 0 = decile 1 (most deprived). */
|
package/dist/index.esm.js
CHANGED
|
@@ -9,6 +9,8 @@ function resolveEffectiveEra(nation, requestedEra) {
|
|
|
9
9
|
return requestedEra;
|
|
10
10
|
case "england":
|
|
11
11
|
return requestedEra;
|
|
12
|
+
case "channel_islands":
|
|
13
|
+
return requestedEra;
|
|
12
14
|
case "wales":
|
|
13
15
|
case "scotland":
|
|
14
16
|
case "northern_ireland":
|
|
@@ -117,6 +119,7 @@ var DEFAULT_BASE_COLORS_BY_NATION = {
|
|
|
117
119
|
wales: "#1a9641",
|
|
118
120
|
scotland: "#2b83ba",
|
|
119
121
|
northern_ireland: "#7f7f7f",
|
|
122
|
+
channel_islands: "#d1d5db",
|
|
120
123
|
all: "#d7191c"
|
|
121
124
|
};
|
|
122
125
|
function clamp(value, min, max) {
|
|
@@ -234,7 +237,8 @@ var DEFAULT_STYLE = {
|
|
|
234
237
|
england: DEFAULT_BASE_COLORS_BY_NATION.england,
|
|
235
238
|
wales: DEFAULT_BASE_COLORS_BY_NATION.wales,
|
|
236
239
|
scotland: DEFAULT_BASE_COLORS_BY_NATION.scotland,
|
|
237
|
-
northern_ireland: DEFAULT_BASE_COLORS_BY_NATION.northern_ireland
|
|
240
|
+
northern_ireland: DEFAULT_BASE_COLORS_BY_NATION.northern_ireland,
|
|
241
|
+
channel_islands: DEFAULT_BASE_COLORS_BY_NATION.channel_islands
|
|
238
242
|
},
|
|
239
243
|
fallbackDecileColors: generateDecileRampFromBaseColor(DEFAULT_BASE_COLORS_BY_NATION.england),
|
|
240
244
|
fillOpacity: 0.7,
|
|
@@ -359,7 +363,7 @@ function buildColorExpression(nation, style) {
|
|
|
359
363
|
if (nation !== "all") {
|
|
360
364
|
return buildDecileColorExpression(getDecileColors(nation, style));
|
|
361
365
|
}
|
|
362
|
-
const perNation = ["england", "wales", "scotland", "northern_ireland"].flatMap((n) => [n, buildDecileColorExpression(getDecileColors(n, style))]);
|
|
366
|
+
const perNation = ["england", "wales", "scotland", "northern_ireland", "channel_islands"].flatMap((n) => [n, buildDecileColorExpression(getDecileColors(n, style))]);
|
|
363
367
|
return [
|
|
364
368
|
"match",
|
|
365
369
|
["get", "nation"],
|