@chrtco/sdk 0.9.0 → 0.9.1
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 +19 -0
- package/dist/atlas/browser.cjs +4311 -5
- package/dist/atlas/browser.cjs.map +1 -1
- package/dist/atlas/browser.d.cts +29 -1
- package/dist/atlas/browser.d.ts +29 -1
- package/dist/atlas/browser.js +4308 -5
- package/dist/atlas/browser.js.map +1 -1
- package/dist/index.cjs +5148 -266
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +483 -70
- package/dist/index.d.ts +483 -70
- package/dist/index.js +5125 -266
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@chrtco/sdk` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
- **Symbol families (`symbolSet`)** — `chrt.style({ symbolSet })`, `styleUrl({ symbols })` and `fetchStyle({ symbols })` select the symbol artwork:
|
|
7
|
+
- **`s52`** (default) — now **spec-exact for ATONs and LIGHTS**: buoy/beacon icon selection is compiled from the S-52 Presentation Library lookup tables (COLOUR-list keyed — preferred-channel junction marks render correctly; no IALA region hardcoding), and light flares follow the LIGHTS05/06 conditional-symbology procedure (LIGHTS11/12/13 colour-specific flares, LIGHTS81/82 strip/floodlight, LITDEF11 default).
|
|
8
|
+
- **`s101`** — the official IHO S-101 Portrayal Catalogue ATON/LIGHTS artwork (vendored at a pinned commit, themed through the official S-101 day/dusk/night profiles). Load images via `loadS101SymbolImages` (`@chrtco/sdk/atlas/browser`).
|
|
9
|
+
- **`chrt`** — the CHRT house set: simplified colour-true silhouettes (tinted at runtime from the feature's COLOUR — green marks render green, red marks red), fixed-palette identity marks (cardinals, isolated danger, safe water), and capability badges (sound for fog signals, radar for racons). Load via `loadChrtSymbolImages`.
|
|
10
|
+
- Served Style API: `GET /v1/styles/{region}/style.json?symbols=s52|s101|chrt` (own cache-key slot, `X-Style-Symbols` response header); composes with Dev+ custom-style claims.
|
|
11
|
+
- **Behaviour change (S-52 correctness):** LIGHTS icons are no longer SDF-tinted by COLOUR; the procedure-selected flare carries its own colour. Blue/orange lights now render the spec's LITDEF11 default flare (use the `chrt` family for exact-colour flares).
|
|
12
|
+
|
|
13
|
+
## [0.9.1] — 2026-07-14
|
|
14
|
+
- **CHRTinteract v1.1 — multi-feature disambiguation + area-feature selection.** A chart click rarely hits one feature (a buoy on a channel over a DEPARE); interact now collects **everything under the click** instead of silently taking the topmost hit:
|
|
15
|
+
- **Candidate collection with tolerance** — point and line targets are picked up within a configurable pixel radius (`tolerance`, default 8px; `0` = exact point); area (polygon) candidates always require the exact click point to fall inside them.
|
|
16
|
+
- **Cross-tile dedupe by S-57 identity** — features split across tile boundaries (or rendered by several style layers) fold into one candidate via the source-cell-scoped `LNAM` (AGEN+FIDN+FIDS long name; carried by CHRT tiles end-to-end — verified 100% present on served tiles), with the `AGEN:FIDN:FIDS` composite as fallback. Identity-less features are never folded.
|
|
17
|
+
- **Class-priority ordering** — point targets > line targets > area targets, safety-critical classes first within each band (`INSPECT_CLASS_RANK`, kept **value-coherent with the atlas `LABEL_PRIORITY` collision ladder** — one priority model across the platform, enforced by a unit test; documented deviations in `INSPECT_RANK_DEVIATIONS`). **Area features never preempt the buoy on top of them but always remain selectable** — a click on open water resolves to its DEPARE.
|
|
18
|
+
- **Child-object collapse** — co-located S-57 child objects (LIGHTS, TOPMAR, FOGSIG, RTPBCN, DAYMAR) fold into their parent buoy/beacon candidate (`collapsedChildren`); selecting the parent runs the v1 co-located merge. Opt out with `collapseChildren: false`.
|
|
19
|
+
- **`attach()` disambiguation modes** — built-in popup: multi-hit shows a minimal candidate list (same invariant disclaimer footer), picking a row opens the result card. New `onCandidates(candidates, ctx)` callback for custom UIs — resolve a choice with `ctx.select(candidate)` (drives `onInspect` + popup as usual). Headless `onInspect`-only: the top candidate is inspected immediately and **clicking the same spot again cycles** to the next candidate (buoy → channel → depth area …). Single hits behave exactly like v1.
|
|
20
|
+
- **New `chrt.interact.inspectAll(map, point, opts?)`** — headless candidate collection for any screen point or `[lng, lat]`; returns `{ candidates, select }` where `select(candidate, { enrich? })` resolves the full `InspectResult` (v1 co-located merge; enrichment metered as before). Server-side entitlement is checked first, same as `attach`/`inspect`.
|
|
21
|
+
- **Safety invariants extended** — every `InspectCandidate` carries the same `notice` (non-SOLAS disclaimer + HO attribution + data currency) as results; the candidate-list popup renders the invariant footer.
|
|
22
|
+
- New exports: `collectCandidates`, `collectClickCandidates`, `featureIdentity`, `resolveTargetClass`, `candidateRank`, `decodeCandidate`, `INSPECT_CLASS_RANK`, `DEFAULT_INSPECT_CLASS_RANK`, `INSPECT_RANK_DEVIATIONS`, `DEFAULT_CLICK_TOLERANCE`; new types `InspectCandidate`, `InspectTargetClass`, `InspectCandidateSet`, `CandidateQueryOptions`, `CandidatesEventContext`, `ClickAnchor`. `InteractMapLike` gains optional `unproject` (used when `inspectAll` receives a screen point). No entitlement or pricing changes.
|
|
23
|
+
|
|
5
24
|
## [0.9.0] — 2026-07-13
|
|
6
25
|
- **New: CHRTinteract (`chrt.interact.*`)** — productized click-to-inspect for CHRT charts. Included with the **Dev plan and above**; the entitlement is derived from the team's plan and **enforced server-side** at attach time (`POST /v1/interact/entitlement` on `api.chrt.co`).
|
|
7
26
|
- `await chrt.interact.attach(map, opts?)` — wires click → decode onto any MapLibre / Mapbox GL map showing CHRT tiles. Headless-first (`onInspect(result, ctx)` callback); a minimal built-in plain-DOM popup is the default when no callback is given (`popup: true` keeps both). Click pipeline and co-located S-57 child-object merging (LIGHTS / FOGSIG / TOPMAR / RTPBCN / parent buoy names, sector collection) mirror the first-party CHRT map. Returns `{ detach() }`. MapLibre remains an **optional** peer dependency — the map is consumed structurally.
|