@loaders.gl/arrow 4.2.0-alpha.5 → 4.2.0-alpha.6
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/arrow-loader.js +1 -1
- package/dist/arrow-worker.js +4 -2
- package/dist/arrow-writer.js +1 -1
- package/dist/dist.dev.js +95 -62
- package/dist/dist.min.js +5 -5
- package/dist/geoarrow-writer.js +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +2 -2
- package/dist/lib/arrow-table-batch.js +1 -0
- package/dist/triangulate-on-worker.js +1 -1
- package/dist/triangulation-worker.js +6 -1
- package/package.json +7 -6
package/dist/arrow-loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { parseArrowSync } from "./parsers/parse-arrow-sync.js";
|
|
|
5
5
|
import { parseArrowInBatches } from "./parsers/parse-arrow-in-batches.js";
|
|
6
6
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
7
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
-
const VERSION = typeof "4.2.0-alpha.
|
|
8
|
+
const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
|
|
9
9
|
/** ArrowJS table loader */
|
|
10
10
|
export const ArrowWorkerLoader = {
|
|
11
11
|
name: 'Apache Arrow',
|
package/dist/arrow-worker.js
CHANGED
|
@@ -65,7 +65,9 @@
|
|
|
65
65
|
}
|
|
66
66
|
getParentPort().then((parentPort2) => {
|
|
67
67
|
if (parentPort2) {
|
|
68
|
-
parentPort2.on("message",
|
|
68
|
+
parentPort2.on("message", (message) => {
|
|
69
|
+
handleMessage(message);
|
|
70
|
+
});
|
|
69
71
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
70
72
|
} else {
|
|
71
73
|
globalThis.onmessage = handleMessage;
|
|
@@ -12497,7 +12499,7 @@ return true;`);
|
|
|
12497
12499
|
}
|
|
12498
12500
|
|
|
12499
12501
|
// src/arrow-loader.ts
|
|
12500
|
-
var VERSION = true ? "4.2.0-alpha.
|
|
12502
|
+
var VERSION = true ? "4.2.0-alpha.5" : "latest";
|
|
12501
12503
|
var ArrowWorkerLoader = {
|
|
12502
12504
|
name: "Apache Arrow",
|
|
12503
12505
|
id: "arrow",
|
package/dist/arrow-writer.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { encodeArrowSync } from "./lib/encode-arrow.js";
|
|
3
3
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
4
4
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
5
|
-
const VERSION = typeof "4.2.0-alpha.
|
|
5
|
+
const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
|
|
6
6
|
/** Apache Arrow writer */
|
|
7
7
|
export const ArrowWriter = {
|
|
8
8
|
name: 'Apache Arrow',
|
package/dist/dist.dev.js
CHANGED
|
@@ -12,6 +12,7 @@ var __exports__ = (() => {
|
|
|
12
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
13
|
var __getProtoOf = Object.getPrototypeOf;
|
|
14
14
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
16
|
var __commonJS = (cb, mod) => function __require() {
|
|
16
17
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
18
|
};
|
|
@@ -37,6 +38,10 @@ var __exports__ = (() => {
|
|
|
37
38
|
mod
|
|
38
39
|
));
|
|
39
40
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
|
+
var __publicField = (obj, key, value) => {
|
|
42
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
43
|
+
return value;
|
|
44
|
+
};
|
|
40
45
|
|
|
41
46
|
// external-global-plugin:@loaders.gl/core
|
|
42
47
|
var require_core = __commonJS({
|
|
@@ -80,11 +85,14 @@ var __exports__ = (() => {
|
|
|
80
85
|
// ../schema/src/lib/table/batches/base-table-batch-aggregator.ts
|
|
81
86
|
var DEFAULT_ROW_COUNT = 100;
|
|
82
87
|
var BaseTableBatchAggregator = class {
|
|
88
|
+
schema;
|
|
89
|
+
options;
|
|
90
|
+
shape;
|
|
91
|
+
length = 0;
|
|
92
|
+
rows = null;
|
|
93
|
+
cursor = 0;
|
|
94
|
+
_headers = [];
|
|
83
95
|
constructor(schema, options) {
|
|
84
|
-
this.length = 0;
|
|
85
|
-
this.rows = null;
|
|
86
|
-
this.cursor = 0;
|
|
87
|
-
this._headers = [];
|
|
88
96
|
this.options = options;
|
|
89
97
|
this.schema = schema;
|
|
90
98
|
if (!Array.isArray(schema)) {
|
|
@@ -180,12 +188,14 @@ var __exports__ = (() => {
|
|
|
180
188
|
// ../schema/src/lib/table/batches/row-table-batch-aggregator.ts
|
|
181
189
|
var DEFAULT_ROW_COUNT2 = 100;
|
|
182
190
|
var RowTableBatchAggregator = class {
|
|
191
|
+
schema;
|
|
192
|
+
options;
|
|
193
|
+
length = 0;
|
|
194
|
+
objectRows = null;
|
|
195
|
+
arrayRows = null;
|
|
196
|
+
cursor = 0;
|
|
197
|
+
_headers = null;
|
|
183
198
|
constructor(schema, options) {
|
|
184
|
-
this.length = 0;
|
|
185
|
-
this.objectRows = null;
|
|
186
|
-
this.arrayRows = null;
|
|
187
|
-
this.cursor = 0;
|
|
188
|
-
this._headers = null;
|
|
189
199
|
this.options = options;
|
|
190
200
|
this.schema = schema;
|
|
191
201
|
if (schema) {
|
|
@@ -255,10 +265,11 @@ var __exports__ = (() => {
|
|
|
255
265
|
// ../schema/src/lib/table/batches/columnar-table-batch-aggregator.ts
|
|
256
266
|
var DEFAULT_ROW_COUNT3 = 100;
|
|
257
267
|
var ColumnarTableBatchAggregator = class {
|
|
268
|
+
schema;
|
|
269
|
+
length = 0;
|
|
270
|
+
allocated = 0;
|
|
271
|
+
columns = {};
|
|
258
272
|
constructor(schema, options) {
|
|
259
|
-
this.length = 0;
|
|
260
|
-
this.allocated = 0;
|
|
261
|
-
this.columns = {};
|
|
262
273
|
this.schema = schema;
|
|
263
274
|
this._reallocateColumns();
|
|
264
275
|
}
|
|
@@ -338,16 +349,18 @@ var __exports__ = (() => {
|
|
|
338
349
|
_limitMB: 0
|
|
339
350
|
};
|
|
340
351
|
var ERR_MESSAGE = "TableBatchBuilder";
|
|
341
|
-
var
|
|
352
|
+
var _TableBatchBuilder = class {
|
|
353
|
+
schema;
|
|
354
|
+
options;
|
|
355
|
+
aggregator = null;
|
|
356
|
+
batchCount = 0;
|
|
357
|
+
bytesUsed = 0;
|
|
358
|
+
isChunkComplete = false;
|
|
359
|
+
lastBatchEmittedMs = Date.now();
|
|
360
|
+
totalLength = 0;
|
|
361
|
+
totalBytes = 0;
|
|
362
|
+
rowBytes = 0;
|
|
342
363
|
constructor(schema, options) {
|
|
343
|
-
this.aggregator = null;
|
|
344
|
-
this.batchCount = 0;
|
|
345
|
-
this.bytesUsed = 0;
|
|
346
|
-
this.isChunkComplete = false;
|
|
347
|
-
this.lastBatchEmittedMs = Date.now();
|
|
348
|
-
this.totalLength = 0;
|
|
349
|
-
this.totalBytes = 0;
|
|
350
|
-
this.rowBytes = 0;
|
|
351
364
|
this.schema = schema;
|
|
352
365
|
this.options = { ...DEFAULT_OPTIONS, ...options };
|
|
353
366
|
}
|
|
@@ -454,15 +467,17 @@ var __exports__ = (() => {
|
|
|
454
467
|
case "columnar-table":
|
|
455
468
|
return ColumnarTableBatchAggregator;
|
|
456
469
|
case "arrow-table":
|
|
457
|
-
if (!
|
|
470
|
+
if (!_TableBatchBuilder.ArrowBatch) {
|
|
458
471
|
throw new Error(ERR_MESSAGE);
|
|
459
472
|
}
|
|
460
|
-
return
|
|
473
|
+
return _TableBatchBuilder.ArrowBatch;
|
|
461
474
|
default:
|
|
462
475
|
return BaseTableBatchAggregator;
|
|
463
476
|
}
|
|
464
477
|
}
|
|
465
478
|
};
|
|
479
|
+
var TableBatchBuilder = _TableBatchBuilder;
|
|
480
|
+
__publicField(TableBatchBuilder, "ArrowBatch");
|
|
466
481
|
|
|
467
482
|
// ../schema/src/lib/table/simple-table/table-accessors.ts
|
|
468
483
|
function getTableLength(table) {
|
|
@@ -12685,6 +12700,7 @@ return true;`);
|
|
|
12685
12700
|
|
|
12686
12701
|
// src/lib/arrow-table-batch.ts
|
|
12687
12702
|
var ArrowTableBatchAggregator = class extends ColumnarTableBatchAggregator {
|
|
12703
|
+
arrowSchema;
|
|
12688
12704
|
constructor(schema, options) {
|
|
12689
12705
|
super(schema, options);
|
|
12690
12706
|
this.arrowSchema = null;
|
|
@@ -14814,8 +14830,8 @@ return true;`);
|
|
|
14814
14830
|
return {
|
|
14815
14831
|
type: "Polygon",
|
|
14816
14832
|
positions: { value: concatenatedPositions, size: dimension },
|
|
14817
|
-
polygonIndices: { value: new
|
|
14818
|
-
primitivePolygonIndices: { value: new
|
|
14833
|
+
polygonIndices: { value: new Uint32Array(polygonIndices), size: 1 },
|
|
14834
|
+
primitivePolygonIndices: { value: new Uint32Array(primitivePolygonIndices), size: 1 }
|
|
14819
14835
|
};
|
|
14820
14836
|
}
|
|
14821
14837
|
function concatTypedArrays(arrays) {
|
|
@@ -15097,12 +15113,16 @@ return true;`);
|
|
|
15097
15113
|
|
|
15098
15114
|
// ../worker-utils/src/lib/worker-farm/worker-job.ts
|
|
15099
15115
|
var WorkerJob = class {
|
|
15116
|
+
name;
|
|
15117
|
+
workerThread;
|
|
15118
|
+
isRunning = true;
|
|
15119
|
+
/** Promise that resolves when Job is done */
|
|
15120
|
+
result;
|
|
15121
|
+
_resolve = () => {
|
|
15122
|
+
};
|
|
15123
|
+
_reject = () => {
|
|
15124
|
+
};
|
|
15100
15125
|
constructor(jobName, workerThread) {
|
|
15101
|
-
this.isRunning = true;
|
|
15102
|
-
this._resolve = () => {
|
|
15103
|
-
};
|
|
15104
|
-
this._reject = () => {
|
|
15105
|
-
};
|
|
15106
15126
|
this.name = jobName;
|
|
15107
15127
|
this.workerThread = workerThread;
|
|
15108
15128
|
this.result = new Promise((resolve, reject) => {
|
|
@@ -15239,9 +15259,19 @@ return true;`);
|
|
|
15239
15259
|
var NOOP = () => {
|
|
15240
15260
|
};
|
|
15241
15261
|
var WorkerThread = class {
|
|
15262
|
+
name;
|
|
15263
|
+
source;
|
|
15264
|
+
url;
|
|
15265
|
+
terminated = false;
|
|
15266
|
+
worker;
|
|
15267
|
+
onMessage;
|
|
15268
|
+
onError;
|
|
15269
|
+
_loadableURL = "";
|
|
15270
|
+
/** Checks if workers are supported on this platform */
|
|
15271
|
+
static isSupported() {
|
|
15272
|
+
return typeof Worker !== "undefined" && isBrowser || typeof NodeWorker !== "undefined" && !isBrowser;
|
|
15273
|
+
}
|
|
15242
15274
|
constructor(props) {
|
|
15243
|
-
this.terminated = false;
|
|
15244
|
-
this._loadableURL = "";
|
|
15245
15275
|
const { name, source, url } = props;
|
|
15246
15276
|
assert(source || url);
|
|
15247
15277
|
this.name = name;
|
|
@@ -15251,10 +15281,6 @@ return true;`);
|
|
|
15251
15281
|
this.onError = (error) => console.log(error);
|
|
15252
15282
|
this.worker = isBrowser ? this._createBrowserWorker() : this._createNodeWorker();
|
|
15253
15283
|
}
|
|
15254
|
-
/** Checks if workers are supported on this platform */
|
|
15255
|
-
static isSupported() {
|
|
15256
|
-
return typeof Worker !== "undefined" && isBrowser || typeof NodeWorker !== "undefined" && !isBrowser;
|
|
15257
|
-
}
|
|
15258
15284
|
/**
|
|
15259
15285
|
* Terminate this worker thread
|
|
15260
15286
|
* @note Can free up significant memory
|
|
@@ -15342,30 +15368,33 @@ return true;`);
|
|
|
15342
15368
|
|
|
15343
15369
|
// ../worker-utils/src/lib/worker-farm/worker-pool.ts
|
|
15344
15370
|
var WorkerPool = class {
|
|
15371
|
+
name = "unnamed";
|
|
15372
|
+
source;
|
|
15373
|
+
// | Function;
|
|
15374
|
+
url;
|
|
15375
|
+
maxConcurrency = 1;
|
|
15376
|
+
maxMobileConcurrency = 1;
|
|
15377
|
+
onDebug = () => {
|
|
15378
|
+
};
|
|
15379
|
+
reuseWorkers = true;
|
|
15380
|
+
props = {};
|
|
15381
|
+
jobQueue = [];
|
|
15382
|
+
idleQueue = [];
|
|
15383
|
+
count = 0;
|
|
15384
|
+
isDestroyed = false;
|
|
15385
|
+
/** Checks if workers are supported on this platform */
|
|
15386
|
+
static isSupported() {
|
|
15387
|
+
return WorkerThread.isSupported();
|
|
15388
|
+
}
|
|
15345
15389
|
/**
|
|
15346
15390
|
* @param processor - worker function
|
|
15347
15391
|
* @param maxConcurrency - max count of workers
|
|
15348
15392
|
*/
|
|
15349
15393
|
constructor(props) {
|
|
15350
|
-
this.name = "unnamed";
|
|
15351
|
-
this.maxConcurrency = 1;
|
|
15352
|
-
this.maxMobileConcurrency = 1;
|
|
15353
|
-
this.onDebug = () => {
|
|
15354
|
-
};
|
|
15355
|
-
this.reuseWorkers = true;
|
|
15356
|
-
this.props = {};
|
|
15357
|
-
this.jobQueue = [];
|
|
15358
|
-
this.idleQueue = [];
|
|
15359
|
-
this.count = 0;
|
|
15360
|
-
this.isDestroyed = false;
|
|
15361
15394
|
this.source = props.source;
|
|
15362
15395
|
this.url = props.url;
|
|
15363
15396
|
this.setProps(props);
|
|
15364
15397
|
}
|
|
15365
|
-
/** Checks if workers are supported on this platform */
|
|
15366
|
-
static isSupported() {
|
|
15367
|
-
return WorkerThread.isSupported();
|
|
15368
|
-
}
|
|
15369
15398
|
/**
|
|
15370
15399
|
* Terminates all workers in the pool
|
|
15371
15400
|
* @note Can free up significant memory
|
|
@@ -15488,23 +15517,24 @@ return true;`);
|
|
|
15488
15517
|
onDebug: () => {
|
|
15489
15518
|
}
|
|
15490
15519
|
};
|
|
15491
|
-
var
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
this.workerPools = /* @__PURE__ */ new Map();
|
|
15495
|
-
this.props = { ...DEFAULT_PROPS };
|
|
15496
|
-
this.setProps(props);
|
|
15497
|
-
this.workerPools = /* @__PURE__ */ new Map();
|
|
15498
|
-
}
|
|
15520
|
+
var _WorkerFarm = class {
|
|
15521
|
+
props;
|
|
15522
|
+
workerPools = /* @__PURE__ */ new Map();
|
|
15499
15523
|
/** Checks if workers are supported on this platform */
|
|
15500
15524
|
static isSupported() {
|
|
15501
15525
|
return WorkerThread.isSupported();
|
|
15502
15526
|
}
|
|
15503
15527
|
/** Get the singleton instance of the global worker farm */
|
|
15504
15528
|
static getWorkerFarm(props = {}) {
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
return
|
|
15529
|
+
_WorkerFarm._workerFarm = _WorkerFarm._workerFarm || new _WorkerFarm({});
|
|
15530
|
+
_WorkerFarm._workerFarm.setProps(props);
|
|
15531
|
+
return _WorkerFarm._workerFarm;
|
|
15532
|
+
}
|
|
15533
|
+
/** get global instance with WorkerFarm.getWorkerFarm() */
|
|
15534
|
+
constructor(props) {
|
|
15535
|
+
this.props = { ...DEFAULT_PROPS };
|
|
15536
|
+
this.setProps(props);
|
|
15537
|
+
this.workerPools = /* @__PURE__ */ new Map();
|
|
15508
15538
|
}
|
|
15509
15539
|
/**
|
|
15510
15540
|
* Terminate all workers in the farm
|
|
@@ -15558,6 +15588,9 @@ return true;`);
|
|
|
15558
15588
|
};
|
|
15559
15589
|
}
|
|
15560
15590
|
};
|
|
15591
|
+
var WorkerFarm = _WorkerFarm;
|
|
15592
|
+
// singleton
|
|
15593
|
+
__publicField(WorkerFarm, "_workerFarm");
|
|
15561
15594
|
|
|
15562
15595
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
15563
15596
|
function getWorkerName(worker) {
|