@loaders.gl/schema 4.2.0-alpha.4 → 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/dist.dev.js +216 -147
- package/dist/dist.min.js +9 -0
- package/dist/index.cjs +128 -97
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +30 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/lib/mesh/convert-mesh.d.ts +2 -2
- package/dist/lib/mesh/convert-mesh.d.ts.map +1 -1
- package/dist/lib/mesh/convert-mesh.js +33 -18
- package/dist/lib/mesh/deduce-mesh-schema.d.ts +2 -2
- package/dist/lib/mesh/deduce-mesh-schema.d.ts.map +1 -1
- package/dist/lib/mesh/deduce-mesh-schema.js +54 -40
- package/dist/lib/mesh/mesh-to-arrow-table.js +46 -1
- package/dist/lib/mesh/mesh-utils.d.ts +2 -2
- package/dist/lib/mesh/mesh-utils.d.ts.map +1 -1
- package/dist/lib/mesh/mesh-utils.js +41 -28
- package/dist/lib/table/arrow-api/arrow-like-field.d.ts +1 -1
- package/dist/lib/table/arrow-api/arrow-like-field.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-field.js +34 -25
- package/dist/lib/table/arrow-api/arrow-like-schema.d.ts +2 -2
- package/dist/lib/table/arrow-api/arrow-like-schema.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-schema.js +71 -56
- package/dist/lib/table/arrow-api/arrow-like-table.d.ts +2 -2
- package/dist/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-table.js +57 -45
- package/dist/lib/table/arrow-api/arrow-like-type.d.ts +3 -3
- package/dist/lib/table/arrow-api/arrow-like-type.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-type.js +371 -321
- package/dist/lib/table/arrow-api/enum.js +97 -48
- package/dist/lib/table/arrow-api/get-type-info.d.ts +1 -1
- package/dist/lib/table/arrow-api/get-type-info.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/get-type-info.js +20 -14
- package/dist/lib/table/arrow-api/index.d.ts +4 -4
- package/dist/lib/table/arrow-api/index.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/index.js +3 -1
- package/dist/lib/table/batches/base-table-batch-aggregator.d.ts +3 -3
- package/dist/lib/table/batches/base-table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/table/batches/base-table-batch-aggregator.js +56 -52
- package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts +3 -3
- package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/table/batches/columnar-table-batch-aggregator.js +82 -67
- package/dist/lib/table/batches/row-table-batch-aggregator.d.ts +3 -3
- package/dist/lib/table/batches/row-table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/table/batches/row-table-batch-aggregator.js +76 -67
- package/dist/lib/table/batches/table-batch-aggregator.d.ts +2 -2
- package/dist/lib/table/batches/table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/table/batches/table-batch-aggregator.js +3 -1
- package/dist/lib/table/batches/table-batch-builder.d.ts +3 -3
- package/dist/lib/table/batches/table-batch-builder.d.ts.map +1 -1
- package/dist/lib/table/batches/table-batch-builder.js +131 -116
- package/dist/lib/table/simple-table/convert-table.d.ts +1 -1
- package/dist/lib/table/simple-table/convert-table.d.ts.map +1 -1
- package/dist/lib/table/simple-table/convert-table.js +97 -62
- package/dist/lib/table/simple-table/data-type.d.ts +2 -2
- package/dist/lib/table/simple-table/data-type.d.ts.map +1 -1
- package/dist/lib/table/simple-table/data-type.js +79 -76
- package/dist/lib/table/simple-table/make-table-from-batches.js +70 -67
- package/dist/lib/table/simple-table/make-table.d.ts +1 -1
- package/dist/lib/table/simple-table/make-table.d.ts.map +1 -1
- package/dist/lib/table/simple-table/make-table.js +85 -41
- package/dist/lib/table/simple-table/row-utils.js +38 -31
- package/dist/lib/table/simple-table/table-accessors.d.ts +1 -1
- package/dist/lib/table/simple-table/table-accessors.d.ts.map +1 -1
- package/dist/lib/table/simple-table/table-accessors.js +314 -270
- package/dist/lib/table/simple-table/table-column.d.ts +1 -1
- package/dist/lib/table/simple-table/table-column.d.ts.map +1 -1
- package/dist/lib/table/simple-table/table-column.js +36 -3
- package/dist/lib/table/simple-table/table-schema.d.ts +2 -2
- package/dist/lib/table/simple-table/table-schema.d.ts.map +1 -1
- package/dist/lib/table/simple-table/table-schema.js +69 -56
- package/dist/lib/utils/assert.js +6 -4
- package/dist/lib/utils/async-queue.js +79 -82
- package/dist/types/batch.d.ts +1 -1
- package/dist/types/batch.d.ts.map +1 -1
- package/dist/types/batch.js +3 -1
- package/dist/types/binary-geometries.d.ts +1 -1
- package/dist/types/binary-geometries.d.ts.map +1 -1
- package/dist/types/binary-geometries.js +3 -1
- package/dist/types/category-gis.d.ts +2 -2
- package/dist/types/category-gis.d.ts.map +1 -1
- package/dist/types/category-gis.js +3 -1
- package/dist/types/category-image.js +3 -1
- package/dist/types/category-mesh.d.ts +3 -3
- package/dist/types/category-mesh.d.ts.map +1 -1
- package/dist/types/category-mesh.js +3 -1
- package/dist/types/category-table.d.ts +3 -3
- package/dist/types/category-table.d.ts.map +1 -1
- package/dist/types/category-table.js +3 -1
- package/dist/types/category-texture.d.ts +1 -1
- package/dist/types/category-texture.d.ts.map +1 -1
- package/dist/types/category-texture.js +3 -1
- package/dist/types/flat-geometries.js +3 -1
- package/dist/types/schema.js +3 -1
- package/dist/types/types.js +3 -1
- package/package.json +8 -4
- package/src/index.ts +1 -1
- package/src/lib/table/arrow-api/arrow-like-field.ts +2 -2
- package/src/lib/table/arrow-api/arrow-like-type.ts +4 -2
- package/dist/index.js.map +0 -1
- package/dist/lib/mesh/convert-mesh.js.map +0 -1
- package/dist/lib/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/lib/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/lib/mesh/mesh-utils.js.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-field.js.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-schema.js.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-table.js.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-type.js.map +0 -1
- package/dist/lib/table/arrow-api/enum.js.map +0 -1
- package/dist/lib/table/arrow-api/get-type-info.js.map +0 -1
- package/dist/lib/table/arrow-api/index.js.map +0 -1
- package/dist/lib/table/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/lib/table/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/lib/table/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/lib/table/batches/table-batch-aggregator.js.map +0 -1
- package/dist/lib/table/batches/table-batch-builder.js.map +0 -1
- package/dist/lib/table/simple-table/convert-table.js.map +0 -1
- package/dist/lib/table/simple-table/data-type.js.map +0 -1
- package/dist/lib/table/simple-table/make-table-from-batches.js.map +0 -1
- package/dist/lib/table/simple-table/make-table.js.map +0 -1
- package/dist/lib/table/simple-table/row-utils.js.map +0 -1
- package/dist/lib/table/simple-table/table-accessors.js.map +0 -1
- package/dist/lib/table/simple-table/table-column.js.map +0 -1
- package/dist/lib/table/simple-table/table-schema.js.map +0 -1
- package/dist/lib/utils/assert.js.map +0 -1
- package/dist/lib/utils/async-queue.js.map +0 -1
- package/dist/types/batch.js.map +0 -1
- package/dist/types/binary-geometries.js.map +0 -1
- package/dist/types/category-gis.js.map +0 -1
- package/dist/types/category-image.js.map +0 -1
- package/dist/types/category-mesh.js.map +0 -1
- package/dist/types/category-table.js.map +0 -1
- package/dist/types/category-texture.js.map +0 -1
- package/dist/types/flat-geometries.js.map +0 -1
- package/dist/types/schema.js.map +0 -1
- package/dist/types/types.js.map +0 -1
|
@@ -1,6 +1,39 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
1
4
|
import { getArrayTypeFromDataType } from "./data-type.js";
|
|
2
5
|
export function makeColumnFromField(field, length) {
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
const ArrayType = getArrayTypeFromDataType(field.type, field.nullable);
|
|
7
|
+
return new ArrayType(length);
|
|
5
8
|
}
|
|
6
|
-
|
|
9
|
+
/*
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
|
+
function deduceSchema(rows) {
|
|
12
|
+
const row = rows[0];
|
|
13
|
+
|
|
14
|
+
const schema = {};
|
|
15
|
+
let i = 0;
|
|
16
|
+
for (const columnName in row) {
|
|
17
|
+
const value = row[columnName];
|
|
18
|
+
switch (typeof value) {
|
|
19
|
+
case 'number':
|
|
20
|
+
case 'boolean':
|
|
21
|
+
// TODO - booleans could be handled differently...
|
|
22
|
+
schema[columnName] = {name: String(columnName), index: i, type: Float32Array};
|
|
23
|
+
break;
|
|
24
|
+
|
|
25
|
+
case 'object':
|
|
26
|
+
schema[columnName] = {name: String(columnName), index: i, type: Array};
|
|
27
|
+
break;
|
|
28
|
+
|
|
29
|
+
case 'string':
|
|
30
|
+
default:
|
|
31
|
+
schema[columnName] = {name: String(columnName), index: i, type: Array};
|
|
32
|
+
// We currently only handle numeric rows
|
|
33
|
+
// TODO we could offer a function to map strings to numbers?
|
|
34
|
+
}
|
|
35
|
+
i++;
|
|
36
|
+
}
|
|
37
|
+
return schema;
|
|
38
|
+
}
|
|
39
|
+
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Schema } from
|
|
2
|
-
import { Table } from
|
|
1
|
+
import { Schema } from "../../../types/schema.js";
|
|
2
|
+
import { Table } from "../../../types/category-table.js";
|
|
3
3
|
/**
|
|
4
4
|
* SCHEMA SUPPORT - AUTODEDUCTION
|
|
5
5
|
* @param {*} table
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/table-schema.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAQ,
|
|
1
|
+
{"version":3,"file":"table-schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/table-schema.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAQ,iCAA8B;AAEpD,OAAO,EAAC,KAAK,EAAC,yCAAsC;AAGpD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAatD;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EAAE,EAAE,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,EAAE,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;CAAC,GAC1E,MAAM,CAER"}
|
|
@@ -1,70 +1,83 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
1
4
|
import { getDataTypeFromArray, getDataTypeFromValue } from "./data-type.js";
|
|
5
|
+
/**
|
|
6
|
+
* SCHEMA SUPPORT - AUTODEDUCTION
|
|
7
|
+
* @param {*} table
|
|
8
|
+
* @param {*} schema
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
2
11
|
export function deduceTableSchema(table) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
switch (table.shape) {
|
|
13
|
+
case 'array-row-table':
|
|
14
|
+
case 'object-row-table':
|
|
15
|
+
return deduceSchemaFromRows(table.data);
|
|
16
|
+
case 'columnar-table':
|
|
17
|
+
return deduceSchemaFromColumns(table.data);
|
|
18
|
+
case 'arrow-table':
|
|
19
|
+
default:
|
|
20
|
+
throw new Error('Deduce schema');
|
|
21
|
+
}
|
|
13
22
|
}
|
|
14
23
|
export function deduceSchema(data) {
|
|
15
|
-
|
|
24
|
+
return Array.isArray(data) ? deduceSchemaFromRows(data) : deduceSchemaFromColumns(data);
|
|
16
25
|
}
|
|
26
|
+
/** Given an object with columnar arrays, try to deduce a schema */
|
|
17
27
|
function deduceSchemaFromColumns(columnarTable) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
fields,
|
|
25
|
-
metadata: {}
|
|
26
|
-
};
|
|
28
|
+
const fields = [];
|
|
29
|
+
for (const [columnName, column] of Object.entries(columnarTable)) {
|
|
30
|
+
const field = deduceFieldFromColumn(column, columnName);
|
|
31
|
+
fields.push(field);
|
|
32
|
+
}
|
|
33
|
+
return { fields, metadata: {} };
|
|
27
34
|
}
|
|
35
|
+
/** Given an array of rows, try to deduce a schema */
|
|
28
36
|
function deduceSchemaFromRows(rowTable) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
if (!rowTable.length) {
|
|
38
|
+
throw new Error('deduce from empty table');
|
|
39
|
+
}
|
|
40
|
+
const fields = [];
|
|
41
|
+
const row0 = rowTable[0];
|
|
42
|
+
// TODO - fields can be nullable, false detection...
|
|
43
|
+
// Could look at additional rows if nulls in first row
|
|
44
|
+
// TODO - if array, column names will be numbers
|
|
45
|
+
for (const [columnName, value] of Object.entries(row0)) {
|
|
46
|
+
fields.push(deduceFieldFromValue(value, columnName));
|
|
47
|
+
}
|
|
48
|
+
return { fields, metadata: {} };
|
|
41
49
|
}
|
|
50
|
+
/** Given a column (i.e. array), attempt to deduce an appropriate `Field` */
|
|
42
51
|
function deduceFieldFromColumn(column, name) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
if (ArrayBuffer.isView(column)) {
|
|
53
|
+
const type = getDataTypeFromArray(column);
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
type: type.type || 'null',
|
|
57
|
+
nullable: type.nullable
|
|
58
|
+
// metadata: {}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (Array.isArray(column) && column.length > 0) {
|
|
62
|
+
const value = column[0];
|
|
63
|
+
const type = getDataTypeFromValue(value);
|
|
64
|
+
// TODO - support nested schemas?
|
|
65
|
+
return {
|
|
66
|
+
name,
|
|
67
|
+
type,
|
|
68
|
+
nullable: true
|
|
69
|
+
// metadata: {},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
throw new Error('empty table');
|
|
73
|
+
}
|
|
74
|
+
/** Given a value, attempt to deduce an appropriate `Field` */
|
|
75
|
+
function deduceFieldFromValue(value, name) {
|
|
53
76
|
const type = getDataTypeFromValue(value);
|
|
54
77
|
return {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
78
|
+
name,
|
|
79
|
+
type,
|
|
80
|
+
nullable: true
|
|
81
|
+
// metadata: {}
|
|
58
82
|
};
|
|
59
|
-
}
|
|
60
|
-
throw new Error('empty table');
|
|
61
|
-
}
|
|
62
|
-
function deduceFieldFromValue(value, name) {
|
|
63
|
-
const type = getDataTypeFromValue(value);
|
|
64
|
-
return {
|
|
65
|
-
name,
|
|
66
|
-
type,
|
|
67
|
-
nullable: true
|
|
68
|
-
};
|
|
69
83
|
}
|
|
70
|
-
//# sourceMappingURL=table-schema.js.map
|
package/dist/lib/utils/assert.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
// Replacement for the external assert method to reduce bundle size
|
|
2
|
+
// Note: We don't use the second "message" argument in calling code,
|
|
3
|
+
// so no need to support it here
|
|
1
4
|
export function assert(condition, message) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
if (!condition) {
|
|
6
|
+
throw new Error(message || 'loader assertion failed.');
|
|
7
|
+
}
|
|
5
8
|
}
|
|
6
|
-
//# sourceMappingURL=assert.js.map
|
|
@@ -1,93 +1,90 @@
|
|
|
1
|
-
|
|
1
|
+
// From https://github.com/rauschma/async-iter-demo/tree/master/src under MIT license
|
|
2
|
+
// http://2ality.com/2016/10/asynchronous-iteration.html
|
|
2
3
|
class ArrayQueue extends Array {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
enqueue(value) {
|
|
5
|
+
// Add at the end
|
|
6
|
+
return this.push(value);
|
|
7
|
+
}
|
|
8
|
+
dequeue() {
|
|
9
|
+
// Remove first element
|
|
10
|
+
return this.shift();
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
|
-
_Symbol$asyncIterator = Symbol.asyncIterator;
|
|
11
13
|
export default class AsyncQueue {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
while (this._settlers.length > 0) {
|
|
22
|
-
this._settlers.dequeue().resolve({
|
|
23
|
-
done: true
|
|
24
|
-
});
|
|
14
|
+
_values;
|
|
15
|
+
_settlers;
|
|
16
|
+
_closed;
|
|
17
|
+
constructor() {
|
|
18
|
+
// enqueues > dequeues
|
|
19
|
+
this._values = new ArrayQueue();
|
|
20
|
+
// dequeues > enqueues
|
|
21
|
+
this._settlers = new ArrayQueue();
|
|
22
|
+
this._closed = false;
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
enqueue(value) {
|
|
32
|
-
if (this._closed) {
|
|
33
|
-
throw new Error('Closed');
|
|
24
|
+
close() {
|
|
25
|
+
while (this._settlers.length > 0) {
|
|
26
|
+
this._settlers.dequeue().resolve({ done: true });
|
|
27
|
+
}
|
|
28
|
+
this._closed = true;
|
|
34
29
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
throw new Error('Illegal internal state');
|
|
38
|
-
}
|
|
39
|
-
const settler = this._settlers.dequeue();
|
|
40
|
-
if (value instanceof Error) {
|
|
41
|
-
settler.reject(value);
|
|
42
|
-
} else {
|
|
43
|
-
settler.resolve({
|
|
44
|
-
value
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
this._values.enqueue(value);
|
|
30
|
+
[Symbol.asyncIterator]() {
|
|
31
|
+
return this;
|
|
49
32
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
33
|
+
enqueue(value) {
|
|
34
|
+
if (this._closed) {
|
|
35
|
+
throw new Error('Closed');
|
|
36
|
+
}
|
|
37
|
+
if (this._settlers.length > 0) {
|
|
38
|
+
if (this._values.length > 0) {
|
|
39
|
+
throw new Error('Illegal internal state');
|
|
40
|
+
}
|
|
41
|
+
const settler = this._settlers.dequeue();
|
|
42
|
+
if (value instanceof Error) {
|
|
43
|
+
settler.reject(value);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
settler.resolve({ value });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this._values.enqueue(value);
|
|
51
|
+
}
|
|
60
52
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
/**
|
|
54
|
+
* @returns a Promise for an IteratorResult
|
|
55
|
+
*/
|
|
56
|
+
next() {
|
|
57
|
+
if (this._values.length > 0) {
|
|
58
|
+
const value = this._values.dequeue();
|
|
59
|
+
if (value instanceof Error) {
|
|
60
|
+
return Promise.reject(value);
|
|
61
|
+
}
|
|
62
|
+
return Promise.resolve({ value });
|
|
63
|
+
}
|
|
64
|
+
if (this._closed) {
|
|
65
|
+
if (this._settlers.length > 0) {
|
|
66
|
+
throw new Error('Illegal internal state');
|
|
67
|
+
}
|
|
68
|
+
return Promise.resolve({ done: true });
|
|
69
|
+
}
|
|
70
|
+
// Wait for new values to be enqueued
|
|
71
|
+
return new Promise((resolve, reject) => {
|
|
72
|
+
this._settlers.enqueue({ resolve, reject });
|
|
73
|
+
});
|
|
68
74
|
}
|
|
69
|
-
return new Promise((resolve, reject) => {
|
|
70
|
-
this._settlers.enqueue({
|
|
71
|
-
resolve,
|
|
72
|
-
reject
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
75
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
/**
|
|
77
|
+
* @returns a Promise for an Array with the elements in `asyncIterable`
|
|
78
|
+
*/
|
|
79
|
+
export async function takeAsync(asyncIterable, count = Infinity) {
|
|
80
|
+
const result = [];
|
|
81
|
+
const iterator = asyncIterable[Symbol.asyncIterator]();
|
|
82
|
+
while (result.length < count) {
|
|
83
|
+
const { value, done } = await iterator.next();
|
|
84
|
+
if (done) {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
result.push(value);
|
|
88
88
|
}
|
|
89
|
-
result
|
|
90
|
-
}
|
|
91
|
-
return result;
|
|
89
|
+
return result;
|
|
92
90
|
}
|
|
93
|
-
//# sourceMappingURL=async-queue.js.map
|
package/dist/types/batch.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/types/batch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,
|
|
1
|
+
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/types/batch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,oBAAiB;AAGhC,KAAK,iBAAiB,GAAG,OAAO,CAAC;AAEjC;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,iFAAiF;IACjF,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,cAAc,CAAC;IACnE,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yDAAyD;IACzD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IAEf,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,qBAAqB;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC"}
|
package/dist/types/batch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-geometries.d.ts","sourceRoot":"","sources":["../../src/types/binary-geometries.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,UAAU,EAAC,
|
|
1
|
+
{"version":3,"file":"binary-geometries.d.ts","sourceRoot":"","sources":["../../src/types/binary-geometries.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,UAAU,EAAC,mBAAgB;AAIxC,MAAM,MAAM,eAAe,GAAG;IAAC,KAAK,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAEpE,KAAK,YAA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;IACpC,KAAK,EAAE,2BAA2B,CAAC;IACnC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { GeoJSON, Feature, FeatureCollection, Geometry, Position, GeoJsonProperties } from 'geojson';
|
|
2
2
|
export type { Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection } from 'geojson';
|
|
3
|
-
export type { FlatGeometryType, FlatIndexedGeometry, FlatPoint, FlatLineString, FlatPolygon, FlatGeometry, FlatFeature } from
|
|
4
|
-
export type { BinaryAttribute, BinaryGeometryType, BinaryGeometry, BinaryPointGeometry, BinaryLineGeometry, BinaryPolygonGeometry, BinaryProperties, BinaryFeatureCollection, BinaryFeature, BinaryPointFeature, BinaryLineFeature, BinaryPolygonFeature } from
|
|
3
|
+
export type { FlatGeometryType, FlatIndexedGeometry, FlatPoint, FlatLineString, FlatPolygon, FlatGeometry, FlatFeature } from "./flat-geometries.js";
|
|
4
|
+
export type { BinaryAttribute, BinaryGeometryType, BinaryGeometry, BinaryPointGeometry, BinaryLineGeometry, BinaryPolygonGeometry, BinaryProperties, BinaryFeatureCollection, BinaryFeature, BinaryPointFeature, BinaryLineFeature, BinaryPolygonFeature } from "./binary-geometries.js";
|
|
5
5
|
/** Aggregate information for converting GeoJSON into other formats */
|
|
6
6
|
export type GeojsonGeometryInfo = {
|
|
7
7
|
coordLength: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-gis.d.ts","sourceRoot":"","sources":["../../src/types/category-gis.ts"],"names":[],"mappings":"AAOA,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,
|
|
1
|
+
{"version":3,"file":"category-gis.d.ts","sourceRoot":"","sources":["../../src/types/category-gis.ts"],"names":[],"mappings":"AAOA,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,6BAA0B;AAG3B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACrB,+BAA4B;AAE7B,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Schema } from
|
|
2
|
-
import type { TypedArray } from
|
|
3
|
-
import type { ColumnarTable, ArrowTable } from
|
|
1
|
+
import type { Schema } from "./schema.js";
|
|
2
|
+
import type { TypedArray } from "./types.js";
|
|
3
|
+
import type { ColumnarTable, ArrowTable } from "./category-table.js";
|
|
4
4
|
/** Mesh as columnar table */
|
|
5
5
|
export interface MeshTable extends ColumnarTable {
|
|
6
6
|
topology: 'point-list' | 'triangle-list' | 'triangle-strip';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-mesh.d.ts","sourceRoot":"","sources":["../../src/types/category-mesh.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,
|
|
1
|
+
{"version":3,"file":"category-mesh.d.ts","sourceRoot":"","sources":["../../src/types/category-mesh.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,oBAAiB;AACrC,OAAO,KAAK,EAAC,UAAU,EAAC,mBAAgB;AACxC,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU,EAAC,4BAAyB;AAEhE,6BAA6B;AAC7B,MAAM,WAAW,SAAU,SAAQ,aAAa;IAE9C,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,0BAA0B;AAC1B,MAAM,WAAW,cAAe,SAAQ,UAAU;IAEhD,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,0EAA0E;AAC1E,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE;QAAC,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAA;KAAC,CAAC;IACrD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,IAAI,GAAG,YAAY,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,CAAC;IAClC,MAAM,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;KACpC,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Schema } from
|
|
2
|
-
import type { Batch } from
|
|
3
|
-
import type { Feature } from
|
|
1
|
+
import type { Schema } from "./schema.js";
|
|
2
|
+
import type { Batch } from "./batch.js";
|
|
3
|
+
import type { Feature } from "./category-gis.js";
|
|
4
4
|
type ApacheArrowTable = unknown;
|
|
5
5
|
type ApacheRecordBatch = unknown;
|
|
6
6
|
/** A general table */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-table.d.ts","sourceRoot":"","sources":["../../src/types/category-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,
|
|
1
|
+
{"version":3,"file":"category-table.d.ts","sourceRoot":"","sources":["../../src/types/category-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,oBAAiB;AACrC,OAAO,KAAK,EAAC,KAAK,EAAC,mBAA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AC;CAChB,CAAC;AAEF,wFAAwF;AACxF,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG;IACvC,KAAK,EAAE,gBAAgB,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;KAAC,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG;IACpC,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-texture.d.ts","sourceRoot":"","sources":["../../src/types/category-texture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"category-texture.d.ts","sourceRoot":"","sources":["../../src/types/category-texture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAC,4BAAyB;AAEhD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,MAAM,CAAC;AAEX,oBAAoB;AACpB,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC"}
|
package/dist/types/schema.js
CHANGED
package/dist/types/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/schema",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.6",
|
|
4
4
|
"description": "Table format APIs for JSON, CSV, etc...",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,11 +36,15 @@
|
|
|
36
36
|
"README.md"
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
|
-
"pre-build": "npm run build-bundle && npm run build-bundle
|
|
40
|
-
"build-bundle": "ocular-bundle ./
|
|
39
|
+
"pre-build": "npm run build-bundle && npm run build-bundle-dev",
|
|
40
|
+
"build-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
|
|
41
|
+
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@types/geojson": "^7946.0.7"
|
|
44
45
|
},
|
|
45
|
-
"
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@loaders.gl/core": "^4.0.0"
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "37bd8ca71763529f18727ee4bf29dd176aa914ca"
|
|
46
50
|
}
|
package/src/index.ts
CHANGED
|
@@ -46,8 +46,8 @@ export class ArrowLikeField {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
toString(): string {
|
|
49
|
-
return `${this.type}${this.nullable ? ', nullable' : ''}${
|
|
50
|
-
this.metadata ? `, metadata: ${this.metadata}` : ''
|
|
49
|
+
return `${JSON.stringify(this.type)}${this.nullable ? ', nullable' : ''}${
|
|
50
|
+
this.metadata ? `, metadata: ${JSON.stringify(this.metadata)}` : ''
|
|
51
51
|
}`;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -476,7 +476,7 @@ export class FixedSizeList extends DataType {
|
|
|
476
476
|
return 'FixedSizeList';
|
|
477
477
|
}
|
|
478
478
|
toString(): string {
|
|
479
|
-
return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
|
|
479
|
+
return `FixedSizeList[${this.listSize}]<${JSON.stringify(this.valueType)}>`;
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
482
|
|
|
@@ -492,7 +492,9 @@ export class Struct extends DataType {
|
|
|
492
492
|
return Type.Struct;
|
|
493
493
|
}
|
|
494
494
|
public toString() {
|
|
495
|
-
return `Struct<{${this.children
|
|
495
|
+
return `Struct<{${this.children
|
|
496
|
+
.map((f) => `${f.name}:${JSON.stringify(f.type)}`)
|
|
497
|
+
.join(', ')}}>`;
|
|
496
498
|
}
|
|
497
499
|
get [Symbol.toStringTag](): string {
|
|
498
500
|
return 'Struct';
|