@loaders.gl/schema 4.0.0-beta.1 → 4.0.0-beta.3
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 +1745 -0
- package/dist/index.cjs +1692 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/{esm/lib → lib}/mesh/convert-mesh.js +1 -1
- package/dist/lib/mesh/convert-mesh.js.map +1 -0
- package/dist/{esm/lib → lib}/mesh/deduce-mesh-schema.js +1 -1
- package/dist/lib/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/lib/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/lib/mesh/mesh-utils.js.map +1 -0
- package/dist/{esm/lib → lib}/table/arrow-api/arrow-like-field.js +5 -6
- package/dist/lib/table/arrow-api/arrow-like-field.js.map +1 -0
- package/dist/{esm/lib → lib}/table/arrow-api/arrow-like-schema.js +3 -4
- package/dist/lib/table/arrow-api/arrow-like-schema.js.map +1 -0
- package/dist/{esm/lib → lib}/table/arrow-api/arrow-like-table.js +7 -8
- package/dist/lib/table/arrow-api/arrow-like-table.js.map +1 -0
- package/dist/lib/table/arrow-api/arrow-like-type.d.ts +1 -1
- package/dist/lib/table/arrow-api/arrow-like-type.d.ts.map +1 -1
- package/dist/{esm/lib → lib}/table/arrow-api/arrow-like-type.js +22 -23
- package/dist/lib/table/arrow-api/arrow-like-type.js.map +1 -0
- package/dist/lib/table/arrow-api/enum.js.map +1 -0
- package/dist/{esm/lib → lib}/table/arrow-api/get-type-info.js +1 -1
- package/dist/lib/table/arrow-api/get-type-info.js.map +1 -0
- package/dist/lib/table/arrow-api/index.js +5 -0
- package/dist/lib/table/arrow-api/index.js.map +1 -0
- package/dist/{esm/lib → lib}/table/batches/base-table-batch-aggregator.js +6 -7
- package/dist/lib/table/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/{esm/lib → lib}/table/batches/columnar-table-batch-aggregator.js +4 -5
- package/dist/lib/table/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/{esm/lib → lib}/table/batches/row-table-batch-aggregator.js +8 -9
- package/dist/lib/table/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/lib/table/batches/table-batch-aggregator.js.map +1 -0
- package/dist/{esm/lib → lib}/table/batches/table-batch-builder.js +14 -15
- package/dist/lib/table/batches/table-batch-builder.js.map +1 -0
- package/dist/{esm/lib → lib}/table/simple-table/convert-table.js +3 -3
- package/dist/lib/table/simple-table/convert-table.js.map +1 -0
- package/dist/lib/table/simple-table/data-type.js.map +1 -0
- package/dist/{esm/lib → lib}/table/simple-table/make-table.js +1 -1
- package/dist/lib/table/simple-table/make-table.js.map +1 -0
- package/dist/lib/table/simple-table/row-utils.js.map +1 -0
- package/dist/{esm/lib → lib}/table/simple-table/table-accessors.js +2 -2
- package/dist/lib/table/simple-table/table-accessors.js.map +1 -0
- package/dist/{esm/lib → lib}/table/simple-table/table-column.js +1 -1
- package/dist/lib/table/simple-table/table-column.js.map +1 -0
- package/dist/{esm/lib → lib}/table/simple-table/table-schema.js +1 -1
- package/dist/lib/table/simple-table/table-schema.js.map +1 -0
- package/dist/lib/utils/assert.js.map +1 -0
- package/dist/{esm/lib → lib}/utils/async-queue.js +3 -4
- package/dist/lib/utils/async-queue.js.map +1 -0
- package/dist/types/batch.d.ts +3 -2
- package/dist/types/batch.d.ts.map +1 -1
- package/dist/types/batch.js.map +1 -0
- package/dist/types/binary-geometries.js.map +1 -0
- package/dist/types/category-gis.js.map +1 -0
- package/dist/types/category-image.js.map +1 -0
- package/dist/types/category-mesh.js.map +1 -0
- package/dist/types/category-table.js.map +1 -0
- package/dist/types/category-texture.js.map +1 -0
- package/dist/types/flat-geometries.js.map +1 -0
- package/dist/types/schema.js.map +1 -0
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js.map +1 -0
- package/package.json +14 -6
- package/src/index.ts +0 -1
- package/src/lib/table/arrow-api/arrow-like-type.ts +0 -2
- package/src/types/batch.ts +4 -2
- package/src/types/types.ts +0 -2
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/dist.min.js +0 -13204
- package/dist/es5/bundle.js +0 -6
- package/dist/es5/bundle.js.map +0 -1
- package/dist/es5/index.js +0 -413
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/lib/mesh/convert-mesh.js +0 -34
- package/dist/es5/lib/mesh/convert-mesh.js.map +0 -1
- package/dist/es5/lib/mesh/deduce-mesh-schema.js +0 -56
- package/dist/es5/lib/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/es5/lib/mesh/mesh-to-arrow-table.js +0 -2
- package/dist/es5/lib/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/es5/lib/mesh/mesh-utils.js +0 -40
- package/dist/es5/lib/mesh/mesh-utils.js.map +0 -1
- package/dist/es5/lib/table/arrow/arrow-type-utils.js +0 -30
- package/dist/es5/lib/table/arrow/arrow-type-utils.js.map +0 -1
- package/dist/es5/lib/table/arrow/convert-schema-arrow.js +0 -179
- package/dist/es5/lib/table/arrow/convert-schema-arrow.js.map +0 -1
- package/dist/es5/lib/table/arrow/convert-table-to-arrow.js +0 -2
- package/dist/es5/lib/table/arrow/convert-table-to-arrow.js.map +0 -1
- package/dist/es5/lib/table/arrow-api/arrow-like-field.js +0 -49
- package/dist/es5/lib/table/arrow-api/arrow-like-field.js.map +0 -1
- package/dist/es5/lib/table/arrow-api/arrow-like-schema.js +0 -118
- package/dist/es5/lib/table/arrow-api/arrow-like-schema.js.map +0 -1
- package/dist/es5/lib/table/arrow-api/arrow-like-table.js +0 -81
- package/dist/es5/lib/table/arrow-api/arrow-like-table.js.map +0 -1
- package/dist/es5/lib/table/arrow-api/arrow-like-type.js +0 -740
- package/dist/es5/lib/table/arrow-api/arrow-like-type.js.map +0 -1
- package/dist/es5/lib/table/arrow-api/enum.js +0 -55
- package/dist/es5/lib/table/arrow-api/enum.js.map +0 -1
- package/dist/es5/lib/table/arrow-api/get-type-info.js +0 -27
- package/dist/es5/lib/table/arrow-api/get-type-info.js.map +0 -1
- package/dist/es5/lib/table/arrow-api/index.js +0 -44
- package/dist/es5/lib/table/arrow-api/index.js.map +0 -1
- package/dist/es5/lib/table/batches/base-table-batch-aggregator.js +0 -78
- package/dist/es5/lib/table/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/es5/lib/table/batches/columnar-table-batch-aggregator.js +0 -106
- package/dist/es5/lib/table/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/es5/lib/table/batches/row-table-batch-aggregator.js +0 -96
- package/dist/es5/lib/table/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/es5/lib/table/batches/table-batch-aggregator.js +0 -2
- package/dist/es5/lib/table/batches/table-batch-aggregator.js.map +0 -1
- package/dist/es5/lib/table/batches/table-batch-builder.js +0 -173
- package/dist/es5/lib/table/batches/table-batch-builder.js.map +0 -1
- package/dist/es5/lib/table/simple-table/convert-table.js +0 -106
- package/dist/es5/lib/table/simple-table/convert-table.js.map +0 -1
- package/dist/es5/lib/table/simple-table/data-type.js +0 -94
- package/dist/es5/lib/table/simple-table/data-type.js.map +0 -1
- package/dist/es5/lib/table/simple-table/make-table.js +0 -60
- package/dist/es5/lib/table/simple-table/make-table.js.map +0 -1
- package/dist/es5/lib/table/simple-table/row-utils.js +0 -34
- package/dist/es5/lib/table/simple-table/row-utils.js.map +0 -1
- package/dist/es5/lib/table/simple-table/table-accessors.js +0 -370
- package/dist/es5/lib/table/simple-table/table-accessors.js.map +0 -1
- package/dist/es5/lib/table/simple-table/table-column.js +0 -12
- package/dist/es5/lib/table/simple-table/table-column.js.map +0 -1
- package/dist/es5/lib/table/simple-table/table-schema.js +0 -85
- package/dist/es5/lib/table/simple-table/table-schema.js.map +0 -1
- package/dist/es5/lib/utils/assert.js +0 -12
- package/dist/es5/lib/utils/assert.js.map +0 -1
- package/dist/es5/lib/utils/async-queue.js +0 -169
- package/dist/es5/lib/utils/async-queue.js.map +0 -1
- package/dist/es5/types/batch.js +0 -2
- package/dist/es5/types/batch.js.map +0 -1
- package/dist/es5/types/binary-geometries.js +0 -2
- package/dist/es5/types/binary-geometries.js.map +0 -1
- package/dist/es5/types/category-gis.js +0 -2
- package/dist/es5/types/category-gis.js.map +0 -1
- package/dist/es5/types/category-image.js +0 -2
- package/dist/es5/types/category-image.js.map +0 -1
- package/dist/es5/types/category-mesh.js +0 -2
- package/dist/es5/types/category-mesh.js.map +0 -1
- package/dist/es5/types/category-table.js +0 -2
- package/dist/es5/types/category-table.js.map +0 -1
- package/dist/es5/types/category-texture.js +0 -2
- package/dist/es5/types/category-texture.js.map +0 -1
- package/dist/es5/types/flat-geometries.js +0 -2
- package/dist/es5/types/flat-geometries.js.map +0 -1
- package/dist/es5/types/schema.js +0 -2
- package/dist/es5/types/schema.js.map +0 -1
- package/dist/es5/types/types.js +0 -2
- package/dist/es5/types/types.js.map +0 -1
- package/dist/esm/bundle.js +0 -4
- package/dist/esm/bundle.js.map +0 -1
- package/dist/esm/index.js +0 -17
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/lib/mesh/convert-mesh.js.map +0 -1
- package/dist/esm/lib/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/esm/lib/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/esm/lib/mesh/mesh-utils.js.map +0 -1
- package/dist/esm/lib/table/arrow/arrow-type-utils.js +0 -24
- package/dist/esm/lib/table/arrow/arrow-type-utils.js.map +0 -1
- package/dist/esm/lib/table/arrow/convert-schema-arrow.js +0 -158
- package/dist/esm/lib/table/arrow/convert-schema-arrow.js.map +0 -1
- package/dist/esm/lib/table/arrow/convert-table-to-arrow.js +0 -2
- package/dist/esm/lib/table/arrow/convert-table-to-arrow.js.map +0 -1
- package/dist/esm/lib/table/arrow-api/arrow-like-field.js.map +0 -1
- package/dist/esm/lib/table/arrow-api/arrow-like-schema.js.map +0 -1
- package/dist/esm/lib/table/arrow-api/arrow-like-table.js.map +0 -1
- package/dist/esm/lib/table/arrow-api/arrow-like-type.js.map +0 -1
- package/dist/esm/lib/table/arrow-api/enum.js.map +0 -1
- package/dist/esm/lib/table/arrow-api/get-type-info.js.map +0 -1
- package/dist/esm/lib/table/arrow-api/index.js +0 -5
- package/dist/esm/lib/table/arrow-api/index.js.map +0 -1
- package/dist/esm/lib/table/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/esm/lib/table/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/esm/lib/table/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/esm/lib/table/batches/table-batch-aggregator.js.map +0 -1
- package/dist/esm/lib/table/batches/table-batch-builder.js.map +0 -1
- package/dist/esm/lib/table/simple-table/convert-table.js.map +0 -1
- package/dist/esm/lib/table/simple-table/data-type.js.map +0 -1
- package/dist/esm/lib/table/simple-table/make-table.js.map +0 -1
- package/dist/esm/lib/table/simple-table/row-utils.js.map +0 -1
- package/dist/esm/lib/table/simple-table/table-accessors.js.map +0 -1
- package/dist/esm/lib/table/simple-table/table-column.js.map +0 -1
- package/dist/esm/lib/table/simple-table/table-schema.js.map +0 -1
- package/dist/esm/lib/utils/assert.js.map +0 -1
- package/dist/esm/lib/utils/async-queue.js.map +0 -1
- package/dist/esm/types/batch.js.map +0 -1
- package/dist/esm/types/binary-geometries.js.map +0 -1
- package/dist/esm/types/category-gis.js.map +0 -1
- package/dist/esm/types/category-image.js.map +0 -1
- package/dist/esm/types/category-mesh.js.map +0 -1
- package/dist/esm/types/category-table.js.map +0 -1
- package/dist/esm/types/category-texture.js.map +0 -1
- package/dist/esm/types/flat-geometries.js.map +0 -1
- package/dist/esm/types/schema.js.map +0 -1
- package/dist/esm/types/types.js.map +0 -1
- package/dist/lib/table/arrow/arrow-type-utils.d.ts +0 -4
- package/dist/lib/table/arrow/arrow-type-utils.d.ts.map +0 -1
- package/dist/lib/table/arrow/convert-schema-arrow.d.ts +0 -13
- package/dist/lib/table/arrow/convert-schema-arrow.d.ts.map +0 -1
- package/dist/lib/table/arrow/convert-table-to-arrow.d.ts +0 -42
- package/dist/lib/table/arrow/convert-table-to-arrow.d.ts.map +0 -1
- package/src/bundle.ts +0 -4
- package/src/lib/table/arrow/arrow-type-utils.ts +0 -71
- package/src/lib/table/arrow/convert-schema-arrow.ts +0 -232
- package/src/lib/table/arrow/convert-table-to-arrow.ts +0 -59
- /package/dist/{esm/lib → lib}/mesh/mesh-to-arrow-table.js +0 -0
- /package/dist/{esm/lib → lib}/mesh/mesh-utils.js +0 -0
- /package/dist/{esm/lib → lib}/table/arrow-api/enum.js +0 -0
- /package/dist/{esm/lib → lib}/table/batches/table-batch-aggregator.js +0 -0
- /package/dist/{esm/lib → lib}/table/simple-table/data-type.js +0 -0
- /package/dist/{esm/lib → lib}/table/simple-table/row-utils.js +0 -0
- /package/dist/{esm/lib → lib}/utils/assert.js +0 -0
- /package/dist/{esm/types → types}/batch.js +0 -0
- /package/dist/{esm/types → types}/binary-geometries.js +0 -0
- /package/dist/{esm/types → types}/category-gis.js +0 -0
- /package/dist/{esm/types → types}/category-image.js +0 -0
- /package/dist/{esm/types → types}/category-mesh.js +0 -0
- /package/dist/{esm/types → types}/category-table.js +0 -0
- /package/dist/{esm/types → types}/category-texture.js +0 -0
- /package/dist/{esm/types → types}/flat-geometries.js +0 -0
- /package/dist/{esm/types → types}/schema.js +0 -0
- /package/dist/{esm/types → types}/types.js +0 -0
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
exports.takeAsync = takeAsync;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
18
|
-
var _Symbol$asyncIterator;
|
|
19
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
20
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
-
var ArrayQueue = function (_Array) {
|
|
22
|
-
(0, _inherits2.default)(ArrayQueue, _Array);
|
|
23
|
-
var _super = _createSuper(ArrayQueue);
|
|
24
|
-
function ArrayQueue() {
|
|
25
|
-
(0, _classCallCheck2.default)(this, ArrayQueue);
|
|
26
|
-
return _super.apply(this, arguments);
|
|
27
|
-
}
|
|
28
|
-
(0, _createClass2.default)(ArrayQueue, [{
|
|
29
|
-
key: "enqueue",
|
|
30
|
-
value: function enqueue(value) {
|
|
31
|
-
return this.push(value);
|
|
32
|
-
}
|
|
33
|
-
}, {
|
|
34
|
-
key: "dequeue",
|
|
35
|
-
value: function dequeue() {
|
|
36
|
-
return this.shift();
|
|
37
|
-
}
|
|
38
|
-
}]);
|
|
39
|
-
return ArrayQueue;
|
|
40
|
-
}((0, _wrapNativeSuper2.default)(Array));
|
|
41
|
-
_Symbol$asyncIterator = Symbol.asyncIterator;
|
|
42
|
-
var AsyncQueue = function () {
|
|
43
|
-
function AsyncQueue() {
|
|
44
|
-
(0, _classCallCheck2.default)(this, AsyncQueue);
|
|
45
|
-
(0, _defineProperty2.default)(this, "_values", void 0);
|
|
46
|
-
(0, _defineProperty2.default)(this, "_settlers", void 0);
|
|
47
|
-
(0, _defineProperty2.default)(this, "_closed", void 0);
|
|
48
|
-
this._values = new ArrayQueue();
|
|
49
|
-
this._settlers = new ArrayQueue();
|
|
50
|
-
this._closed = false;
|
|
51
|
-
}
|
|
52
|
-
(0, _createClass2.default)(AsyncQueue, [{
|
|
53
|
-
key: "close",
|
|
54
|
-
value: function close() {
|
|
55
|
-
while (this._settlers.length > 0) {
|
|
56
|
-
this._settlers.dequeue().resolve({
|
|
57
|
-
done: true
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
this._closed = true;
|
|
61
|
-
}
|
|
62
|
-
}, {
|
|
63
|
-
key: _Symbol$asyncIterator,
|
|
64
|
-
value: function value() {
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
key: "enqueue",
|
|
69
|
-
value: function enqueue(value) {
|
|
70
|
-
if (this._closed) {
|
|
71
|
-
throw new Error('Closed');
|
|
72
|
-
}
|
|
73
|
-
if (this._settlers.length > 0) {
|
|
74
|
-
if (this._values.length > 0) {
|
|
75
|
-
throw new Error('Illegal internal state');
|
|
76
|
-
}
|
|
77
|
-
var settler = this._settlers.dequeue();
|
|
78
|
-
if (value instanceof Error) {
|
|
79
|
-
settler.reject(value);
|
|
80
|
-
} else {
|
|
81
|
-
settler.resolve({
|
|
82
|
-
value: value
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
this._values.enqueue(value);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "next",
|
|
91
|
-
value: function next() {
|
|
92
|
-
var _this = this;
|
|
93
|
-
if (this._values.length > 0) {
|
|
94
|
-
var _value = this._values.dequeue();
|
|
95
|
-
if (_value instanceof Error) {
|
|
96
|
-
return Promise.reject(_value);
|
|
97
|
-
}
|
|
98
|
-
return Promise.resolve({
|
|
99
|
-
value: _value
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
if (this._closed) {
|
|
103
|
-
if (this._settlers.length > 0) {
|
|
104
|
-
throw new Error('Illegal internal state');
|
|
105
|
-
}
|
|
106
|
-
return Promise.resolve({
|
|
107
|
-
done: true
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
return new Promise(function (resolve, reject) {
|
|
111
|
-
_this._settlers.enqueue({
|
|
112
|
-
resolve: resolve,
|
|
113
|
-
reject: reject
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
}]);
|
|
118
|
-
return AsyncQueue;
|
|
119
|
-
}();
|
|
120
|
-
exports.default = AsyncQueue;
|
|
121
|
-
function takeAsync(_x) {
|
|
122
|
-
return _takeAsync.apply(this, arguments);
|
|
123
|
-
}
|
|
124
|
-
function _takeAsync() {
|
|
125
|
-
_takeAsync = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(asyncIterable) {
|
|
126
|
-
var count,
|
|
127
|
-
result,
|
|
128
|
-
iterator,
|
|
129
|
-
_yield$iterator$next,
|
|
130
|
-
_value2,
|
|
131
|
-
done,
|
|
132
|
-
_args = arguments;
|
|
133
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
134
|
-
while (1) switch (_context.prev = _context.next) {
|
|
135
|
-
case 0:
|
|
136
|
-
count = _args.length > 1 && _args[1] !== undefined ? _args[1] : Infinity;
|
|
137
|
-
result = [];
|
|
138
|
-
iterator = asyncIterable[Symbol.asyncIterator]();
|
|
139
|
-
case 3:
|
|
140
|
-
if (!(result.length < count)) {
|
|
141
|
-
_context.next = 14;
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
_context.next = 6;
|
|
145
|
-
return iterator.next();
|
|
146
|
-
case 6:
|
|
147
|
-
_yield$iterator$next = _context.sent;
|
|
148
|
-
_value2 = _yield$iterator$next.value;
|
|
149
|
-
done = _yield$iterator$next.done;
|
|
150
|
-
if (!done) {
|
|
151
|
-
_context.next = 11;
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
return _context.abrupt("break", 14);
|
|
155
|
-
case 11:
|
|
156
|
-
result.push(_value2);
|
|
157
|
-
_context.next = 3;
|
|
158
|
-
break;
|
|
159
|
-
case 14:
|
|
160
|
-
return _context.abrupt("return", result);
|
|
161
|
-
case 15:
|
|
162
|
-
case "end":
|
|
163
|
-
return _context.stop();
|
|
164
|
-
}
|
|
165
|
-
}, _callee);
|
|
166
|
-
}));
|
|
167
|
-
return _takeAsync.apply(this, arguments);
|
|
168
|
-
}
|
|
169
|
-
//# sourceMappingURL=async-queue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-queue.js","names":["ArrayQueue","_Array","_inherits2","default","_super","_createSuper","_classCallCheck2","apply","arguments","_createClass2","key","value","enqueue","push","dequeue","shift","_wrapNativeSuper2","Array","_Symbol$asyncIterator","Symbol","asyncIterator","AsyncQueue","_defineProperty2","_values","_settlers","_closed","close","length","resolve","done","Error","settler","reject","next","_this","Promise","exports","takeAsync","_x","_takeAsync","_asyncToGenerator2","_regenerator","mark","_callee","asyncIterable","count","result","iterator","_yield$iterator$next","_value2","_args","wrap","_callee$","_context","prev","undefined","Infinity","sent","abrupt","stop"],"sources":["../../../../src/lib/utils/async-queue.ts"],"sourcesContent":["// From https://github.com/rauschma/async-iter-demo/tree/master/src under MIT license\n// http://2ality.com/2016/10/asynchronous-iteration.html\n\nclass ArrayQueue<T> extends Array<T> {\n enqueue(value: T) {\n // Add at the end\n return this.push(value);\n }\n dequeue(): T {\n // Remove first element\n return this.shift() as T;\n }\n}\n\nexport default class AsyncQueue<T> {\n private _values: ArrayQueue<T | Error>;\n private _settlers: ArrayQueue<{resolve: (value: any) => void; reject: (reason?: any) => void}>;\n private _closed: boolean;\n\n constructor() {\n // enqueues > dequeues\n this._values = new ArrayQueue<T>();\n // dequeues > enqueues\n this._settlers = new ArrayQueue<{\n resolve: (value: any) => void;\n reject: (reason?: any) => void;\n }>();\n this._closed = false;\n }\n\n close(): void {\n while (this._settlers.length > 0) {\n this._settlers.dequeue().resolve({done: true});\n }\n this._closed = true;\n }\n\n [Symbol.asyncIterator](): AsyncIterator<T> {\n return this;\n }\n\n enqueue(value: T | Error): void {\n if (this._closed) {\n throw new Error('Closed');\n }\n\n if (this._settlers.length > 0) {\n if (this._values.length > 0) {\n throw new Error('Illegal internal state');\n }\n const settler = this._settlers.dequeue();\n if (value instanceof Error) {\n settler.reject(value);\n } else {\n settler.resolve({value});\n }\n } else {\n this._values.enqueue(value);\n }\n }\n\n /**\n * @returns a Promise for an IteratorResult\n */\n next(): Promise<any> {\n if (this._values.length > 0) {\n const value = this._values.dequeue();\n if (value instanceof Error) {\n return Promise.reject(value);\n }\n return Promise.resolve({value});\n }\n\n if (this._closed) {\n if (this._settlers.length > 0) {\n throw new Error('Illegal internal state');\n }\n return Promise.resolve({done: true});\n }\n // Wait for new values to be enqueued\n return new Promise((resolve, reject) => {\n this._settlers.enqueue({resolve, reject});\n });\n }\n}\n\n/**\n * @returns a Promise for an Array with the elements in `asyncIterable`\n */\nexport async function takeAsync(\n asyncIterable: AsyncIterable<any>,\n count = Infinity\n): Promise<any[]> {\n const result: Array<any> = [];\n const iterator = asyncIterable[Symbol.asyncIterator]();\n while (result.length < count) {\n const {value, done} = await iterator.next();\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AC/C0B,MAAM,CAACnB,MAAM,GAAGkB,KAAK;YAAAQ,QAAA,CAAApB,IAAA;YAAA;UAAA;UAAAoB,QAAA,CAAApB,IAAA;UAAA,OACEc,QAAQ,CAACd,IAAI,CAAC,CAAC;QAAA;UAAAe,oBAAA,GAAAK,QAAA,CAAAI,IAAA;UAApC9C,OAAK,GAAAqC,oBAAA,CAALrC,KAAK;UAAEkB,IAAI,GAAAmB,oBAAA,CAAJnB,IAAI;UAAA,KACdA,IAAI;YAAAwB,QAAA,CAAApB,IAAA;YAAA;UAAA;UAAA,OAAAoB,QAAA,CAAAK,MAAA;QAAA;UAGRZ,MAAM,CAACjC,IAAI,CAACF,OAAK,CAAC;UAAC0C,QAAA,CAAApB,IAAA;UAAA;QAAA;UAAA,OAAAoB,QAAA,CAAAK,MAAA,WAEdZ,MAAM;QAAA;QAAA;UAAA,OAAAO,QAAA,CAAAM,IAAA;MAAA;IAAA,GAAAhB,OAAA;EAAA,CACd;EAAA,OAAAJ,UAAA,CAAAhC,KAAA,OAAAC,SAAA;AAAA"}
|
package/dist/es5/types/batch.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"batch.js","names":[],"sources":["../../../src/types/batch.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {Schema} from './schema';\nimport type {RecordBatch} from 'apache-arrow';\n\n/**\n * A batch of data (or metadata/schema), from a streaming loader\n * @see parseInBatches()\n * @see loadInBatches()\n */\nexport type Batch = {\n /** A batch can contain metadata, data, or in case of unstructured data (JSON) */\n batchType: 'data' | 'metadata' | 'partial-result' | 'final-result';\n /** A string identifying the shape of data in this batch (table, etc) */\n shape: string;\n /** Schema of the data in this batch */\n schema?: Schema;\n /** Data in this batch */\n data: unknown;\n /** If this is an arrow table. @deprecated Use `data` */\n recordBatch?: RecordBatch;\n /** Length of data in this batch */\n length: number;\n\n /** A count of batches received */\n batch?: number;\n\n /** A count of batches received */\n count?: number;\n\n /** Bytes used so far */\n bytesUsed?: number;\n /** cursor is the */\n cursor?: number;\n\n /** MIME type of the data generating this batch */\n mimeType?: string;\n\n /** Any other data */\n [key: string]: unknown;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binary-geometries.js","names":[],"sources":["../../../src/types/binary-geometries.ts"],"sourcesContent":["// GIS\nimport type {TypedArray} from './types';\n\n// BINARY FORMAT GEOMETRY\n\nexport type BinaryAttribute = {value: TypedArray; size: number};\nexport type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype NumericProps = {[key: string]: BinaryAttribute};\ntype Properties = object[];\n\n/**\n * Represent a single Geometry, similar to a GeoJSON Geometry\n */\nexport type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;\n\n/** Binary point geometry: an array of positions */\nexport type BinaryPointGeometry = {\n type: 'Point';\n positions: BinaryAttribute;\n};\n\n/** Binary line geometry, array of positions and indices to the start of each line */\nexport type BinaryLineGeometry = {\n type: 'LineString';\n positions: BinaryAttribute;\n pathIndices: BinaryAttribute;\n};\n\n/** Binary polygon geometry, an array of positions to each primitite polygon and polygon */\nexport type BinaryPolygonGeometry = {\n type: 'Polygon';\n positions: BinaryAttribute;\n polygonIndices: BinaryAttribute;\n primitivePolygonIndices: BinaryAttribute;\n triangles?: BinaryAttribute;\n};\n\n/** Common properties for binary geometries */\nexport type BinaryProperties = {\n featureIds: BinaryAttribute;\n globalFeatureIds: BinaryAttribute;\n numericProps: NumericProps;\n properties: Properties;\n fields?: Properties;\n};\n\n/** Binary feature + binary attributes */\nexport type BinaryFeature = BinaryPointFeature | BinaryLineFeature | BinaryPolygonFeature;\n\nexport type BinaryPointFeature = BinaryPointGeometry & BinaryProperties;\nexport type BinaryLineFeature = BinaryLineGeometry & BinaryProperties;\nexport type BinaryPolygonFeature = BinaryPolygonGeometry & BinaryProperties;\n\n/**\n * Represent a collection of Features, similar to a GeoJSON FeatureCollection\n */\nexport type BinaryFeatureCollection = {\n points?: BinaryPointFeature;\n lines?: BinaryLineFeature;\n polygons?: BinaryPolygonFeature;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category-gis.js","names":[],"sources":["../../../src/types/category-gis.ts"],"sourcesContent":["// GIS\n\n// NORMAL GEOJSON FORMAT GEOMETRY\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties\n} from 'geojson';\n\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from 'geojson';\n\n// FLAT GEOJSON FORMAT GEOMETRY\nexport type {\n FlatGeometryType,\n FlatIndexedGeometry,\n FlatPoint,\n FlatLineString,\n FlatPolygon,\n FlatGeometry,\n FlatFeature\n} from './flat-geometries';\n\n// BINARY FORMAT GEOMETRY\nexport type {\n BinaryAttribute,\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryProperties,\n BinaryFeatureCollection,\n BinaryFeature,\n BinaryPointFeature,\n BinaryLineFeature,\n BinaryPolygonFeature\n} from './binary-geometries';\n\n/** Aggregate information for converting GeoJSON into other formats */\nexport type GeojsonGeometryInfo = {\n coordLength: number;\n pointPositionsCount: number;\n pointFeaturesCount: number;\n linePositionsCount: number;\n linePathsCount: number;\n lineFeaturesCount: number;\n polygonPositionsCount: number;\n polygonObjectsCount: number;\n polygonRingsCount: number;\n polygonFeaturesCount: number;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category-image.js","names":[],"sources":["../../../src/types/category-image.ts"],"sourcesContent":["/**\n * data images\n */\nexport type ImageDataType = {\n data: Uint8Array;\n width: number;\n height: number;\n compressed?: boolean;\n};\n\n/**\n * Supported Image Types\n */\nexport type ImageType = ImageBitmap | ImageDataType | HTMLImageElement;\n\n/**\n * Image type string used to control or determine the type of images returned from ImageLoader\n */\nexport type ImageTypeEnum = 'imagebitmap' | 'image' | 'data';\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category-mesh.js","names":[],"sources":["../../../src/types/category-mesh.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Schema} from './schema';\nimport type {TypedArray} from './types';\nimport type {ColumnarTable, ArrowTable} from './category-table';\n\n/** Mesh as columnar table */\nexport interface MeshTable extends ColumnarTable {\n // shape: 'mesh-table';\n topology: 'point-list' | 'triangle-list' | 'triangle-strip';\n indices?: MeshAttribute;\n}\n\n/** Mesh as arrow table */\nexport interface MeshArrowTable extends ArrowTable {\n // shape: 'mesh-arrow-table';\n topology: 'point-list' | 'triangle-list' | 'triangle-strip';\n indices?: MeshAttribute;\n}\n\n/** Geometry part of a Mesh (compatible with a standard luma.gl \"mesh\") */\nexport type MeshGeometry = {\n attributes: {[attributeName: string]: MeshAttribute};\n indices?: MeshAttribute;\n topology: 'point-list' | 'triangle-list' | 'triangle-strip';\n mode: number;\n};\n\n/** Geometry and metadata for a Mesh (compatible with a standard luma.gl \"mesh\") */\nexport type Mesh = MeshGeometry & {\n loader?: string;\n loaderData?: {[key: string]: any};\n header?: {\n vertexCount: number;\n boundingBox?: [number[], number[]];\n };\n schema: Schema;\n};\n\n/**\n * luma.gl compatible attribute descriptors\n * Can be mapped to any WebGL framework\n */\nexport type MeshAttribute = {\n value: TypedArray;\n size: number;\n byteOffset?: number;\n byteStride?: number;\n normalized?: boolean;\n};\n\n/** A map of mesh attributes keyed by attribute names */\nexport type MeshAttributes = Record<string, MeshAttribute>;\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category-table.js","names":[],"sources":["../../../src/types/category-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Schema} from './schema';\nimport type {Batch} from './batch';\nimport type {Feature} from './category-gis';\n\n// Avoid a big dependency, apparently even a type import can pull in a lot of code\n// import type {Table as ApacheArrowTable} from 'apache-arrow';\n\ntype ApacheArrowTable = unknown;\ntype ApacheRecordBatch = unknown;\n\n/** A general table */\nexport type Table =\n | RowTable\n | ArrayRowTable\n | ObjectRowTable\n | GeoJSONTable\n | ColumnarTable\n | ArrowTable;\n\n/** A table organized as an array of rows */\nexport type RowTable = ArrayRowTable | ObjectRowTable | GeoJSONTable;\n\n/** A table organized as an array of rows, each row is an array of values */\nexport type ArrayRowTable = {\n shape: 'array-row-table';\n schema?: Schema;\n data: any[][];\n};\n\n/** A table organized as an array of rows, each row is an object mapping columns to values */\nexport type ObjectRowTable = {\n shape: 'object-row-table';\n schema?: Schema;\n data: {[columnName: string]: any}[];\n};\n\n/**\n * A table organized as an array of rows, each row is a GeoJSON Feature\n * @note For compatibility with GeoJSON, rows are stored in `table.features` instead of `table.data`\n */\nexport type GeoJSONTable = {\n shape: 'geojson-table';\n schema?: Schema;\n /** For compatibility with GeoJSON, the type field must always be set to `FeatureCollection` */\n type: 'FeatureCollection';\n /** For compatibility with GeoJSON, rows are stored in `table.features` instead of `table.data` */\n features: Feature[];\n};\n\n/** A table organized as a map of columns, each column is an array of value */\nexport type ColumnarTable = {\n shape: 'columnar-table';\n schema?: Schema;\n data: {[columnName: string]: ArrayLike<unknown>};\n};\n\n/** A table organized as an Apache Arrow table */\nexport type ArrowTable = {\n shape: 'arrow-table';\n schema?: Schema;\n data: ApacheArrowTable;\n};\n\n/** A collection of tables */\nexport type Tables<TableType = Table> = {\n shape: 'tables';\n tables: {name: string; table: TableType}[];\n};\n\n// Batches\n\n/** Batch for a general table */\nexport type TableBatch =\n | ArrayRowTableBatch\n | ObjectRowTableBatch\n | GeoJSONTableBatch\n | ColumnarTableBatch\n | ArrowTableBatch;\n\n/** Batch for a table organized as an array of rows, each row is an array of values */\nexport type ArrayRowTableBatch = Batch & {\n shape: 'array-row-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n data: any[][];\n length: number;\n};\n\n/** Batch for a table organized as an array of rows, each row is an object mapping columns to values */\nexport type ObjectRowTableBatch = Batch & {\n shape: 'object-row-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n data: {[columnName: string]: any}[];\n length: number;\n};\n\n/** Batch for a table organized as an array of rows, each row is an array of values */\nexport type GeoJSONTableBatch = Batch & {\n shape: 'geojson-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n type: 'FeatureCollection';\n features: Feature[];\n length: number;\n};\n\n/** Batch for a table organized as a map of columns, each column is an array of value */\nexport type ColumnarTableBatch = Batch & {\n shape: 'columnar-table';\n schemaType?: 'explicit' | 'deduced';\n schema?: Schema;\n data: {[columnName: string]: ArrayLike<unknown>};\n length: number;\n};\n\n/** Batch for a table organized as an Apache Arrow table */\nexport type ArrowTableBatch = Batch & {\n shape: 'arrow-table';\n schemaType?: 'explicit' | 'deduced';\n schema?: Schema;\n data: ApacheRecordBatch;\n length: number;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category-texture.js","names":[],"sources":["../../../src/types/category-texture.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {ImageType} from './category-image';\n\n/**\n * These represent the main compressed texture formats\n * Each format typically has a number of more specific subformats\n */\nexport type GPUTextureFormat =\n | 'dxt'\n | 'dxt-srgb'\n | 'etc1'\n | 'etc2'\n | 'pvrtc'\n | 'atc'\n | 'astc'\n | 'rgtc';\n\n/** One mip level */\nexport type TextureLevel = {\n compressed: boolean;\n format?: number;\n data: Uint8Array;\n width: number;\n height: number;\n levelSize?: number;\n hasAlpha?: boolean;\n};\n\nexport type TextureOrImage = ImageType | (TextureLevel | ImageType);\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flat-geometries.js","names":[],"sources":["../../../src/types/flat-geometries.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// FLAT GEOJSON FORMAT GEOMETRY\nimport type {Feature, Geometry, Point, LineString, Polygon} from 'geojson';\n\n/** Flat geometry type */\nexport type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype RemoveCoordinatesField<Type> = {\n [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];\n};\n\n/** Generic flat geometry data storage type */\nexport type FlatIndexedGeometry = {\n data: number[];\n indices: number[];\n};\n\n/** GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices` */\nexport type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;\n\n/** GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices` */\nexport type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;\n\n/** GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */\nexport type FlatPolygon = RemoveCoordinatesField<Polygon> & {\n data: number[];\n indices: number[][];\n areas: number[][];\n};\n\n/** GeoJSON geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */\nexport type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;\n\ntype FlattenGeometry<Type> = {\n [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];\n};\n\n/** GeoJSON Feature with Geometry replaced by FlatGeometry */\nexport type FlatFeature = FlattenGeometry<Feature>;\n"],"mappings":""}
|
package/dist/es5/types/schema.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../src/types/schema.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/** For dictionary type */\nexport type KeyType = 'int8' | 'int16' | 'int32' | 'uint8' | 'uint16' | 'uint32';\n\n/** ArrowLike DataType class */\nexport type DataType =\n | 'null'\n // Primitive types\n | 'bool'\n | 'int'\n | 'int8'\n | 'int16'\n | 'int32'\n | 'int64'\n | 'uint8'\n | 'uint16'\n | 'uint32'\n | 'uint64'\n | 'float'\n | 'float16'\n | 'float32'\n | 'float64'\n | 'binary'\n | 'utf8'\n | 'date-day'\n | 'date-millisecond'\n | 'time-second'\n | 'time-millisecond'\n | 'time-microsecond'\n | 'time-nanosecond'\n | 'timestamp-second'\n | 'timestamp-millisecond'\n | 'timestamp-microsecond'\n | 'timestamp-nanosecond'\n | 'interval-daytime'\n | 'interval-yearmonth'\n // Composite types\n | {type: 'list'; children: Field[]} // one child only\n | {type: 'struct'; children: Field[]}\n | {\n type: 'sparse-union';\n typeIds: Int32Array;\n children: Field[];\n typeIdToChildIndex: {[key: number]: number};\n }\n | {\n type: 'dense-union';\n typeIds: Int32Array;\n children: Field[];\n typeIdToChildIndex: {[key: number]: number};\n }\n | {type: 'fixed-size-binary'; byteWidth: number}\n | {type: 'fixed-size-list'; listSize: number; children: Field[]}\n | {type: 'map'; keysSorted: boolean; children: Field[]} // Field is \"struct\"\n | {type: 'dictionary'; id: number; indices: KeyType; dictionary: DataType; isOrdered: boolean};\n// TODO - unions etc\n\n/**\n * SchemaMetadata\n */\nexport type SchemaMetadata = Record<string, string>;\nexport type FieldMetadata = Record<string, string>;\n\nexport type Field = {\n name: string;\n type: DataType;\n nullable?: boolean;\n metadata?: FieldMetadata;\n};\n\n/**\n * `Schema` type that that can hold all data required by an Arrow Schema\n * but is fully serializable. Helper functions make it easy to convert to and from arrow schemas\n * https://loaders.gl/arrowjs/docs/api-reference/schema\n */\nexport type Schema = {\n fields: Field[];\n metadata: SchemaMetadata;\n};\n"],"mappings":""}
|
package/dist/es5/types/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["/** Any typed array */\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Uint8ClampedArray\n | Float32Array\n | Float64Array;\n\nexport type BigTypedArray = TypedArray | BigInt64Array | BigUint64Array;\n\nexport type TypedArrayConstructor =\n | Int8ArrayConstructor\n | Uint8ArrayConstructor\n | Int16ArrayConstructor\n | Uint16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\nexport type BigTypedArrayConstructor =\n | TypedArrayConstructor\n | BigInt64ArrayConstructor\n | BigUint64ArrayConstructor;\n\n/** Any numeric array: typed array or `number[]` */\nexport type NumberArray = number[] | TypedArray;\n\nexport type NumericArray = number[] | TypedArray;\n\nexport interface ArrayType<T = unknown> {\n readonly length: number;\n [n: number]: T;\n}\n\n/** Any array: typed array or js array (`any[]`) */\nexport type AnyArray = any[] | TypedArray;\n"],"mappings":""}
|
package/dist/esm/bundle.js
DELETED
package/dist/esm/bundle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":"AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAS,CAAC;AACxCC,UAAU,CAACC,OAAO,GAAGD,UAAU,CAACC,OAAO,IAAI,CAAC,CAAC;AAC7CC,MAAM,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACL,UAAU,CAACC,OAAO,EAAEH,aAAa,CAAC"}
|
package/dist/esm/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export { TableBatchBuilder } from './lib/table/batches/table-batch-builder';
|
|
2
|
-
export { RowTableBatchAggregator } from './lib/table/batches/row-table-batch-aggregator';
|
|
3
|
-
export { ColumnarTableBatchAggregator } from './lib/table/batches/columnar-table-batch-aggregator';
|
|
4
|
-
export { getTableLength, getTableNumCols, getTableCell, getTableRowShape, getTableColumnIndex, getTableColumnName, getTableRowAsObject, getTableRowAsArray, makeRowIterator, makeArrayRowIterator, makeObjectRowIterator } from './lib/table/simple-table/table-accessors';
|
|
5
|
-
export { ArrowLikeTable } from './lib/table/arrow-api/arrow-like-table';
|
|
6
|
-
export { makeTableFromData } from './lib/table/simple-table/make-table';
|
|
7
|
-
export { convertTable } from './lib/table/simple-table/convert-table';
|
|
8
|
-
export { deduceTableSchema } from './lib/table/simple-table/table-schema';
|
|
9
|
-
export { convertToObjectRow, convertToArrayRow } from './lib/table/simple-table/row-utils';
|
|
10
|
-
export { getDataTypeFromArray } from './lib/table/simple-table/data-type';
|
|
11
|
-
export { getMeshSize, getMeshBoundingBox } from './lib/mesh/mesh-utils';
|
|
12
|
-
export { deduceMeshSchema, deduceMeshField, makeMeshAttributeMetadata } from './lib/mesh/deduce-mesh-schema';
|
|
13
|
-
export { Schema as ArrowLikeSchema, Field as ArrowLikeField, DataType as ArrowLikeDataType, Null, Binary, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Date, DateDay, DateMillisecond, Time, TimeMillisecond, TimeSecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Struct } from './lib/table/arrow-api';
|
|
14
|
-
export { getTypeInfo } from './lib/table/arrow-api/get-type-info';
|
|
15
|
-
export { getArrowType } from './lib/table/arrow/arrow-type-utils';
|
|
16
|
-
export { default as AsyncQueue } from './lib/utils/async-queue';
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TableBatchBuilder","RowTableBatchAggregator","ColumnarTableBatchAggregator","getTableLength","getTableNumCols","getTableCell","getTableRowShape","getTableColumnIndex","getTableColumnName","getTableRowAsObject","getTableRowAsArray","makeRowIterator","makeArrayRowIterator","makeObjectRowIterator","ArrowLikeTable","makeTableFromData","convertTable","deduceTableSchema","convertToObjectRow","convertToArrayRow","getDataTypeFromArray","getMeshSize","getMeshBoundingBox","deduceMeshSchema","deduceMeshField","makeMeshAttributeMetadata","Schema","ArrowLikeSchema","Field","ArrowLikeField","DataType","ArrowLikeDataType","Null","Binary","Bool","Int","Int8","Int16","Int32","Int64","Uint8","Uint16","Uint32","Uint64","Float","Float16","Float32","Float64","Utf8","Date","DateDay","DateMillisecond","Time","TimeMillisecond","TimeSecond","Timestamp","TimestampSecond","TimestampMillisecond","TimestampMicrosecond","TimestampNanosecond","Interval","IntervalDayTime","IntervalYearMonth","FixedSizeList","Struct","getTypeInfo","getArrowType","default","AsyncQueue"],"sources":["../../src/index.ts"],"sourcesContent":["// COMMON CATEGORY\nexport type {\n TypedArray,\n BigTypedArray,\n TypedArrayConstructor,\n BigTypedArrayConstructor,\n NumberArray,\n ArrayType,\n AnyArray\n} from './types/types';\n\nexport type {Schema, Field, DataType, SchemaMetadata, FieldMetadata} from './types/schema';\n\nexport type {Batch} from './types/batch';\n\n// TABLE CATEGORY TYPES\nexport type {\n Table,\n RowTable,\n ArrayRowTable,\n ObjectRowTable,\n GeoJSONTable,\n ColumnarTable,\n ArrowTable,\n Tables\n} from './types/category-table';\nexport type {\n TableBatch,\n ArrayRowTableBatch,\n ObjectRowTableBatch,\n GeoJSONTableBatch,\n ColumnarTableBatch,\n ArrowTableBatch\n} from './types/category-table';\n\n// TABLE CATEGORY UTILS\nexport {TableBatchBuilder} from './lib/table/batches/table-batch-builder';\nexport type {TableBatchAggregator} from './lib/table/batches/table-batch-aggregator';\nexport {RowTableBatchAggregator} from './lib/table/batches/row-table-batch-aggregator';\nexport {ColumnarTableBatchAggregator} from './lib/table/batches/columnar-table-batch-aggregator';\n\nexport {\n getTableLength,\n getTableNumCols,\n getTableCell,\n getTableRowShape,\n getTableColumnIndex,\n getTableColumnName,\n getTableRowAsObject,\n getTableRowAsArray,\n makeRowIterator,\n makeArrayRowIterator,\n makeObjectRowIterator\n} from './lib/table/simple-table/table-accessors';\n\nexport {ArrowLikeTable} from './lib/table/arrow-api/arrow-like-table';\n\nexport {makeTableFromData} from './lib/table/simple-table/make-table';\nexport {convertTable} from './lib/table/simple-table/convert-table';\nexport {deduceTableSchema} from './lib/table/simple-table/table-schema';\nexport {convertToObjectRow, convertToArrayRow} from './lib/table/simple-table/row-utils';\nexport {getDataTypeFromArray} from './lib/table/simple-table/data-type';\n\n// MESH CATEGORY\nexport type {\n MeshTable,\n MeshArrowTable,\n Mesh,\n MeshGeometry,\n MeshAttribute,\n MeshAttributes\n} from './types/category-mesh';\n\nexport {getMeshSize, getMeshBoundingBox} from './lib/mesh/mesh-utils';\n// Commented out due to https://github.com/visgl/deck.gl/issues/6906 and https://github.com/visgl/loaders.gl/issues/2177\n// export {convertMesh} from './category/mesh/convert-mesh';\nexport {\n deduceMeshSchema,\n deduceMeshField,\n makeMeshAttributeMetadata\n} from './lib/mesh/deduce-mesh-schema';\n\n// TEXTURES\nexport type {TextureLevel, GPUTextureFormat} from './types/category-texture';\n\n// IMAGES\nexport type {ImageDataType, ImageType, ImageTypeEnum} from './types/category-image';\n\n// TYPES\n// GIS CATEGORY - GEOJSON\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties,\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from './types/category-gis';\n\nexport type {GeojsonGeometryInfo} from './types/category-gis';\n\n// GIS CATEGORY - FLAT GEOJSON\nexport type {\n FlatFeature,\n FlatIndexedGeometry,\n FlatGeometry,\n FlatGeometryType,\n FlatPoint,\n FlatLineString,\n FlatPolygon\n} from './types/category-gis';\n\n// GIS CATEGORY - BINARY\nexport type {\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryAttribute\n} from './types/category-gis';\nexport type {\n BinaryFeatureCollection,\n BinaryFeature,\n BinaryPointFeature,\n BinaryLineFeature,\n BinaryPolygonFeature\n} from './types/category-gis';\n\n// SCHEMA\nexport {\n Schema as ArrowLikeSchema,\n Field as ArrowLikeField,\n DataType as ArrowLikeDataType,\n Null,\n Binary,\n Bool,\n Int,\n Int8,\n Int16,\n Int32,\n Int64,\n Uint8,\n Uint16,\n Uint32,\n Uint64,\n Float,\n Float16,\n Float32,\n Float64,\n Utf8,\n Date,\n DateDay,\n DateMillisecond,\n Time,\n TimeMillisecond,\n TimeSecond,\n Timestamp,\n TimestampSecond,\n TimestampMillisecond,\n TimestampMicrosecond,\n TimestampNanosecond,\n Interval,\n IntervalDayTime,\n IntervalYearMonth,\n FixedSizeList,\n Struct\n} from './lib/table/arrow-api';\n\n// EXPERIMENTAL APIs\n\n// SCHEMA UTILS\nexport {getTypeInfo} from './lib/table/arrow-api/get-type-info';\nexport {getArrowType} from './lib/table/arrow/arrow-type-utils';\n\nexport {default as AsyncQueue} from './lib/utils/async-queue';\n"],"mappings":"AAoCA,SAAQA,iBAAiB,QAAO,yCAAyC;AAEzE,SAAQC,uBAAuB,QAAO,gDAAgD;AACtF,SAAQC,4BAA4B,QAAO,qDAAqD;AAEhG,SACEC,cAAc,EACdC,eAAe,EACfC,YAAY,EACZC,gBAAgB,EAChBC,mBAAmB,EACnBC,kBAAkB,EAClBC,mBAAmB,EACnBC,kBAAkB,EAClBC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,QAChB,0CAA0C;AAEjD,SAAQC,cAAc,QAAO,wCAAwC;AAErE,SAAQC,iBAAiB,QAAO,qCAAqC;AACrE,SAAQC,YAAY,QAAO,wCAAwC;AACnE,SAAQC,iBAAiB,QAAO,uCAAuC;AACvE,SAAQC,kBAAkB,EAAEC,iBAAiB,QAAO,oCAAoC;AACxF,SAAQC,oBAAoB,QAAO,oCAAoC;AAYvE,SAAQC,WAAW,EAAEC,kBAAkB,QAAO,uBAAuB;AAGrE,SACEC,gBAAgB,EAChBC,eAAe,EACfC,yBAAyB,QACpB,+BAA+B;AAyDtC,SACEC,MAAM,IAAIC,eAAe,EACzBC,KAAK,IAAIC,cAAc,EACvBC,QAAQ,IAAIC,iBAAiB,EAC7BC,IAAI,EACJC,MAAM,EACNC,IAAI,EACJC,GAAG,EACHC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,IAAI,EACJC,IAAI,EACJC,OAAO,EACPC,eAAe,EACfC,IAAI,EACJC,eAAe,EACfC,UAAU,EACVC,SAAS,EACTC,eAAe,EACfC,oBAAoB,EACpBC,oBAAoB,EACpBC,mBAAmB,EACnBC,QAAQ,EACRC,eAAe,EACfC,iBAAiB,EACjBC,aAAa,EACbC,MAAM,QACD,uBAAuB;AAK9B,SAAQC,WAAW,QAAO,qCAAqC;AAC/D,SAAQC,YAAY,QAAO,oCAAoC;AAE/D,SAAQC,OAAO,IAAIC,UAAU,QAAO,yBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-mesh.js","names":["convertMesh","mesh","shape","options","convertMeshToColumnarTable","Error","concat","columns","columnName","attribute","Object","entries","attributes","value","schema","data"],"sources":["../../../../src/lib/mesh/convert-mesh.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Mesh} from '../../types/category-mesh';\nimport type {ColumnarTable, ArrowTable} from '../../types/category-table';\n// import {convertMeshToArrowTable} from './mesh-to-arrow-table';\n\ntype TargetShape = 'mesh' | 'columnar-table' | 'arrow-table';\n\n/**\n * Convert a mesh to a specific shape\n */\nexport function convertMesh(\n mesh: Mesh,\n shape: TargetShape,\n options?: any\n): Mesh | ColumnarTable | ArrowTable {\n switch (shape || 'mesh') {\n case 'mesh':\n return mesh;\n case 'columnar-table':\n return convertMeshToColumnarTable(mesh);\n // case 'arrow-table':\n // return {\n // shape: 'arrow-table',\n // data: convertMeshToArrowTable(mesh)\n // };\n default:\n throw new Error(`Unsupported shape ${options?.shape}`);\n }\n}\n\n/**\n * Convert a loaders.gl Mesh to a Columnar Table\n * @param mesh\n * @returns\n */\nexport function convertMeshToColumnarTable(mesh: Mesh): ColumnarTable {\n const columns = {};\n\n for (const [columnName, attribute] of Object.entries(mesh.attributes)) {\n columns[columnName] = attribute.value;\n }\n\n return {\n shape: 'columnar-table',\n schema: mesh.schema,\n data: columns\n };\n}\n"],"mappings":"AAWA,OAAO,SAASA,WAAWA,CACzBC,IAAU,EACVC,KAAkB,EAClBC,OAAa,EACsB;EACnC,QAAQD,KAAK,IAAI,MAAM;IACrB,KAAK,MAAM;MACT,OAAOD,IAAI;IACb,KAAK,gBAAgB;MACnB,OAAOG,0BAA0B,CAACH,IAAI,CAAC;IAMzC;MACE,MAAM,IAAII,KAAK,sBAAAC,MAAA,CAAsBH,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAED,KAAK,CAAE,CAAC;EAC1D;AACF;AAOA,OAAO,SAASE,0BAA0BA,CAACH,IAAU,EAAiB;EACpE,MAAMM,OAAO,GAAG,CAAC,CAAC;EAElB,KAAK,MAAM,CAACC,UAAU,EAAEC,SAAS,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACV,IAAI,CAACW,UAAU,CAAC,EAAE;IACrEL,OAAO,CAACC,UAAU,CAAC,GAAGC,SAAS,CAACI,KAAK;EACvC;EAEA,OAAO;IACLX,KAAK,EAAE,gBAAgB;IACvBY,MAAM,EAAEb,IAAI,CAACa,MAAM;IACnBC,IAAI,EAAER;EACR,CAAC;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deduce-mesh-schema.js","names":["getDataTypeFromTypedArray","deduceMeshSchema","attributes","metadata","arguments","length","undefined","fields","deduceMeshFields","deduceMeshField","name","attribute","optionalMetadata","type","value","makeMeshAttributeMetadata","listSize","size","children","nullable","attributeName","push","result","byteOffset","toString","byteStride","normalized"],"sources":["../../../../src/lib/mesh/deduce-mesh-schema.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {MeshAttribute, MeshAttributes} from '../../types/category-mesh';\nimport {Schema, Field} from '../../types/schema';\nimport {getDataTypeFromTypedArray} from '../table/simple-table/data-type';\n\n/**\n * Create a schema for mesh attributes data\n * @param attributes\n * @param metadata\n * @returns\n */\nexport function deduceMeshSchema(\n attributes: MeshAttributes,\n metadata: Record<string, string> = {}\n): Schema {\n const fields = deduceMeshFields(attributes);\n return {fields, metadata};\n}\n\n/**\n * Create arrow-like schema field for mesh attribute\n * @param attributeName\n * @param attribute\n * @param optionalMetadata\n * @returns\n */\nexport function deduceMeshField(\n name: string,\n attribute: MeshAttribute,\n optionalMetadata?: Record<string, string>\n): Field {\n const type = getDataTypeFromTypedArray(attribute.value);\n const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);\n return {\n name,\n type: {type: 'fixed-size-list', listSize: attribute.size, children: [{name: 'value', type}]},\n nullable: false,\n metadata\n };\n}\n\n/**\n * Create fields array for mesh attributes\n * @param attributes\n * @returns\n */\nfunction deduceMeshFields(attributes: MeshAttributes): Field[] {\n const fields: Field[] = [];\n for (const attributeName in attributes) {\n const attribute: MeshAttribute = attributes[attributeName];\n fields.push(deduceMeshField(attributeName, attribute));\n }\n return fields;\n}\n\n/**\n * Make metadata by mesh attribute properties\n * @param attribute\n * @returns\n */\nexport function makeMeshAttributeMetadata(attribute: MeshAttribute): Record<string, string> {\n const result: Record<string, string> = {};\n if ('byteOffset' in attribute) {\n result.byteOffset = attribute.byteOffset!.toString(10);\n }\n if ('byteStride' in attribute) {\n result.byteStride = attribute.byteStride!.toString(10);\n }\n if ('normalized' in attribute) {\n result.normalized = attribute.normalized!.toString();\n }\n return result;\n}\n"],"mappings":"AAIA,SAAQA,yBAAyB,QAAO,iCAAiC;AAQzE,OAAO,SAASC,gBAAgBA,CAC9BC,UAA0B,EAElB;EAAA,IADRC,QAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAErC,MAAMG,MAAM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I,UAAU,GAAGf,SAAS,CAACe,UAAU,CAAEF,QAAQ,CAAC,CAAC;EACtD;EACA,OAAOF,MAAM;AACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-to-arrow-table.js","names":[],"sources":["../../../../src/lib/mesh/mesh-to-arrow-table.ts"],"sourcesContent":["/* Problem with arrow dependency...\nimport {\n Table,\n Schema,\n RecordBatch,\n FixedSizeList,\n Field,\n Data,\n FixedSizeListVector\n} from 'apache-arrow';\nimport {AbstractVector} from 'apache-arrow/vector';\nimport {getArrowType, getArrowVector} from '../table/arrow/arrow-type-utils';\nimport type {Mesh} from './mesh-types';\nimport {makeMeshAttributeMetadata} from './deduce-mesh-schema';\n\n/**\n * * Convert a loaders.gl Mesh to an Apache Arrow Table\n * @param mesh\n * @param metadata\n * @param batchSize\n * @returns\n *\nexport function convertMeshToArrowTable(mesh: Mesh, batchSize?: number): Table {\n const vectors: AbstractVector[] = [];\n const fields: Field[] = [];\n for (const attributeKey in mesh.attributes) {\n const attribute = mesh.attributes[attributeKey];\n const {value, size = 1} = attribute;\n const type = getArrowType(value);\n const vector = getArrowVector(value);\n const listType = new FixedSizeList(size, new Field('value', type));\n const field = new Field(attributeKey, listType, false, makeMeshAttributeMetadata(attribute));\n const data = new Data(listType, 0, value.length / size, 0, undefined, [vector]);\n const listVector = new FixedSizeListVector(data);\n vectors.push(listVector);\n fields.push(field);\n }\n const schema = new Schema(fields, mesh?.schema?.metadata || new Map<string, string>());\n const recordBatch = new RecordBatch(schema, vectors[0].length, vectors);\n const table = new Table(schema, recordBatch);\n return table;\n}\n*/\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-utils.js","names":["getMeshSize","attributes","size","attributeName","attribute","ArrayBuffer","isView","byteLength","BYTES_PER_ELEMENT","getMeshBoundingBox","minX","Infinity","minY","minZ","maxX","maxY","maxZ","positions","POSITION","value","len","length","i","x","y","z"],"sources":["../../../../src/lib/mesh/mesh-utils.ts"],"sourcesContent":["// Mesh category utilities\n// TODO - move to mesh category module, or to math.gl/geometry module\nimport {TypedArray} from '../../types/types';\nimport {MeshAttributes} from '../../types/category-mesh';\n\ntype TypedArrays = {[key: string]: TypedArray};\n\n/**\n * Holds an axis aligned bounding box\n * TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)\n */\ntype BoundingBox = [[number, number, number], [number, number, number]];\n\n/**\n * Get number of vertices in mesh\n * @param attributes\n */\nexport function getMeshSize(attributes: TypedArrays): number {\n let size = 0;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n if (ArrayBuffer.isView(attribute)) {\n // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT\n size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;\n }\n }\n return size;\n}\n\n/**\n * Get the (axis aligned) bounding box of a mesh\n * @param attributes\n * @returns array of two vectors representing the axis aligned bounding box\n */\n// eslint-disable-next-line complexity\nexport function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {\n let minX = Infinity;\n let minY = Infinity;\n let minZ = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let maxZ = -Infinity;\n\n const positions = attributes.POSITION ? attributes.POSITION.value : [];\n const len = positions && positions.length;\n\n for (let i = 0; i < len; i += 3) {\n const x = positions[i];\n const y = positions[i + 1];\n const z = positions[i + 2];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n minZ = z < minZ ? z : minZ;\n\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n maxZ = z > maxZ ? z : maxZ;\n }\n return [\n [minX, minY, minZ],\n [maxX, maxY, maxZ]\n ];\n}\n"],"mappings":"AAiBA,OAAO,SAASA,WAAWA,CAACC,UAAuB,EAAU;EAC3D,IAAIC,IAAI,GAAG,CAAC;EACZ,KAAK,MAAMC,aAAa,IAAIF,UAAU,EAAE;IACtC,MAAMG,SAAS,GAAGH,UAAU,CAACE,aAAa,CAAC;IAC3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I,GAAGS,CAAC,GAAGT,IAAI;EAC5B;EACA,OAAO,CACL,CAACN,IAAI,EAAEE,IAAI,EAAEC,IAAI,CAAC,EAClB,CAACC,IAAI,EAAEC,IAAI,EAAEC,IAAI,CAAC,CACnB;AACH"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Float32, Float64, Int16, Int32, Int8, Uint16, Uint32, Uint8 } from 'apache-arrow';
|
|
2
|
-
export function getArrowType(array) {
|
|
3
|
-
switch (array.constructor) {
|
|
4
|
-
case Int8Array:
|
|
5
|
-
return new Int8();
|
|
6
|
-
case Uint8Array:
|
|
7
|
-
return new Uint8();
|
|
8
|
-
case Int16Array:
|
|
9
|
-
return new Int16();
|
|
10
|
-
case Uint16Array:
|
|
11
|
-
return new Uint16();
|
|
12
|
-
case Int32Array:
|
|
13
|
-
return new Int32();
|
|
14
|
-
case Uint32Array:
|
|
15
|
-
return new Uint32();
|
|
16
|
-
case Float32Array:
|
|
17
|
-
return new Float32();
|
|
18
|
-
case Float64Array:
|
|
19
|
-
return new Float64();
|
|
20
|
-
default:
|
|
21
|
-
throw new Error('array type not supported');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=arrow-type-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-type-utils.js","names":["Float32","Float64","Int16","Int32","Int8","Uint16","Uint32","Uint8","getArrowType","array","constructor","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","Error"],"sources":["../../../../../src/lib/table/arrow/arrow-type-utils.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {TypedArray} from '../../../types/types';\nimport {\n DataType,\n Float32,\n Float64,\n Int16,\n Int32,\n Int8,\n Uint16,\n Uint32,\n Uint8\n // Int8Vector,\n // Uint8Vector,\n // Int16Vector,\n // Uint16Vector,\n // Int32Vector,\n // Uint32Vector,\n // Float32Vector,\n // Float64Vector\n} from 'apache-arrow';\n// import {AbstractVector} from 'apache-arrow/vector';\n\nexport function getArrowType(array: TypedArray): DataType {\n switch (array.constructor) {\n case Int8Array:\n return new Int8();\n case Uint8Array:\n return new Uint8();\n case Int16Array:\n return new Int16();\n case Uint16Array:\n return new Uint16();\n case Int32Array:\n return new Int32();\n case Uint32Array:\n return new Uint32();\n case Float32Array:\n return new Float32();\n case Float64Array:\n return new Float64();\n default:\n throw new Error('array type not supported');\n }\n}\n\n/*\nexport function getArrowVector(array: TypedArray): AbstractVector {\n switch (array.constructor) {\n case Int8Array:\n return Int8Vector.from(array);\n case Uint8Array:\n return Uint8Vector.from(array);\n case Int16Array:\n return Int16Vector.from(array);\n case Uint16Array:\n return Uint16Vector.from(array);\n case Int32Array:\n return Int32Vector.from(array);\n case Uint32Array:\n return Uint32Vector.from(array);\n case Float32Array:\n return Float32Vector.from(array);\n case Float64Array:\n return Float64Vector.from(array);\n default:\n throw new Error('array type not supported');\n }\n}\n*/\n"],"mappings":"AAGA,SAEEA,OAAO,EACPC,OAAO,EACPC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,MAAM,EACNC,MAAM,EACNC,KAAK,QASA,cAAc;AAGrB,OAAO,SAASC,YAAYA,CAACC,KAAiB,EAAY;EACxD,QAAQA,KAAK,CAACC,WAAW;IACvB,KAAKC,SAAS;MACZ,OAAO,IAAIP,IAAI,CAAC,CAAC;IACnB,KAAKQ,UAAU;MACb,OAAO,IAAIL,KAAK,CAAC,CAAC;IACpB,KAAKM,UAAU;MACb,OAAO,IAAIX,KAAK,CAAC,CAAC;IACpB,KAAKY,WAAW;MACd,OAAO,IAAIT,MAAM,CAAC,CAAC;IACrB,KAAKU,UAAU;MACb,OAAO,IAAIZ,KAAK,CAAC,CAAC;IACpB,KAAKa,WAAW;MACd,OAAO,IAAIV,MAAM,CAAC,CAAC;IACrB,KAAKW,YAAY;MACf,OAAO,IAAIjB,OAAO,CAAC,CAAC;IACtB,KAAKkB,YAAY;MACf,OAAO,IAAIjB,OAAO,CAAC,CAAC;IACtB;MACE,MAAM,IAAIkB,KAAK,CAAC,0BAA0B,CAAC;EAC/C;AACF"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { Field as ArrowField, Schema as ArrowSchema, Null, Binary, Bool, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float16, Float32, Float64, Utf8, DateDay, DateMillisecond, TimeMillisecond, TimeSecond, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, IntervalDayTime, IntervalYearMonth, FixedSizeList, Struct } from 'apache-arrow/Arrow.dom';
|
|
2
|
-
export function serializeArrowSchema(arrowSchema) {
|
|
3
|
-
return {
|
|
4
|
-
fields: arrowSchema.fields.map(arrowField => serializeArrowField(arrowField)),
|
|
5
|
-
metadata: serializeArrowMetadata(arrowSchema.metadata)
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export function deserializeArrowSchema(schema) {
|
|
9
|
-
return new ArrowSchema(schema.fields.map(field => deserializeArrowField(field)), deserializeArrowMetadata(schema.metadata));
|
|
10
|
-
}
|
|
11
|
-
export function serializeArrowMetadata(arrowMetadata) {
|
|
12
|
-
return Object.fromEntries(arrowMetadata);
|
|
13
|
-
}
|
|
14
|
-
export function deserializeArrowMetadata(metadata) {
|
|
15
|
-
return metadata ? new Map(Object.entries(metadata)) : new Map();
|
|
16
|
-
}
|
|
17
|
-
export function serializeArrowField(field) {
|
|
18
|
-
return {
|
|
19
|
-
name: field.name,
|
|
20
|
-
type: serializeArrowType(field.type),
|
|
21
|
-
nullable: field.nullable,
|
|
22
|
-
metadata: serializeArrowMetadata(field.metadata)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export function deserializeArrowField(field) {
|
|
26
|
-
return new ArrowField(field.name, deserializeArrowType(field.type), field.nullable, deserializeArrowMetadata(field.metadata));
|
|
27
|
-
}
|
|
28
|
-
export function serializeArrowType(arrowType) {
|
|
29
|
-
switch (arrowType.constructor) {
|
|
30
|
-
case Null:
|
|
31
|
-
return 'null';
|
|
32
|
-
case Binary:
|
|
33
|
-
return 'binary';
|
|
34
|
-
case Bool:
|
|
35
|
-
return 'bool';
|
|
36
|
-
case Int8:
|
|
37
|
-
return 'int8';
|
|
38
|
-
case Int16:
|
|
39
|
-
return 'int16';
|
|
40
|
-
case Int32:
|
|
41
|
-
return 'int32';
|
|
42
|
-
case Int64:
|
|
43
|
-
return 'int64';
|
|
44
|
-
case Uint8:
|
|
45
|
-
return 'uint8';
|
|
46
|
-
case Uint16:
|
|
47
|
-
return 'uint16';
|
|
48
|
-
case Uint32:
|
|
49
|
-
return 'uint32';
|
|
50
|
-
case Uint64:
|
|
51
|
-
return 'uint64';
|
|
52
|
-
case Float16:
|
|
53
|
-
return 'float16';
|
|
54
|
-
case Float32:
|
|
55
|
-
return 'float32';
|
|
56
|
-
case Float64:
|
|
57
|
-
return 'float64';
|
|
58
|
-
case Utf8:
|
|
59
|
-
return 'utf8';
|
|
60
|
-
case DateDay:
|
|
61
|
-
return 'date-day';
|
|
62
|
-
case DateMillisecond:
|
|
63
|
-
return 'date-millisecond';
|
|
64
|
-
case TimeMillisecond:
|
|
65
|
-
return 'time-millisecond';
|
|
66
|
-
case TimeSecond:
|
|
67
|
-
return 'time-second';
|
|
68
|
-
case TimestampSecond:
|
|
69
|
-
return 'timestamp-second';
|
|
70
|
-
case TimestampMillisecond:
|
|
71
|
-
return 'timestamp-millisecond';
|
|
72
|
-
case TimestampMicrosecond:
|
|
73
|
-
return 'timestamp-microsecond';
|
|
74
|
-
case TimestampNanosecond:
|
|
75
|
-
return 'timestamp-nanosecond';
|
|
76
|
-
case IntervalDayTime:
|
|
77
|
-
return 'interval-daytime';
|
|
78
|
-
case IntervalYearMonth:
|
|
79
|
-
return 'interval-yearmonth';
|
|
80
|
-
case FixedSizeList:
|
|
81
|
-
return {
|
|
82
|
-
type: 'fixed-size-list',
|
|
83
|
-
listSize: arrowType.listSize,
|
|
84
|
-
children: [serializeArrowField(arrowType.children[0])]
|
|
85
|
-
};
|
|
86
|
-
default:
|
|
87
|
-
throw new Error('array type not supported');
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
export function deserializeArrowType(dataType) {
|
|
91
|
-
if (typeof dataType === 'object') {
|
|
92
|
-
switch (dataType.type) {
|
|
93
|
-
case 'fixed-size-list':
|
|
94
|
-
const child = deserializeArrowField(dataType.children[0]);
|
|
95
|
-
return new FixedSizeList(dataType.listSize, child);
|
|
96
|
-
case 'struct':
|
|
97
|
-
const children = dataType.children.map(arrowField => deserializeArrowField(arrowField));
|
|
98
|
-
return new Struct(children);
|
|
99
|
-
default:
|
|
100
|
-
throw new Error('array type not supported');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
switch (dataType) {
|
|
104
|
-
case 'null':
|
|
105
|
-
return new Null();
|
|
106
|
-
case 'binary':
|
|
107
|
-
return new Binary();
|
|
108
|
-
case 'bool':
|
|
109
|
-
return new Bool();
|
|
110
|
-
case 'int8':
|
|
111
|
-
return new Int8();
|
|
112
|
-
case 'int16':
|
|
113
|
-
return new Int16();
|
|
114
|
-
case 'int32':
|
|
115
|
-
return new Int32();
|
|
116
|
-
case 'int64':
|
|
117
|
-
return new Int64();
|
|
118
|
-
case 'uint8':
|
|
119
|
-
return new Uint8();
|
|
120
|
-
case 'uint16':
|
|
121
|
-
return new Uint16();
|
|
122
|
-
case 'uint32':
|
|
123
|
-
return new Uint32();
|
|
124
|
-
case 'uint64':
|
|
125
|
-
return new Uint64();
|
|
126
|
-
case 'float16':
|
|
127
|
-
return new Float16();
|
|
128
|
-
case 'float32':
|
|
129
|
-
return new Float32();
|
|
130
|
-
case 'float64':
|
|
131
|
-
return new Float64();
|
|
132
|
-
case 'utf8':
|
|
133
|
-
return new Utf8();
|
|
134
|
-
case 'date-day':
|
|
135
|
-
return new DateDay();
|
|
136
|
-
case 'date-millisecond':
|
|
137
|
-
return new DateMillisecond();
|
|
138
|
-
case 'time-millisecond':
|
|
139
|
-
return new TimeMillisecond();
|
|
140
|
-
case 'time-second':
|
|
141
|
-
return new TimeSecond();
|
|
142
|
-
case 'timestamp-second':
|
|
143
|
-
return new TimestampSecond();
|
|
144
|
-
case 'timestamp-millisecond':
|
|
145
|
-
return new TimestampMillisecond();
|
|
146
|
-
case 'timestamp-microsecond':
|
|
147
|
-
return new TimestampMicrosecond();
|
|
148
|
-
case 'timestamp-nanosecond':
|
|
149
|
-
return new TimestampNanosecond();
|
|
150
|
-
case 'interval-daytime':
|
|
151
|
-
return new IntervalDayTime();
|
|
152
|
-
case 'interval-yearmonth':
|
|
153
|
-
return new IntervalYearMonth();
|
|
154
|
-
default:
|
|
155
|
-
throw new Error('array type not supported');
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
//# sourceMappingURL=convert-schema-arrow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-schema-arrow.js","names":["Field","ArrowField","Schema","ArrowSchema","Null","Binary","Bool","Int8","Int16","Int32","Int64","Uint8","Uint16","Uint32","Uint64","Float16","Float32","Float64","Utf8","DateDay","DateMillisecond","TimeMillisecond","TimeSecond","TimestampSecond","TimestampMillisecond","TimestampMicrosecond","TimestampNanosecond","IntervalDayTime","IntervalYearMonth","FixedSizeList","Struct","serializeArrowSchema","arrowSchema","fields","map","arrowField","serializeArrowField","metadata","serializeArrowMetadata","deserializeArrowSchema","schema","field","deserializeArrowField","deserializeArrowMetadata","arrowMetadata","Object","fromEntries","Map","entries","name","type","serializeArrowType","nullable","deserializeArrowType","arrowType","constructor","listSize","children","Error","dataType","child"],"sources":["../../../../../src/lib/table/arrow/convert-schema-arrow.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {DataType, Field, Schema, SchemaMetadata} from '../../../types/schema';\nimport {\n Field as ArrowField,\n Schema as ArrowSchema,\n DataType as ArrowDataType,\n Null,\n Binary,\n Bool,\n // Int,\n Int8,\n Int16,\n Int32,\n Int64,\n Uint8,\n Uint16,\n Uint32,\n Uint64,\n // Float,\n Float16,\n Float32,\n Float64,\n Utf8,\n // Date,\n DateDay,\n DateMillisecond,\n // Time,\n TimeMillisecond,\n TimeSecond,\n // Timestamp,\n TimestampSecond,\n TimestampMillisecond,\n TimestampMicrosecond,\n TimestampNanosecond,\n // Interval,\n IntervalDayTime,\n IntervalYearMonth,\n FixedSizeList,\n Struct\n} from 'apache-arrow/Arrow.dom';\n\nexport function serializeArrowSchema(arrowSchema: ArrowSchema): Schema {\n return {\n fields: arrowSchema.fields.map((arrowField) => serializeArrowField(arrowField)),\n metadata: serializeArrowMetadata(arrowSchema.metadata)\n };\n}\n\nexport function deserializeArrowSchema(schema: Schema): ArrowSchema {\n return new ArrowSchema(\n schema.fields.map((field) => deserializeArrowField(field)),\n deserializeArrowMetadata(schema.metadata)\n );\n}\n\nexport function serializeArrowMetadata(arrowMetadata: Map<string, string>): SchemaMetadata {\n return Object.fromEntries(arrowMetadata);\n}\n\nexport function deserializeArrowMetadata(metadata?: SchemaMetadata): Map<string, string> {\n return metadata ? new Map(Object.entries(metadata)) : new Map<string, string>();\n}\n\nexport function serializeArrowField(field: ArrowField): Field {\n return {\n name: field.name,\n type: serializeArrowType(field.type),\n nullable: field.nullable,\n metadata: serializeArrowMetadata(field.metadata)\n };\n}\n\nexport function deserializeArrowField(field: Field): ArrowField {\n return new ArrowField(\n field.name,\n deserializeArrowType(field.type),\n field.nullable,\n deserializeArrowMetadata(field.metadata)\n );\n}\n\n/** Converts a serializable loaders.gl data type to hydrated arrow data type */\n// eslint-disable-next-line complexity\nexport function serializeArrowType(arrowType: ArrowDataType): DataType {\n switch (arrowType.constructor) {\n case Null:\n return 'null';\n case Binary:\n return 'binary';\n case Bool:\n return 'bool';\n // case Int: return 'int';\n case Int8:\n return 'int8';\n case Int16:\n return 'int16';\n case Int32:\n return 'int32';\n case Int64:\n return 'int64';\n case Uint8:\n return 'uint8';\n case Uint16:\n return 'uint16';\n case Uint32:\n return 'uint32';\n case Uint64:\n return 'uint64';\n // case Float: return 'float';\n case Float16:\n return 'float16';\n case Float32:\n return 'float32';\n case Float64:\n return 'float64';\n case Utf8:\n return 'utf8';\n // case Date: return 'date';\n case DateDay:\n return 'date-day';\n case DateMillisecond:\n return 'date-millisecond';\n // case Time: return 'time';\n case TimeMillisecond:\n return 'time-millisecond';\n case TimeSecond:\n return 'time-second';\n // case Timestamp: return 'timestamp';\n case TimestampSecond:\n return 'timestamp-second';\n case TimestampMillisecond:\n return 'timestamp-millisecond';\n case TimestampMicrosecond:\n return 'timestamp-microsecond';\n case TimestampNanosecond:\n return 'timestamp-nanosecond';\n // case Interval: return 'interval';\n case IntervalDayTime:\n return 'interval-daytime';\n case IntervalYearMonth:\n return 'interval-yearmonth';\n case FixedSizeList:\n return {\n type: 'fixed-size-list',\n listSize: (arrowType as FixedSizeList).listSize,\n children: [serializeArrowField((arrowType as FixedSizeList).children[0])]\n };\n // case Struct:\n // return {type: 'struct', children: (arrowType as Struct).children};\n default:\n throw new Error('array type not supported');\n }\n}\n\n/** Converts a serializable loaders.gl data type to hydrated arrow data type */\n// eslint-disable-next-line complexity\nexport function deserializeArrowType(dataType: DataType): ArrowDataType {\n if (typeof dataType === 'object') {\n switch (dataType.type) {\n case 'fixed-size-list':\n const child = deserializeArrowField(dataType.children[0]);\n return new FixedSizeList(dataType.listSize, child);\n case 'struct':\n const children = dataType.children.map((arrowField) => deserializeArrowField(arrowField));\n return new Struct(children);\n default:\n throw new Error('array type not supported');\n }\n }\n\n switch (dataType) {\n case 'null':\n return new Null();\n case 'binary':\n return new Binary();\n case 'bool':\n return new Bool();\n // case 'int': return new Int();\n case 'int8':\n return new Int8();\n case 'int16':\n return new Int16();\n case 'int32':\n return new Int32();\n case 'int64':\n return new Int64();\n case 'uint8':\n return new Uint8();\n case 'uint16':\n return new Uint16();\n case 'uint32':\n return new Uint32();\n case 'uint64':\n return new Uint64();\n // case 'float': return new Float();\n case 'float16':\n return new Float16();\n case 'float32':\n return new Float32();\n case 'float64':\n return new Float64();\n case 'utf8':\n return new Utf8();\n // case 'date': return new Date();\n case 'date-day':\n return new DateDay();\n case 'date-millisecond':\n return new DateMillisecond();\n // case 'time': return new Time();\n case 'time-millisecond':\n return new TimeMillisecond();\n case 'time-second':\n return new TimeSecond();\n // case 'timestamp': return new Timestamp();\n case 'timestamp-second':\n return new TimestampSecond();\n case 'timestamp-millisecond':\n return new TimestampMillisecond();\n case 'timestamp-microsecond':\n return new TimestampMicrosecond();\n case 'timestamp-nanosecond':\n return new TimestampNanosecond();\n // case 'interval': return new Interval();\n case 'interval-daytime':\n return new IntervalDayTime();\n case 'interval-yearmonth':\n return new IntervalYearMonth();\n default:\n throw new Error('array type not supported');\n }\n}\n"],"mappings":"AAGA,SACEA,KAAK,IAAIC,UAAU,EACnBC,MAAM,IAAIC,WAAW,EAErBC,IAAI,EACJC,MAAM,EACNC,IAAI,EAEJC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,MAAM,EAENC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,IAAI,EAEJC,OAAO,EACPC,eAAe,EAEfC,eAAe,EACfC,UAAU,EAEVC,eAAe,EACfC,oBAAoB,EACpBC,oBAAoB,EACpBC,mBAAmB,EAEnBC,eAAe,EACfC,iBAAiB,EACjBC,aAAa,EACbC,MAAM,QACD,wBAAwB;AAE/B,OAAO,SAASC,oBAAoBA,CAACC,WAAwB,EAAU;EACrE,OAAO;IACLC,MAAM,EAAED,WAAW,CAACC,MAAM,CAACC,GAAG,CAAEC,UAAU,IAAKC,mBAAmB,CAACD,UAAU,CAAC,CAAC;IAC/EE,QAAQ,EAAEC,sBAAsB,CAACN,WAAW,CAACK,QAAQ;EACvD,CAAC;AACH;AAEA,OAAO,SAASE,sBAAsBA,CAACC,MAAc,EAAe;EAClE,OAAO,IAAIrC,WAAW,CACpBqC,MAAM,CAACP,MAAM,CAACC,GAAG,CAAEO,KAAK,IAAKC,qBAAqB,CAACD,KAA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