@chrtco/sdk 0.10.9 → 0.10.11

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/dist/index.d.cts CHANGED
@@ -2557,9 +2557,10 @@ declare function getLookupEntry(layerName: string): LookupEntry;
2557
2557
  * none is supplied. It matches `custom-style.ts`'s config default.
2558
2558
  *
2559
2559
  * NOTE: `depareFillExpression` below deliberately does NOT use this — its
2560
- * 2/5/10 m bands are the S-52 four-shade DEPARE ramp, a separate concept
2561
- * from the safety contour. Wiring those to the user's contour would change
2562
- * rendering for every existing user and needs its own decision.
2560
+ * 2/5/18.2 m bands are the four-shade DEPARE ramp (see DEPARE_DEEP_CUT_M
2561
+ * for why the deep cut is 18.2), a separate concept from the safety
2562
+ * contour. Wiring those to the user's contour would change rendering for
2563
+ * every existing user and needs its own decision.
2563
2564
  */
2564
2565
  declare const DEFAULT_SAFETY_CONTOUR_M = 10;
2565
2566
  declare function depareColor(props: Record<string, unknown>, ct?: ColorTableName): string;
package/dist/index.d.ts CHANGED
@@ -2557,9 +2557,10 @@ declare function getLookupEntry(layerName: string): LookupEntry;
2557
2557
  * none is supplied. It matches `custom-style.ts`'s config default.
2558
2558
  *
2559
2559
  * NOTE: `depareFillExpression` below deliberately does NOT use this — its
2560
- * 2/5/10 m bands are the S-52 four-shade DEPARE ramp, a separate concept
2561
- * from the safety contour. Wiring those to the user's contour would change
2562
- * rendering for every existing user and needs its own decision.
2560
+ * 2/5/18.2 m bands are the four-shade DEPARE ramp (see DEPARE_DEEP_CUT_M
2561
+ * for why the deep cut is 18.2), a separate concept from the safety
2562
+ * contour. Wiring those to the user's contour would change rendering for
2563
+ * every existing user and needs its own decision.
2563
2564
  */
2564
2565
  declare const DEFAULT_SAFETY_CONTOUR_M = 10;
2565
2566
  declare function depareColor(props: Record<string, unknown>, ct?: ColorTableName): string;
