@nika-js/onlymap 0.12.0 → 0.13.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 +44 -0
- package/README.md +1 -1
- package/dist/{basemap-CtDse0mW.js → basemap-BxqFTBzX.js} +2 -2
- package/dist/build-D4iI8O9b.js +208 -0
- package/dist/cartograph.js +43 -41
- package/dist/cartograph.standalone.js +3 -1
- package/dist/client-BYFePLZV.js +6878 -0
- package/dist/{geoparquet-BTHYX1ET.js → geoparquet-BV32P0nI.js} +1 -1
- package/dist/{globe-view-KrKNOmVs.js → globe-view-B_X6obse.js} +6 -6
- package/dist/{hillshade-CijRdYyU.js → hillshade-9VS_t-Ks.js} +79 -67
- package/dist/hillshade.d.ts +7 -0
- package/dist/html-data.d.ts +1 -1
- package/dist/{index-21KGElDr.js → index-BR_5FIN1.js} +3 -3
- package/dist/{index-eHYe06mM.js → index-Bct9VWxi.js} +1 -1
- package/dist/index-CbFw6P0B.js +4449 -0
- package/dist/{index-Bfocr1_A.js → index-D3P6Cfbr.js} +38 -38
- package/dist/{index-A45DtXly.js → index-D40H3fpl.js} +54 -54
- package/dist/{index-DoGY-Vgi.js → index-Di1LK4JT.js} +3 -3
- package/dist/{index-DMc81n9B.js → index-IDWDfgTC.js} +33429 -30673
- package/dist/{index-DS6VUGi6.js → index-JewSBOjJ.js} +49 -49
- package/dist/{index-BPa2CC8T.js → index-eSuCj2Bn.js} +42 -42
- package/dist/layer-registry.d.ts +1 -0
- package/dist/{lerc-DjrPALEj.js → lerc-C42a0ISa.js} +1 -1
- package/dist/onlymap.standalone.js +60636 -51605
- package/dist/onlymapjs.js +47 -47
- package/dist/plane-gpu/gpu-layer-types.d.ts +35 -0
- package/dist/plane-gpu/plane-basemap.d.ts +10461 -0
- package/dist/plane-gpu/plane-gpu-view.d.ts +90 -0
- package/dist/plane-gpu/projection-params.d.ts +47 -0
- package/dist/plane-layers.d.ts +2 -0
- package/dist/plane-seam.d.ts +48 -0
- package/dist/plane-tileset.d.ts +23 -2
- package/dist/plane-vector/build.d.ts +107 -0
- package/dist/plane-vector/client.d.ts +18 -0
- package/dist/plane-vector/cut-ends-extension.d.ts +30 -0
- package/dist/plane-vector/plane-mvt-layer.d.ts +10412 -0
- package/dist/plane-vector/tile-cut.d.ts +45 -0
- package/dist/plane-vector/worker.d.ts +15 -0
- package/dist/plane-warp.d.ts +12 -1
- package/dist/{post-process-effect-Be1qa2DD.js → post-process-effect-ktcgAjmv.js} +11 -11
- package/dist/programmatic.d.ts +6 -0
- package/dist/projection.d.ts +51 -0
- package/dist/{raster-zC3qXBrs.js → raster-CIxg_M_1.js} +3 -3
- package/dist/{raster-pipeline-DspBYxwc.js → raster-pipeline-BODPC9vJ.js} +1 -1
- package/dist/react/om-map.d.ts +4 -0
- package/dist/react.js +259 -252
- package/dist/runtime-core.d.ts +84 -2
- package/dist/{text-on-path-D0_URrD2.js → text-on-path-LZL6NfwZ.js} +74 -66
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-DopOhzfY.js → zarr-D19fNIZt.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/docs/cartography.md +59 -3
- package/docs/testing.md +2 -1
- package/llms.txt +2 -2
- package/onlymapjs.attributes.json +1 -0
- package/onlymapjs.html-data.json +15 -1
- package/package.json +3 -2
- package/skills/onlymapjs/SKILL.md +2 -2
- package/skills/onlymapjs/references/syntax.md +7 -6
- package/dist/index-B_Vhebf7.js +0 -4883
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const n = Math.max(Math.cos(r *
|
|
1
|
+
import { aI as tt, aJ as et, aK as j, ab as nt, ac as ot, aL as q, aM as rt, aN as O, a7 as st, a8 as U, aO as B, aP as it } from "./index-IDWDfgTC.js";
|
|
2
|
+
const H = Math.PI / 180, T = tt * H;
|
|
3
|
+
function K(t, r) {
|
|
4
|
+
const n = Math.max(Math.cos(r * H), 1e-6);
|
|
5
5
|
return {
|
|
6
6
|
toMetres(o) {
|
|
7
7
|
return [(o[0] - t) * T * n, (o[1] - r) * T];
|
|
@@ -11,17 +11,17 @@ function Q(t, r) {
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function _(t) {
|
|
15
15
|
return Array.isArray(t) && typeof t[0] == "number" && typeof t[1] == "number";
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return Array.isArray(t) &&
|
|
17
|
+
function X(t) {
|
|
18
|
+
return Array.isArray(t) && _(t[0]);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Q(t) {
|
|
21
21
|
let r = 1 / 0, n = 1 / 0, o = -1 / 0, a = -1 / 0, s = !1;
|
|
22
22
|
const e = (f) => {
|
|
23
23
|
if (Array.isArray(f)) {
|
|
24
|
-
if (
|
|
24
|
+
if (_(f)) {
|
|
25
25
|
s = !0, f[0] < r && (r = f[0]), f[0] > o && (o = f[0]), f[1] < n && (n = f[1]), f[1] > a && (a = f[1]);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
@@ -31,7 +31,7 @@ function K(t) {
|
|
|
31
31
|
return e(t), s ? [(r + o) / 2, (n + a) / 2] : null;
|
|
32
32
|
}
|
|
33
33
|
function z(t, r) {
|
|
34
|
-
return !Array.isArray(t) ||
|
|
34
|
+
return !Array.isArray(t) || _(t) ? t : X(t) ? r(t) : t.map((n) => z(n, r));
|
|
35
35
|
}
|
|
36
36
|
function V(t) {
|
|
37
37
|
if (t.length < 3) return !1;
|
|
@@ -48,7 +48,7 @@ function at(t, r, n, o, a, s) {
|
|
|
48
48
|
}
|
|
49
49
|
function ct(t, r, n, o) {
|
|
50
50
|
if (t.length <= 2 || !(r > 0)) return t;
|
|
51
|
-
const a =
|
|
51
|
+
const a = K(n, o), s = new Float64Array(t.length), e = new Float64Array(t.length);
|
|
52
52
|
for (let l = 0; l < t.length; l++) {
|
|
53
53
|
const [y, h] = a.toMetres(t[l]);
|
|
54
54
|
s[l] = y, e[l] = h;
|
|
@@ -70,10 +70,10 @@ function ct(t, r, n, o) {
|
|
|
70
70
|
return V(t) && u.length < 4 ? t : u;
|
|
71
71
|
}
|
|
72
72
|
function ut(t, r) {
|
|
73
|
-
const n =
|
|
73
|
+
const n = Q(t);
|
|
74
74
|
return n ? z(t, (o) => ct(o, r, n[0], n[1])) : t;
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const Y = 0.25;
|
|
77
77
|
function ft(t, r) {
|
|
78
78
|
let n = t;
|
|
79
79
|
const o = V(t);
|
|
@@ -86,8 +86,8 @@ function ft(t, r) {
|
|
|
86
86
|
for (let c = 0; c < f; c++) {
|
|
87
87
|
const i = s[c], u = s[(c + 1) % s.length];
|
|
88
88
|
e.push(
|
|
89
|
-
[i[0] + (u[0] - i[0]) *
|
|
90
|
-
[i[0] + (u[0] - i[0]) * (1 -
|
|
89
|
+
[i[0] + (u[0] - i[0]) * Y, i[1] + (u[1] - i[1]) * Y],
|
|
90
|
+
[i[0] + (u[0] - i[0]) * (1 - Y), i[1] + (u[1] - i[1]) * (1 - Y)]
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
o ? e.push(e[0].slice()) : e.push(s[s.length - 1]), n = e;
|
|
@@ -107,8 +107,8 @@ function ht(t) {
|
|
|
107
107
|
}
|
|
108
108
|
function mt(t) {
|
|
109
109
|
const r = [], n = (o) => {
|
|
110
|
-
if (Array.isArray(o) && !
|
|
111
|
-
if (
|
|
110
|
+
if (Array.isArray(o) && !X(o)) {
|
|
111
|
+
if (X(o[0])) {
|
|
112
112
|
r.push(o);
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -118,8 +118,8 @@ function mt(t) {
|
|
|
118
118
|
return n(t), r;
|
|
119
119
|
}
|
|
120
120
|
function dt(t, r, n) {
|
|
121
|
-
if (!
|
|
122
|
-
for (let o = 1; o < t.length; o++) if (
|
|
121
|
+
if (!j(t[0], r, n)) return !1;
|
|
122
|
+
for (let o = 1; o < t.length; o++) if (j(t[o], r, n)) return !1;
|
|
123
123
|
return !0;
|
|
124
124
|
}
|
|
125
125
|
function pt(t, r, n) {
|
|
@@ -191,7 +191,7 @@ function gt(t, r) {
|
|
|
191
191
|
}
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function C(t, r, n, o, a) {
|
|
195
195
|
let s = 0;
|
|
196
196
|
o[0] = 0, a[0] = -$, a[1] = $;
|
|
197
197
|
for (let e = 1; e < r; e++) {
|
|
@@ -213,13 +213,13 @@ function W(t, r, n) {
|
|
|
213
213
|
const a = Math.max(r, n), s = new Float64Array(a), e = new Float64Array(a), f = new Int32Array(a), c = new Float64Array(a + 1);
|
|
214
214
|
for (let i = 0; i < r; i++) {
|
|
215
215
|
for (let u = 0; u < n; u++) s[u] = o[u * r + i];
|
|
216
|
-
|
|
216
|
+
C(s, n, e, f, c);
|
|
217
217
|
for (let u = 0; u < n; u++) o[u * r + i] = e[u];
|
|
218
218
|
}
|
|
219
219
|
for (let i = 0; i < n; i++) {
|
|
220
220
|
const u = i * r;
|
|
221
221
|
for (let l = 0; l < r; l++) s[l] = o[u + l];
|
|
222
|
-
|
|
222
|
+
C(s, r, e, f, c);
|
|
223
223
|
for (let l = 0; l < r; l++) o[u + l] = Math.sqrt(e[l]);
|
|
224
224
|
}
|
|
225
225
|
return o;
|
|
@@ -234,7 +234,7 @@ function bt(t, r) {
|
|
|
234
234
|
}
|
|
235
235
|
return c;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function G(t, r, n) {
|
|
238
238
|
const o = r - t;
|
|
239
239
|
return o === 0 ? 0.5 : (n - t) / o;
|
|
240
240
|
}
|
|
@@ -245,7 +245,7 @@ function Z(t, r, n, o) {
|
|
|
245
245
|
if (!l(d, m)) continue;
|
|
246
246
|
const p = u(d, m), M = u(d + 1, m), F = u(d + 1, m + 1), w = u(d, m + 1), N = (p < n ? 8 : 0) | (M < n ? 4 : 0) | (F < n ? 2 : 0) | (w < n ? 1 : 0);
|
|
247
247
|
if (N === 0 || N === 15) continue;
|
|
248
|
-
const k = [y(d) +
|
|
248
|
+
const k = [y(d) + G(p, M, n) * e, h(m)], g = [y(d + 1), h(m) + G(M, F, n) * e], b = [y(d) + G(w, F, n) * e, h(m + 1)], A = [y(d), h(m) + G(p, w, n) * e], x = (P, R) => {
|
|
249
249
|
i.push([P[0], P[1], R[0], R[1]]);
|
|
250
250
|
};
|
|
251
251
|
switch (N) {
|
|
@@ -346,7 +346,7 @@ function At(t) {
|
|
|
346
346
|
function Ft(t) {
|
|
347
347
|
const r = [], n = (o) => {
|
|
348
348
|
if (Array.isArray(o)) {
|
|
349
|
-
if (
|
|
349
|
+
if (X(o)) {
|
|
350
350
|
const a = o, s = a[0], e = a[a.length - 1], f = a.length > 2 && s[0] === e[0] && s[1] === e[1];
|
|
351
351
|
r.push(f ? a : [...a, [s[0], s[1]]]);
|
|
352
352
|
return;
|
|
@@ -359,9 +359,9 @@ function Ft(t) {
|
|
|
359
359
|
function St(t, r) {
|
|
360
360
|
const n = Ft(t);
|
|
361
361
|
if (n.length === 0) return [];
|
|
362
|
-
const o =
|
|
362
|
+
const o = Q(t);
|
|
363
363
|
if (!o) return [];
|
|
364
|
-
const a =
|
|
364
|
+
const a = K(o[0], o[1]), s = n.map((m) => m.map((d) => a.toMetres(d))), e = Math.abs(r.distanceMetres);
|
|
365
365
|
if (!(e > 0)) return [];
|
|
366
366
|
const f = Math.max(1, Math.round(r.repeat)), c = e * f, i = e / Math.max(1, r.cellsPerBand), u = xt(s, i, c + i * 4);
|
|
367
367
|
if (!u) return [];
|
|
@@ -411,7 +411,7 @@ function It(t) {
|
|
|
411
411
|
return Math.atan(Math.sinh(Math.PI * (1 - 2 * t))) * 180 / Math.PI;
|
|
412
412
|
}
|
|
413
413
|
async function Pt(t) {
|
|
414
|
-
const [r, n, o, a] = t.bounds, s = Math.max(0, Math.round(t.zoom)), e =
|
|
414
|
+
const [r, n, o, a] = t.bounds, s = Math.max(0, Math.round(t.zoom)), e = q(r, a, s), f = q(o, n, s), c = Math.min(e.x, f.x), i = Math.max(e.x, f.x), u = Math.min(e.y, f.y), l = Math.max(e.y, f.y), y = (i - c + 1) * (l - u + 1);
|
|
415
415
|
if (y <= 0 || y > t.maxTiles) return null;
|
|
416
416
|
const h = (i - c + 1) * I, m = (l - u + 1) * I, d = new Float32Array(h * m), p = new Uint8Array(h * m), M = await Promise.all(
|
|
417
417
|
Array.from({ length: y }, (k, g) => {
|
|
@@ -423,10 +423,10 @@ async function Pt(t) {
|
|
|
423
423
|
for (const { tx: k, ty: g, pixels: b } of M) {
|
|
424
424
|
if (!b) continue;
|
|
425
425
|
const A = (k - c) * I, x = (g - u) * I, P = Math.min(I, b.height), R = Math.min(I, b.width);
|
|
426
|
-
for (let
|
|
427
|
-
for (let
|
|
428
|
-
const
|
|
429
|
-
d[
|
|
426
|
+
for (let v = 0; v < P; v++)
|
|
427
|
+
for (let E = 0; E < R; E++) {
|
|
428
|
+
const D = (v * b.width + E) * 4, L = (x + v) * h + A + E;
|
|
429
|
+
d[L] = ot(t.decoder, b.data[D], b.data[D + 1], b.data[D + 2]), p[L] = 1;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
const F = { width: h, height: m, cell: 1, originX: 0, originY: 0 }, w = 2 ** s;
|
|
@@ -460,18 +460,18 @@ async function Rt(t) {
|
|
|
460
460
|
}
|
|
461
461
|
return m;
|
|
462
462
|
}
|
|
463
|
-
const
|
|
464
|
-
function
|
|
463
|
+
const vt = /* @__PURE__ */ new Set(["LineString", "MultiLineString", "Polygon", "MultiPolygon"]);
|
|
464
|
+
function J(t, r, n) {
|
|
465
465
|
return t.map((o) => {
|
|
466
466
|
const s = o.geometry;
|
|
467
467
|
if (!s || s.coordinates == null) return o;
|
|
468
|
-
if (!
|
|
468
|
+
if (!vt.has(String(s.type)))
|
|
469
469
|
return String(s.type) !== "Point" && n?.(String(s.type ?? "unknown")), o;
|
|
470
470
|
const e = r(s.coordinates);
|
|
471
471
|
return e === s.coordinates ? o : { ...o, geometry: { ...s, coordinates: e } };
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function Et(t) {
|
|
475
475
|
if (!t) return null;
|
|
476
476
|
const r = t.trim().replace(/^\[|\]$/g, "").split(/[\s,]+/).map(Number);
|
|
477
477
|
if (r.length !== 4 || !r.every((e) => Number.isFinite(e))) return null;
|
|
@@ -481,26 +481,26 @@ function vt(t) {
|
|
|
481
481
|
function S(t, r, n) {
|
|
482
482
|
console.error(`[onlymapjs] ${t} ${r} ${n}`);
|
|
483
483
|
}
|
|
484
|
-
async function
|
|
484
|
+
async function Yt(t, r, n, o, a) {
|
|
485
485
|
if (r !== "geojson" && !rt(n))
|
|
486
486
|
return S(a, "<om-transform> needs GeoJSON geometry; this layer's rows are flat.", "Load the source as GeoJSON, or remove the transform."), t;
|
|
487
487
|
let s = t;
|
|
488
488
|
for (const e of n)
|
|
489
489
|
switch (e.type) {
|
|
490
490
|
case "simplify": {
|
|
491
|
-
const f =
|
|
491
|
+
const f = O(e.params.tolerance);
|
|
492
492
|
if (!f) {
|
|
493
493
|
S(a, '<om-transform type="simplify"> needs a tolerance with a unit.', 'Write tolerance="0.15mm" (paper) or tolerance="50m" (ground).');
|
|
494
494
|
break;
|
|
495
495
|
}
|
|
496
|
-
const c =
|
|
496
|
+
const c = B(f, o);
|
|
497
497
|
if (c == null) {
|
|
498
498
|
S(a, '<om-transform type="simplify"> has a tolerance in millimetres but this map declares no reference scale.', 'Add reference-scale="1:50000" to <om-map>, or author the tolerance in ground units (tolerance="50m").');
|
|
499
499
|
break;
|
|
500
500
|
}
|
|
501
501
|
{
|
|
502
502
|
const i = /* @__PURE__ */ new Set();
|
|
503
|
-
s =
|
|
503
|
+
s = J(s, (u) => ut(u, c), (u) => i.add(u)), i.size > 0 && S(
|
|
504
504
|
a,
|
|
505
505
|
`<om-transform type="simplify"> left ${[...i].join("/")} geometry untouched — there is no path to thin.`,
|
|
506
506
|
"Simplify lines and polygons. A scatter of points has no redundant vertices, and thinning it would delete data."
|
|
@@ -516,7 +516,7 @@ async function Gt(t, r, n, o, a) {
|
|
|
516
516
|
}
|
|
517
517
|
{
|
|
518
518
|
const c = /* @__PURE__ */ new Set();
|
|
519
|
-
s =
|
|
519
|
+
s = J(s, (i) => lt(i, Math.round(f)), (i) => c.add(i)), c.size > 0 && S(
|
|
520
520
|
a,
|
|
521
521
|
`<om-transform type="smooth"> left ${[...c].join("/")} geometry untouched — there is no path to round.`,
|
|
522
522
|
"Smooth lines and polygons. Rounding a scatter of points would replace every one of them with a location that is not in the data."
|
|
@@ -540,12 +540,12 @@ async function Gt(t, r, n, o, a) {
|
|
|
540
540
|
break;
|
|
541
541
|
}
|
|
542
542
|
case "buffer": {
|
|
543
|
-
const f =
|
|
543
|
+
const f = O(e.params.distance);
|
|
544
544
|
if (!f) {
|
|
545
545
|
S(a, '<om-transform type="buffer"> needs a distance with a unit.', 'Write distance="1.2mm" (paper) or distance="500m" (ground).');
|
|
546
546
|
break;
|
|
547
547
|
}
|
|
548
|
-
const c =
|
|
548
|
+
const c = B(f, o);
|
|
549
549
|
if (c == null) {
|
|
550
550
|
S(a, '<om-transform type="buffer"> has a distance in millimetres but this map declares no reference scale.', 'Add reference-scale="1:50000" to <om-map>, or author the distance in ground units (distance="500m").');
|
|
551
551
|
break;
|
|
@@ -578,7 +578,7 @@ async function Gt(t, r, n, o, a) {
|
|
|
578
578
|
break;
|
|
579
579
|
}
|
|
580
580
|
case "contour": {
|
|
581
|
-
const f = e.params.src, c =
|
|
581
|
+
const f = e.params.src, c = Et(e.params.bounds), i = O(e.params.interval);
|
|
582
582
|
if (!f || !c || !i) {
|
|
583
583
|
S(
|
|
584
584
|
a,
|
|
@@ -596,7 +596,7 @@ async function Gt(t, r, n, o, a) {
|
|
|
596
596
|
S(a, `<om-transform type="contour"> src="${f}" is neither a terrain preset nor a {z}/{x}/{y} template.`, 'Use src="terrarium", or a raw tile URL plus decoder=.');
|
|
597
597
|
break;
|
|
598
598
|
}
|
|
599
|
-
const y = e.params.decoder ?? (typeof u?.decoder == "string" ? u.decoder : void 0), h = y && y in
|
|
599
|
+
const y = e.params.decoder ?? (typeof u?.decoder == "string" ? u.decoder : void 0), h = y && y in U ? U[y] : u?.decoder ?? U.terrarium, m = e.params.zoom === void 0 ? 10 : Number(e.params.zoom), d = await Rt({
|
|
600
600
|
template: l,
|
|
601
601
|
decoder: h,
|
|
602
602
|
zoom: Number.isFinite(m) ? m : 10,
|
|
@@ -623,15 +623,15 @@ export {
|
|
|
623
623
|
Nt as bufferRows,
|
|
624
624
|
ft as chaikinRing,
|
|
625
625
|
Rt as contourFromDem,
|
|
626
|
-
|
|
626
|
+
Q as coordinateCentre,
|
|
627
627
|
W as distanceTransform,
|
|
628
628
|
xt as gridFor,
|
|
629
629
|
z as mapRings,
|
|
630
630
|
Z as marchingSquares,
|
|
631
|
-
|
|
632
|
-
|
|
631
|
+
K as metricFrame,
|
|
632
|
+
Et as parseBounds,
|
|
633
633
|
gt as rasterizeRings,
|
|
634
|
-
|
|
634
|
+
Yt as runTransforms,
|
|
635
635
|
pt as scatterFeature,
|
|
636
636
|
yt as scatterRows,
|
|
637
637
|
bt as signedDistanceField,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { y as
|
|
1
|
+
import { bF as Be, bG as le, bH as ce, bI as De, bJ as Oe, bK as ke } from "./index-IDWDfgTC.js";
|
|
2
|
+
import { y as Fe, a as he, z as G, R as J, A as ue, C as ve, F as je, n as xe, S as Ie, E as Ne } from "./recordbatch-Bpc0uxFn.js";
|
|
3
3
|
import { g as V, a as fe, b as Le, c as Ue, d as Me, e as qe, m as Ve } from "./table-accessors-CYWTzpQI.js";
|
|
4
4
|
import { c as $e } from "./convert-arrow-schema-DrAihRf9.js";
|
|
5
5
|
function de(t) {
|
|
6
6
|
switch (t.shape) {
|
|
7
7
|
case "array-row-table":
|
|
8
8
|
case "object-row-table":
|
|
9
|
-
return
|
|
9
|
+
return Pe(t.data);
|
|
10
10
|
case "geojson-table":
|
|
11
|
-
return
|
|
11
|
+
return ze(t.features);
|
|
12
12
|
case "columnar-table":
|
|
13
|
-
return
|
|
13
|
+
return He(t.data);
|
|
14
14
|
case "arrow-table":
|
|
15
15
|
default:
|
|
16
16
|
throw new Error("Deduce schema");
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function He(t) {
|
|
20
20
|
const e = [];
|
|
21
21
|
for (const [r, s] of Object.entries(t)) {
|
|
22
22
|
const n = Qe(s, r);
|
|
@@ -24,7 +24,7 @@ function ze(t) {
|
|
|
24
24
|
}
|
|
25
25
|
return { fields: e, metadata: {} };
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Pe(t) {
|
|
28
28
|
if (!t.length)
|
|
29
29
|
throw new Error("deduce from empty table");
|
|
30
30
|
const e = [], r = t[0];
|
|
@@ -32,7 +32,7 @@ function He(t) {
|
|
|
32
32
|
e.push(me(n, s));
|
|
33
33
|
return { fields: e, metadata: {} };
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function ze(t) {
|
|
36
36
|
if (!t.length)
|
|
37
37
|
throw new Error("deduce from empty table");
|
|
38
38
|
const e = [], r = t[0].properties || {};
|
|
@@ -75,7 +75,7 @@ function Je(t, e) {
|
|
|
75
75
|
return new r(e);
|
|
76
76
|
}
|
|
77
77
|
function* We(t, e) {
|
|
78
|
-
const r = $e(t.schema), s = V(t), n = fe(t), a = s, c = r?.fields.map((o) =>
|
|
78
|
+
const r = $e(t.schema), s = V(t), n = fe(t), a = s, c = r?.fields.map((o) => Fe(o)), h = new he(r.fields);
|
|
79
79
|
let f = 0;
|
|
80
80
|
for (let o = 0; o < s; o++)
|
|
81
81
|
for (let u = 0; u < n; ++u) {
|
|
@@ -393,7 +393,7 @@ class at extends we {
|
|
|
393
393
|
const e = super.getBatch();
|
|
394
394
|
if (e) {
|
|
395
395
|
this.arrowSchema = this.arrowSchema || ot(e.schema);
|
|
396
|
-
const r = lt(this.arrowSchema, e.data), s = new J(this.arrowSchema,
|
|
396
|
+
const r = lt(this.arrowSchema, e.data), s = new J(this.arrowSchema, ve({
|
|
397
397
|
type: new he(this.arrowSchema.fields),
|
|
398
398
|
children: r.map(({ data: n }) => n[0])
|
|
399
399
|
}));
|
|
@@ -578,7 +578,7 @@ class ut {
|
|
|
578
578
|
});
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
const re = "\uFEFF",
|
|
581
|
+
const re = "\uFEFF", v = {
|
|
582
582
|
RECORD_SEP: "",
|
|
583
583
|
UNIT_SEP: "",
|
|
584
584
|
BYTE_ORDER_MARK: re,
|
|
@@ -710,7 +710,7 @@ class be {
|
|
|
710
710
|
j(this._config.delimiter) && (this._config.delimiter = this._config.delimiter(e), this._results.meta.delimiter = this._config.delimiter);
|
|
711
711
|
else {
|
|
712
712
|
const c = this.guessDelimiter(e, this._config.newline, this._config.skipEmptyLines, this._config.comments, this._config.delimitersToGuess);
|
|
713
|
-
c.successful ? this._config.delimiter = c.bestDelimiter : (this._delimiterError = !0, this._config.delimiter =
|
|
713
|
+
c.successful ? this._config.delimiter = c.bestDelimiter : (this._delimiterError = !0, this._config.delimiter = v.DefaultDelimiter), this._results.meta.delimiter = this._config.delimiter;
|
|
714
714
|
}
|
|
715
715
|
const a = _e(this._config);
|
|
716
716
|
return this._config.preview && this._config.header && a.preview++, this._input = e, this._parser = new W(a), this._results = this._parser.parse(this._input, r, s), this.processResults(), this._paused ? { meta: { paused: !0 } } : this._results || { meta: { paused: !1 } };
|
|
@@ -734,7 +734,7 @@ class be {
|
|
|
734
734
|
return this._config.skipEmptyLines === "greedy" ? e.join("").trim() === "" : e.length === 1 && e[0].length === 0;
|
|
735
735
|
}
|
|
736
736
|
processResults() {
|
|
737
|
-
if (this._results && this._delimiterError && (this.addError("Delimiter", "UndetectableDelimiter", `Unable to auto-detect delimiting character; defaulted to '${
|
|
737
|
+
if (this._results && this._delimiterError && (this.addError("Delimiter", "UndetectableDelimiter", `Unable to auto-detect delimiting character; defaulted to '${v.DefaultDelimiter}'`), this._delimiterError = !1), this._config.skipEmptyLines)
|
|
738
738
|
for (let e = 0; e < this._results.data.length; e++)
|
|
739
739
|
this.testEmptyLine(this._results.data[e]) && this._results.data.splice(e--, 1);
|
|
740
740
|
return this.needsHeaderRow() && this.fillHeaderFields(), this.applyHeaderAndDynamicTypingAndTransformation();
|
|
@@ -779,7 +779,7 @@ class be {
|
|
|
779
779
|
// eslint-disable-next-line complexity, max-statements
|
|
780
780
|
guessDelimiter(e, r, s, n, a) {
|
|
781
781
|
let c, h, f;
|
|
782
|
-
a = a || [",", " ", "|", ";",
|
|
782
|
+
a = a || [",", " ", "|", ";", v.RECORD_SEP, v.UNIT_SEP];
|
|
783
783
|
for (let o = 0; o < a.length; o++) {
|
|
784
784
|
const u = a[o];
|
|
785
785
|
let i = 0, d = 0, g = 0;
|
|
@@ -842,9 +842,9 @@ function W(t = {}) {
|
|
|
842
842
|
let h;
|
|
843
843
|
t.quoteChar === void 0 ? h = '"' : h = t.quoteChar;
|
|
844
844
|
let f = h;
|
|
845
|
-
if (t.escapeChar !== void 0 && (f = t.escapeChar), (typeof e != "string" ||
|
|
845
|
+
if (t.escapeChar !== void 0 && (f = t.escapeChar), (typeof e != "string" || v.BAD_DELIMITERS.indexOf(e) > -1) && (e = ","), s === e)
|
|
846
846
|
throw new Error("Comment character same as delimiter");
|
|
847
|
-
s === !0 ? s = "#" : (typeof s != "string" ||
|
|
847
|
+
s === !0 ? s = "#" : (typeof s != "string" || v.BAD_DELIMITERS.indexOf(s) > -1) && (s = !1), r !== `
|
|
848
848
|
` && r !== "\r" && r !== `\r
|
|
849
849
|
` && (r = `
|
|
850
850
|
`);
|
|
@@ -854,7 +854,7 @@ function W(t = {}) {
|
|
|
854
854
|
throw new Error("Input must be a string");
|
|
855
855
|
const w = i.length, l = e.length, m = r.length, C = s.length, T = j(n);
|
|
856
856
|
o = 0;
|
|
857
|
-
let y = [],
|
|
857
|
+
let y = [], F = [], p = [], k = 0;
|
|
858
858
|
if (!i)
|
|
859
859
|
return S();
|
|
860
860
|
if (c || c !== !1 && i.indexOf(h) === -1) {
|
|
@@ -884,17 +884,17 @@ function W(t = {}) {
|
|
|
884
884
|
if (i[o] === h) {
|
|
885
885
|
for (b = o, o++; ; ) {
|
|
886
886
|
if (b = i.indexOf(h, b + 1), b === -1)
|
|
887
|
-
return g ||
|
|
887
|
+
return g || F.push({
|
|
888
888
|
type: "Quotes",
|
|
889
889
|
code: "MissingQuotes",
|
|
890
890
|
message: "Quoted field unterminated",
|
|
891
891
|
row: y.length,
|
|
892
892
|
// row has yet to be inserted
|
|
893
893
|
index: o
|
|
894
|
-
}),
|
|
894
|
+
}), H();
|
|
895
895
|
if (b === w - 1) {
|
|
896
896
|
const Ee = i.substring(o, b).replace(B, h);
|
|
897
|
-
return
|
|
897
|
+
return H(Ee);
|
|
898
898
|
}
|
|
899
899
|
if (h === f && i[b + 1] === f) {
|
|
900
900
|
b++;
|
|
@@ -918,7 +918,7 @@ function W(t = {}) {
|
|
|
918
918
|
return S(!0);
|
|
919
919
|
break;
|
|
920
920
|
}
|
|
921
|
-
|
|
921
|
+
F.push({
|
|
922
922
|
type: "Quotes",
|
|
923
923
|
code: "InvalidQuotes",
|
|
924
924
|
message: "Trailing quote on quoted field is malformed",
|
|
@@ -952,7 +952,7 @@ function W(t = {}) {
|
|
|
952
952
|
}
|
|
953
953
|
break;
|
|
954
954
|
}
|
|
955
|
-
return
|
|
955
|
+
return H();
|
|
956
956
|
function x(R) {
|
|
957
957
|
y.push(R), k = o;
|
|
958
958
|
}
|
|
@@ -964,7 +964,7 @@ function W(t = {}) {
|
|
|
964
964
|
}
|
|
965
965
|
return D;
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function H(R) {
|
|
968
968
|
return g || (typeof R > "u" && (R = i.substr(o)), p.push(R), o = w, x(p), T && I()), S();
|
|
969
969
|
}
|
|
970
970
|
function Y(R) {
|
|
@@ -973,7 +973,7 @@ function W(t = {}) {
|
|
|
973
973
|
function S(R, D) {
|
|
974
974
|
return {
|
|
975
975
|
data: D || !1 ? y[0] : y,
|
|
976
|
-
errors:
|
|
976
|
+
errors: F,
|
|
977
977
|
meta: {
|
|
978
978
|
delimiter: e,
|
|
979
979
|
linebreak: r,
|
|
@@ -984,7 +984,7 @@ function W(t = {}) {
|
|
|
984
984
|
};
|
|
985
985
|
}
|
|
986
986
|
function I() {
|
|
987
|
-
n(S(void 0, !0)), y = [],
|
|
987
|
+
n(S(void 0, !0)), y = [], F = [];
|
|
988
988
|
}
|
|
989
989
|
}, this.abort = function() {
|
|
990
990
|
u = !0;
|
|
@@ -1018,7 +1018,7 @@ function wt(t, e = {}) {
|
|
|
1018
1018
|
throw new Error("Unable to serialize unrecognized input");
|
|
1019
1019
|
function i() {
|
|
1020
1020
|
if (typeof e == "object") {
|
|
1021
|
-
if (typeof e.delimiter == "string" && !
|
|
1021
|
+
if (typeof e.delimiter == "string" && !v.BAD_DELIMITERS.filter(function(l) {
|
|
1022
1022
|
return e.delimiter?.indexOf(l) !== -1;
|
|
1023
1023
|
}).length && (n = e.delimiter), (typeof e.quotes == "boolean" || Array.isArray(e.quotes)) && (r = e.quotes), (typeof e.skipEmptyLines == "boolean" || e.skipEmptyLines === "greedy") && (f = e.skipEmptyLines), typeof e.newline == "string" && (a = e.newline), typeof e.quoteChar == "string" && (c = e.quoteChar), typeof e.header == "boolean" && (s = e.header), Array.isArray(e.columns)) {
|
|
1024
1024
|
if (e.columns.length === 0)
|
|
@@ -1031,7 +1031,7 @@ function wt(t, e = {}) {
|
|
|
1031
1031
|
function d(l, m, C) {
|
|
1032
1032
|
let T = "";
|
|
1033
1033
|
typeof l == "string" && (l = JSON.parse(l)), typeof m == "string" && (m = JSON.parse(m));
|
|
1034
|
-
const y = Array.isArray(l) && l.length > 0,
|
|
1034
|
+
const y = Array.isArray(l) && l.length > 0, F = !Array.isArray(m[0]);
|
|
1035
1035
|
if (y && s) {
|
|
1036
1036
|
for (let p = 0; p < l.length; p++)
|
|
1037
1037
|
p > 0 && (T += n), T += g(l[p], p);
|
|
@@ -1044,7 +1044,7 @@ function wt(t, e = {}) {
|
|
|
1044
1044
|
if (C && !y && (A = C === "greedy" ? m[p].join("").trim() === "" : m[p].length === 1 && m[p][0].length === 0), C === "greedy" && y) {
|
|
1045
1045
|
const B = [];
|
|
1046
1046
|
for (let b = 0; b < k; b++) {
|
|
1047
|
-
const x =
|
|
1047
|
+
const x = F ? l[b] : b;
|
|
1048
1048
|
B.push(m[p][x]);
|
|
1049
1049
|
}
|
|
1050
1050
|
A = B.join("").trim() === "";
|
|
@@ -1052,7 +1052,7 @@ function wt(t, e = {}) {
|
|
|
1052
1052
|
if (!A) {
|
|
1053
1053
|
for (let B = 0; B < k; B++) {
|
|
1054
1054
|
B > 0 && !_ && (T += n);
|
|
1055
|
-
const b = y &&
|
|
1055
|
+
const b = y && F ? l[B] : B;
|
|
1056
1056
|
T += g(m[p][b], B);
|
|
1057
1057
|
}
|
|
1058
1058
|
p < m.length - 1 && (!C || k > 0 && !_) && (T += a);
|
|
@@ -1061,7 +1061,7 @@ function wt(t, e = {}) {
|
|
|
1061
1061
|
return T;
|
|
1062
1062
|
}
|
|
1063
1063
|
function g(l, m) {
|
|
1064
|
-
return typeof l > "u" || l === null ? "" : l.constructor === Date ? JSON.stringify(l).slice(1, 25) : (l = l.toString().replace(u, h), typeof r == "boolean" && r || Array.isArray(r) && r[m] || w(l,
|
|
1064
|
+
return typeof l > "u" || l === null ? "" : l.constructor === Date ? JSON.stringify(l).slice(1, 25) : (l = l.toString().replace(u, h), typeof r == "boolean" && r || Array.isArray(r) && r[m] || w(l, v.BAD_DELIMITERS) || l.indexOf(n) > -1 || l.charAt(0) === " " || l.charAt(l.length - 1) === " " ? c + l + c : l);
|
|
1065
1065
|
}
|
|
1066
1066
|
function w(l, m) {
|
|
1067
1067
|
for (let C = 0; C < m.length; C++)
|
|
@@ -1074,7 +1074,7 @@ function yt(t) {
|
|
|
1074
1074
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1075
1075
|
}
|
|
1076
1076
|
const $ = {
|
|
1077
|
-
...
|
|
1077
|
+
...v,
|
|
1078
1078
|
parse: ft,
|
|
1079
1079
|
unparse: wt,
|
|
1080
1080
|
ChunkStreamer: ye,
|
|
@@ -1294,7 +1294,7 @@ function Rt(t, e) {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
1297
|
-
var ne = {},
|
|
1297
|
+
var ne = {}, P = {}, z = 34, N = 10, Q = 13;
|
|
1298
1298
|
function Se(t) {
|
|
1299
1299
|
return new Function("d", "return {" + t.map(function(e, r) {
|
|
1300
1300
|
return JSON.stringify(e) + ": d[" + r + '] || ""';
|
|
@@ -1337,12 +1337,12 @@ function Dt(t) {
|
|
|
1337
1337
|
function n(i, d) {
|
|
1338
1338
|
var g = [], w = i.length, l = 0, m = 0, C, T = w <= 0, y = !1;
|
|
1339
1339
|
i.charCodeAt(w - 1) === N && --w, i.charCodeAt(w - 1) === Q && --w;
|
|
1340
|
-
function
|
|
1341
|
-
if (T) return
|
|
1340
|
+
function F() {
|
|
1341
|
+
if (T) return P;
|
|
1342
1342
|
if (y) return y = !1, ne;
|
|
1343
1343
|
var k, A = l, _;
|
|
1344
|
-
if (i.charCodeAt(A) ===
|
|
1345
|
-
for (; l++ < w && i.charCodeAt(l) !==
|
|
1344
|
+
if (i.charCodeAt(A) === z) {
|
|
1345
|
+
for (; l++ < w && i.charCodeAt(l) !== z || i.charCodeAt(++l) === z; ) ;
|
|
1346
1346
|
return (k = l) >= w ? T = !0 : (_ = i.charCodeAt(l++)) === N ? y = !0 : _ === Q && (y = !0, i.charCodeAt(l) === N && ++l), i.slice(A + 1, k - 1).replace(/""/g, '"');
|
|
1347
1347
|
}
|
|
1348
1348
|
for (; l < w; ) {
|
|
@@ -1354,8 +1354,8 @@ function Dt(t) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
return T = !0, i.slice(A, w);
|
|
1356
1356
|
}
|
|
1357
|
-
for (; (C =
|
|
1358
|
-
for (var p = []; C !== ne && C !==
|
|
1357
|
+
for (; (C = F()) !== P; ) {
|
|
1358
|
+
for (var p = []; C !== ne && C !== P; ) p.push(C), C = F();
|
|
1359
1359
|
d && (p = d(p, m++)) == null || g.push(p);
|
|
1360
1360
|
}
|
|
1361
1361
|
return g;
|
|
@@ -1405,14 +1405,14 @@ function ae(t, e = { csv: { useDisplayNames: !0 } }) {
|
|
|
1405
1405
|
const f = [];
|
|
1406
1406
|
for (let o = 0; o < fe(t); ++o) {
|
|
1407
1407
|
const u = h[o];
|
|
1408
|
-
f[o] =
|
|
1408
|
+
f[o] = Ft(u);
|
|
1409
1409
|
}
|
|
1410
1410
|
a.push(f);
|
|
1411
1411
|
}
|
|
1412
1412
|
const c = a.map((h) => h.map((f) => f === null ? "" : f));
|
|
1413
1413
|
return kt(c);
|
|
1414
1414
|
}
|
|
1415
|
-
const
|
|
1415
|
+
const Ft = (t) => t == null ? null : t instanceof Date ? t.toISOString() : typeof t == "object" ? JSON.stringify(t) : String(t), Ut = {
|
|
1416
1416
|
...Ce,
|
|
1417
1417
|
version: "latest",
|
|
1418
1418
|
options: {
|
|
@@ -1429,13 +1429,13 @@ const vt = (t) => t == null ? null : t instanceof Date ? t.toISOString() : typeo
|
|
|
1429
1429
|
batchType: null,
|
|
1430
1430
|
parse: async (t, e) => oe(new TextDecoder().decode(t), e),
|
|
1431
1431
|
parseText: (t, e) => oe(t, e),
|
|
1432
|
-
parseInBatches:
|
|
1432
|
+
parseInBatches: vt
|
|
1433
1433
|
};
|
|
1434
1434
|
async function oe(t, e) {
|
|
1435
1435
|
const r = await U.parseText(t, e);
|
|
1436
1436
|
return L(r, "arrow-table");
|
|
1437
1437
|
}
|
|
1438
|
-
function
|
|
1438
|
+
function vt(t, e) {
|
|
1439
1439
|
const r = U.parseInBatches(t, e);
|
|
1440
1440
|
return rt(r, "arrow-table");
|
|
1441
1441
|
}
|
package/dist/layer-registry.d.ts
CHANGED
|
@@ -150,6 +150,7 @@ export declare function registerLayer(schema: Omit<LayerSchema, "tier"> & {
|
|
|
150
150
|
export declare function ensureLayerClass(schema: LayerSchema): Promise<void> | null;
|
|
151
151
|
export declare function getLayerSchema(type: string): LayerSchema | undefined;
|
|
152
152
|
export declare function getAllLayerSchemas(): ReadonlyMap<string, LayerSchema>;
|
|
153
|
+
export declare const UNDECLARED_DECK_PROPS: Readonly<Record<string, readonly PropDescriptor[]>>;
|
|
153
154
|
/**
|
|
154
155
|
* The ONE opt-out predicate for the scene-wide per-layer attributes declared
|
|
155
156
|
* above (issue: three call sites each accepted a different value set —
|