package/dist/index.js CHANGED
@@ -5270,13 +5270,14 @@ function patternSpriteId(patternName) {
5270
5270
 
5271
5271
  // src/atlas/s52-conditional.ts
5272
5272
  var DEFAULT_SAFETY_CONTOUR_M = 10;
5273
+ var DEPARE_DEEP_CUT_M = 18.2;
5273
5274
  function depareColor(props, ct = "DAY") {
5274
5275
  const drval1 = Number(props.DRVAL1 ?? props.drval1 ?? -1);
5275
5276
  const drval2 = Number(props.DRVAL2 ?? props.drval2 ?? drval1);
5276
5277
  if (drval1 < 0 && drval2 <= 0) return resolveColor("DEPIT", ct);
5277
5278
  if (drval1 < 2) return resolveColor("DEPVS", ct);
5278
5279
  if (drval1 < 5) return resolveColor("DEPMS", ct);
5279
- if (drval1 < 10) return resolveColor("DEPMD", ct);
5280
+ if (drval1 < DEPARE_DEEP_CUT_M) return resolveColor("DEPMD", ct);
5280
5281
  return resolveColor("DEPDW", ct);
5281
5282
  }
5282
5283
  function depareFillExpression(ct = "DAY") {
@@ -5292,7 +5293,7 @@ function depareFillExpression(ct = "DAY") {
5292
5293
  resolveColor("DEPVS", ct),
5293
5294
  ["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], 5],
5294
5295
  resolveColor("DEPMS", ct),
5295
- ["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], 10],
5296
+ ["<", ["coalesce", ["get", "DRVAL1"], ["get", "drval1"], -1], DEPARE_DEEP_CUT_M],
5296
5297
  resolveColor("DEPMD", ct),
5297
5298
  resolveColor("DEPDW", ct)
5298
5299
  ];
@@ -28100,6 +28101,21 @@ var BAND_DATA_MINZOOM = {
28100
28101
  function dominatedVariantMaxzoom(D) {
28101
28102
  return Math.max(BAND_PRIORITY_RANGES[D].minzoom, BAND_DATA_MINZOOM[D]);
28102
28103
  }
28104
+ var DOMINANCE_EXEMPT_FILL_CLASSES = /* @__PURE__ */ new Set([
28105
+ "LNDARE",
28106
+ "DEPARE",
28107
+ "UNSARE",
28108
+ "LAKARE",
28109
+ "DRGARE",
28110
+ "SEAARE"
28111
+ ]);
28112
+ function isExemptOpaqueFill(layer) {
28113
+ if (layer.type !== "fill") return false;
28114
+ for (const cls of DOMINANCE_EXEMPT_FILL_CLASSES) {
28115
+ if (layer.id.startsWith(`s52-${cls}-`)) return true;
28116
+ }
28117
+ return false;
28118
+ }
28103
28119
  var BAND_DRAW_ORDER = ["1", "2", "3", "4", "5", "6"];
28104
28120
  var CHART_BAND_CODES = {
28105
28121
  Overview: ["1"],
@@ -28220,7 +28236,7 @@ function collapsedDominanceGate(B, minzoom) {
28220
28236
  function makeCollapsedBandVariant(layer, B, isExempt) {
28221
28237
  const range = BAND_PRIORITY_RANGES[B];
28222
28238
  const classMinzoom = layer.minzoom ?? 0;
28223
- const minzoom = Math.max(classMinzoom, range.minzoom);
28239
+ const minzoom = isExemptOpaqueFill(layer) ? classMinzoom : Math.max(classMinzoom, range.minzoom);
28224
28240
  if (isExempt) {
28225
28241
  const exempt = {
28226
28242
  ...layer,
@@ -28349,30 +28365,18 @@ var DOMINANCE_EXEMPT_CLASSES = /* @__PURE__ */ new Set([
28349
28365
  "RTPBCN",
28350
28366
  "RDOSTA"
28351
28367
  ]);
28352
- var DOMINANCE_EXEMPT_FILL_CLASSES = /* @__PURE__ */ new Set([
28353
- "LNDARE",
28354
- "DEPARE",
28355
- "UNSARE",
28356
- "LAKARE",
28357
- "DRGARE",
28358
- "SEAARE"
28359
- ]);
28360
28368
  function isDominanceExempt(layer) {
28361
28369
  for (const cls of DOMINANCE_EXEMPT_CLASSES) {
28362
28370
  if (layer.id.startsWith(`s52-${cls}-`)) return true;
28363
28371
  }
28364
- if (layer.type === "fill") {
28365
- for (const cls of DOMINANCE_EXEMPT_FILL_CLASSES) {
28366
- if (layer.id.startsWith(`s52-${cls}-`)) return true;
28367
- }
28368
- }
28372
+ if (isExemptOpaqueFill(layer)) return true;
28369
28373
  return false;
28370
28374
  }
28371
28375
  var TOP_STACK_LIGHT_CLASSES = /* @__PURE__ */ new Set(["LIGHTS"]);
28372
28376
  function makeBandVariants(layer, B) {
28373
28377
  const range = BAND_PRIORITY_RANGES[B];
28374
28378
  const classMinzoom = layer.minzoom ?? 0;
28375
- const minzoom = Math.max(classMinzoom, range.minzoom);
28379
+ const minzoom = isExemptOpaqueFill(layer) ? classMinzoom : Math.max(classMinzoom, range.minzoom);
28376
28380
  const variants = [];
28377
28381
  if (isDominanceExempt(layer)) {
28378
28382
  const exempt = {