@loaders.gl/schema 3.1.0-alpha.3 → 3.1.0-beta.2
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/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +1288 -4
- package/dist/category/common.d.ts +20 -0
- package/dist/category/common.d.ts.map +1 -0
- package/dist/category/common.js +10 -2
- package/dist/category/gis.d.ts +50 -0
- package/dist/category/gis.d.ts.map +1 -0
- package/dist/category/gis.js +2 -2
- package/dist/category/mesh/convert-mesh.d.ts +15 -0
- package/dist/category/mesh/convert-mesh.d.ts.map +1 -0
- package/dist/category/mesh/convert-mesh.js +37 -31
- package/dist/category/mesh/deduce-mesh-schema.d.ts +24 -0
- package/dist/category/mesh/deduce-mesh-schema.d.ts.map +1 -0
- package/dist/category/mesh/deduce-mesh-schema.js +57 -37
- package/dist/category/mesh/mesh-to-arrow-table.d.ts +1 -0
- package/dist/category/mesh/mesh-to-arrow-table.d.ts.map +1 -0
- package/dist/category/mesh/mesh-to-arrow-table.js +28 -15
- package/dist/category/mesh/mesh-types.d.ts +50 -0
- package/dist/category/mesh/mesh-types.d.ts.map +1 -0
- package/dist/category/mesh/mesh-types.js +2 -2
- package/dist/category/mesh/mesh-utils.d.ts +23 -0
- package/dist/category/mesh/mesh-utils.d.ts.map +1 -0
- package/dist/category/mesh/mesh-utils.js +48 -35
- package/dist/category/table/deduce-table-schema.d.ts +9 -0
- package/dist/category/table/deduce-table-schema.d.ts.map +1 -0
- package/dist/category/table/deduce-table-schema.js +94 -39
- package/dist/category/table/table-types.d.ts +78 -0
- package/dist/category/table/table-types.d.ts.map +1 -0
- package/dist/category/table/table-types.js +2 -2
- package/dist/es5/bundle.js +7 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/category/common.js +2 -0
- package/dist/{category → es5/category}/common.js.map +0 -0
- package/dist/es5/category/gis.js +2 -0
- package/dist/{category → es5/category}/gis.js.map +0 -0
- package/dist/es5/category/mesh/convert-mesh.js +35 -0
- package/dist/es5/category/mesh/convert-mesh.js.map +1 -0
- package/dist/es5/category/mesh/deduce-mesh-schema.js +54 -0
- package/dist/es5/category/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/es5/category/mesh/mesh-to-arrow-table.js +2 -0
- package/dist/es5/category/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/es5/category/mesh/mesh-types.js +2 -0
- package/dist/{category → es5/category}/mesh/mesh-types.js.map +0 -0
- package/dist/es5/category/mesh/mesh-utils.js +47 -0
- package/dist/es5/category/mesh/mesh-utils.js.map +1 -0
- package/dist/es5/category/table/deduce-table-schema.js +58 -0
- package/dist/es5/category/table/deduce-table-schema.js.map +1 -0
- package/dist/es5/category/table/table-types.js +2 -0
- package/dist/{category → es5/category}/table/table-types.js.map +0 -0
- package/dist/es5/index.js +344 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/lib/arrow/arrow-like-type-utils.js +40 -0
- package/dist/es5/lib/arrow/arrow-like-type-utils.js.map +1 -0
- package/dist/es5/lib/arrow/arrow-type-utils.js +2 -0
- package/dist/es5/lib/arrow/arrow-type-utils.js.map +1 -0
- package/dist/es5/lib/arrow/get-type-info.js +33 -0
- package/dist/es5/lib/arrow/get-type-info.js.map +1 -0
- package/dist/es5/lib/batches/base-table-batch-aggregator.js +81 -0
- package/dist/es5/lib/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js +109 -0
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/row-table-batch-aggregator.js +102 -0
- package/dist/es5/lib/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/table-batch-aggregator.js +2 -0
- package/dist/{lib → es5/lib}/batches/table-batch-aggregator.js.map +0 -0
- package/dist/es5/lib/batches/table-batch-builder.js +187 -0
- package/dist/es5/lib/batches/table-batch-builder.js.map +1 -0
- package/dist/es5/lib/schema/impl/enum.js +56 -0
- package/dist/es5/lib/schema/impl/enum.js.map +1 -0
- package/dist/es5/lib/schema/impl/field.js +43 -0
- package/dist/es5/lib/schema/impl/field.js.map +1 -0
- package/dist/es5/lib/schema/impl/schema.js +103 -0
- package/dist/es5/lib/schema/impl/schema.js.map +1 -0
- package/dist/es5/lib/schema/impl/type.js +594 -0
- package/dist/es5/lib/schema/impl/type.js.map +1 -0
- package/dist/es5/lib/schema/schema.js +236 -0
- package/dist/es5/lib/schema/schema.js.map +1 -0
- package/dist/es5/lib/schema-utils/deduce-column-type.js +32 -0
- package/dist/es5/lib/schema-utils/deduce-column-type.js.map +1 -0
- package/dist/es5/lib/utils/assert.js +13 -0
- package/dist/es5/lib/utils/assert.js.map +1 -0
- package/dist/es5/lib/utils/async-queue.js +130 -0
- package/dist/es5/lib/utils/async-queue.js.map +1 -0
- package/dist/es5/lib/utils/row-utils.js +44 -0
- package/dist/es5/lib/utils/row-utils.js.map +1 -0
- package/dist/es5/types.js +2 -0
- package/dist/{types.js.map → es5/types.js.map} +0 -0
- package/dist/esm/bundle.js +5 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/category/common.js +2 -0
- package/dist/esm/category/common.js.map +1 -0
- package/dist/esm/category/gis.js +2 -0
- package/dist/esm/category/gis.js.map +1 -0
- package/dist/esm/category/mesh/convert-mesh.js +26 -0
- package/dist/esm/category/mesh/convert-mesh.js.map +1 -0
- package/dist/esm/category/mesh/deduce-mesh-schema.js +42 -0
- package/dist/esm/category/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/esm/category/mesh/mesh-to-arrow-table.js +2 -0
- package/dist/esm/category/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/esm/category/mesh/mesh-types.js +2 -0
- package/dist/esm/category/mesh/mesh-types.js.map +1 -0
- package/dist/esm/category/mesh/mesh-utils.js +38 -0
- package/dist/esm/category/mesh/mesh-utils.js.map +1 -0
- package/dist/esm/category/table/deduce-table-schema.js +51 -0
- package/dist/esm/category/table/deduce-table-schema.js.map +1 -0
- package/dist/esm/category/table/table-types.js +2 -0
- package/dist/esm/category/table/table-types.js.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/arrow/arrow-like-type-utils.js +32 -0
- package/dist/esm/lib/arrow/arrow-like-type-utils.js.map +1 -0
- package/dist/esm/lib/arrow/arrow-type-utils.js +2 -0
- package/dist/esm/lib/arrow/arrow-type-utils.js.map +1 -0
- package/dist/esm/lib/arrow/get-type-info.js +24 -0
- package/dist/esm/lib/arrow/get-type-info.js.map +1 -0
- package/dist/esm/lib/batches/base-table-batch-aggregator.js +74 -0
- package/dist/esm/lib/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js +100 -0
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/row-table-batch-aggregator.js +95 -0
- package/dist/esm/lib/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/table-batch-aggregator.js +2 -0
- package/dist/esm/lib/batches/table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/table-batch-builder.js +182 -0
- package/dist/esm/lib/batches/table-batch-builder.js.map +1 -0
- package/dist/esm/lib/schema/impl/enum.js +49 -0
- package/dist/esm/lib/schema/impl/enum.js.map +1 -0
- package/dist/esm/lib/schema/impl/field.js +35 -0
- package/dist/esm/lib/schema/impl/field.js.map +1 -0
- package/dist/esm/lib/schema/impl/schema.js +92 -0
- package/dist/esm/lib/schema/impl/schema.js.map +1 -0
- package/dist/esm/lib/schema/impl/type.js +498 -0
- package/dist/esm/lib/schema/impl/type.js.map +1 -0
- package/dist/{lib/schema/index.js → esm/lib/schema/schema.js} +1 -1
- package/dist/esm/lib/schema/schema.js.map +1 -0
- package/dist/esm/lib/schema-utils/deduce-column-type.js +23 -0
- package/dist/esm/lib/schema-utils/deduce-column-type.js.map +1 -0
- package/dist/esm/lib/utils/assert.js +6 -0
- package/dist/esm/lib/utils/assert.js.map +1 -0
- package/dist/esm/lib/utils/async-queue.js +119 -0
- package/dist/esm/lib/utils/async-queue.js.map +1 -0
- package/dist/esm/lib/utils/row-utils.js +35 -0
- package/dist/esm/lib/utils/row-utils.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -13
- package/dist/lib/arrow/arrow-like-type-utils.d.ts +4 -0
- package/dist/lib/arrow/arrow-like-type-utils.d.ts.map +1 -0
- package/dist/lib/arrow/arrow-like-type-utils.js +26 -31
- package/dist/lib/arrow/arrow-type-utils.d.ts +1 -0
- package/dist/lib/arrow/arrow-type-utils.d.ts.map +1 -0
- package/dist/lib/arrow/arrow-type-utils.js +28 -20
- package/dist/lib/arrow/get-type-info.d.ts +14 -0
- package/dist/lib/arrow/get-type-info.d.ts.map +1 -0
- package/dist/lib/arrow/get-type-info.js +23 -19
- package/dist/lib/batches/base-table-batch-aggregator.d.ts +19 -0
- package/dist/lib/batches/base-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/base-table-batch-aggregator.js +52 -68
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts +23 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.js +82 -92
- package/dist/lib/batches/row-table-batch-aggregator.d.ts +22 -0
- package/dist/lib/batches/row-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/row-table-batch-aggregator.js +72 -88
- package/dist/lib/batches/table-batch-aggregator.d.ts +25 -0
- package/dist/lib/batches/table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/table-batch-aggregator.js +2 -2
- package/dist/lib/batches/table-batch-builder.d.ts +53 -0
- package/dist/lib/batches/table-batch-builder.d.ts.map +1 -0
- package/dist/lib/batches/table-batch-builder.js +137 -166
- package/dist/lib/schema/impl/enum.d.ts +92 -0
- package/dist/lib/schema/impl/enum.d.ts.map +1 -0
- package/dist/lib/schema/impl/enum.js +96 -48
- package/dist/lib/schema/impl/field.d.ts +19 -0
- package/dist/lib/schema/impl/field.d.ts.map +1 -0
- package/dist/lib/schema/impl/field.js +31 -34
- package/dist/lib/schema/impl/schema.d.ts +16 -0
- package/dist/lib/schema/impl/schema.d.ts.map +1 -0
- package/dist/lib/schema/impl/schema.js +72 -81
- package/dist/lib/schema/impl/type.d.ts +176 -0
- package/dist/lib/schema/impl/type.d.ts.map +1 -0
- package/dist/lib/schema/impl/type.js +454 -490
- package/dist/lib/schema/schema.d.ts +5 -0
- package/dist/lib/schema/schema.d.ts.map +1 -0
- package/dist/lib/schema/schema.js +90 -0
- package/dist/lib/schema-utils/deduce-column-type.d.ts +3 -0
- package/dist/lib/schema-utils/deduce-column-type.d.ts.map +1 -0
- package/dist/lib/schema-utils/deduce-column-type.js +89 -20
- package/dist/lib/utils/assert.d.ts +2 -0
- package/dist/lib/utils/assert.d.ts.map +1 -0
- package/dist/lib/utils/assert.js +11 -5
- package/dist/lib/utils/async-queue.d.ts +18 -0
- package/dist/lib/utils/async-queue.d.ts.map +1 -0
- package/dist/lib/utils/async-queue.js +82 -109
- package/dist/lib/utils/row-utils.d.ts +9 -0
- package/dist/lib/utils/row-utils.d.ts.map +1 -0
- package/dist/lib/utils/row-utils.js +31 -33
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -2
- package/package.json +7 -9
- package/src/category/common.ts +2 -1
- package/src/category/mesh/convert-mesh.ts +6 -6
- package/src/category/mesh/deduce-mesh-schema.ts +1 -1
- package/src/category/mesh/mesh-to-arrow-table.ts +4 -2
- package/src/category/mesh/mesh-types.ts +1 -1
- package/src/category/table/deduce-table-schema.ts +1 -1
- package/src/category/table/table-types.ts +5 -2
- package/src/index.ts +1 -1
- package/src/lib/arrow/arrow-like-type-utils.ts +11 -1
- package/src/lib/arrow/arrow-type-utils.ts +3 -1
- package/src/lib/arrow/get-type-info.ts +1 -1
- package/src/lib/batches/base-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/columnar-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/row-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/table-batch-aggregator.ts +1 -1
- package/src/lib/batches/table-batch-builder.ts +2 -2
- package/src/lib/schema/impl/schema.ts +2 -2
- package/src/lib/schema/impl/type.ts +2 -2
- package/src/lib/schema/{index.ts → schema.ts} +0 -0
- package/src/lib/schema-utils/deduce-column-type.ts +6 -2
- package/src/lib/utils/async-queue.ts +7 -4
- package/dist/bundle.js.map +0 -1
- package/dist/category/mesh/convert-mesh.js.map +0 -1
- package/dist/category/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/category/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/category/mesh/mesh-utils.js.map +0 -1
- package/dist/category/table/deduce-table-schema.js.map +0 -1
- package/dist/dist.min.js +0 -2
- package/dist/dist.min.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/arrow/arrow-like-type-utils.js.map +0 -1
- package/dist/lib/arrow/arrow-type-utils.js.map +0 -1
- package/dist/lib/arrow/get-type-info.js.map +0 -1
- package/dist/lib/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/table-batch-builder.js.map +0 -1
- package/dist/lib/schema/impl/enum.js.map +0 -1
- package/dist/lib/schema/impl/field.js.map +0 -1
- package/dist/lib/schema/impl/schema.js.map +0 -1
- package/dist/lib/schema/impl/type.js.map +0 -1
- package/dist/lib/schema/index.js.map +0 -1
- package/dist/lib/schema-utils/deduce-column-type.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/lib/utils/row-utils.js.map +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "Schema", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _schema.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "Field", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return _field.default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "Type", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _type.Type;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "DataType", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () {
|
|
29
|
+
return _type.DataType;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "Null", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _type.Null;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "Bool", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _type.Bool;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "Int", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _type.Int;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "Int8", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () {
|
|
53
|
+
return _type.Int8;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "Int16", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return _type.Int16;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "Int32", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () {
|
|
65
|
+
return _type.Int32;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "Int64", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return _type.Int64;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(exports, "Uint8", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function () {
|
|
77
|
+
return _type.Uint8;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "Uint16", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () {
|
|
83
|
+
return _type.Uint16;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(exports, "Uint32", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function () {
|
|
89
|
+
return _type.Uint32;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, "Uint64", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () {
|
|
95
|
+
return _type.Uint64;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, "Float", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () {
|
|
101
|
+
return _type.Float;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(exports, "Float16", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function () {
|
|
107
|
+
return _type.Float16;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(exports, "Float32", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function () {
|
|
113
|
+
return _type.Float32;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(exports, "Float64", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function () {
|
|
119
|
+
return _type.Float64;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, "Binary", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function () {
|
|
125
|
+
return _type.Binary;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
Object.defineProperty(exports, "Utf8", {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function () {
|
|
131
|
+
return _type.Utf8;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(exports, "Date", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function () {
|
|
137
|
+
return _type.Date;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(exports, "DateDay", {
|
|
141
|
+
enumerable: true,
|
|
142
|
+
get: function () {
|
|
143
|
+
return _type.DateDay;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(exports, "DateMillisecond", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function () {
|
|
149
|
+
return _type.DateMillisecond;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(exports, "Time", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: function () {
|
|
155
|
+
return _type.Time;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
Object.defineProperty(exports, "TimeSecond", {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: function () {
|
|
161
|
+
return _type.TimeSecond;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(exports, "TimeMillisecond", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function () {
|
|
167
|
+
return _type.TimeMillisecond;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
Object.defineProperty(exports, "Timestamp", {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
get: function () {
|
|
173
|
+
return _type.Timestamp;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
Object.defineProperty(exports, "TimestampSecond", {
|
|
177
|
+
enumerable: true,
|
|
178
|
+
get: function () {
|
|
179
|
+
return _type.TimestampSecond;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
Object.defineProperty(exports, "TimestampMillisecond", {
|
|
183
|
+
enumerable: true,
|
|
184
|
+
get: function () {
|
|
185
|
+
return _type.TimestampMillisecond;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
Object.defineProperty(exports, "TimestampMicrosecond", {
|
|
189
|
+
enumerable: true,
|
|
190
|
+
get: function () {
|
|
191
|
+
return _type.TimestampMicrosecond;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(exports, "TimestampNanosecond", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function () {
|
|
197
|
+
return _type.TimestampNanosecond;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
Object.defineProperty(exports, "Interval", {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function () {
|
|
203
|
+
return _type.Interval;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
Object.defineProperty(exports, "IntervalDayTime", {
|
|
207
|
+
enumerable: true,
|
|
208
|
+
get: function () {
|
|
209
|
+
return _type.IntervalDayTime;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
Object.defineProperty(exports, "IntervalYearMonth", {
|
|
213
|
+
enumerable: true,
|
|
214
|
+
get: function () {
|
|
215
|
+
return _type.IntervalYearMonth;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
Object.defineProperty(exports, "FixedSizeList", {
|
|
219
|
+
enumerable: true,
|
|
220
|
+
get: function () {
|
|
221
|
+
return _type.FixedSizeList;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
Object.defineProperty(exports, "Struct", {
|
|
225
|
+
enumerable: true,
|
|
226
|
+
get: function () {
|
|
227
|
+
return _type.Struct;
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
var _schema = _interopRequireDefault(require("./impl/schema"));
|
|
232
|
+
|
|
233
|
+
var _field = _interopRequireDefault(require("./impl/field"));
|
|
234
|
+
|
|
235
|
+
var _type = require("./impl/type");
|
|
236
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/schema/schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;;AACA;;AACA","sourcesContent":["/*\nexport {\n Schema,\n Field,\n DataType,\n Null,\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,\n DateDay,\n DateMillisecond,\n Time,\n TimeSecond,\n TimeMillisecond,\n TimeMicrosecond,\n TimeNanosecond,\n Timestamp,\n TimestampSecond,\n TimestampMillisecond,\n TimestampMicrosecond,\n TimestampNanosecond,\n Interval,\n IntervalDayTime,\n IntervalYearMonth,\n FixedSizeList\n} from 'apache-arrow';\n*/\nexport {default as Schema} from './impl/schema';\nexport {default as Field} from './impl/field';\nexport {Type} from './impl/type';\nexport {\n DataType,\n Null,\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,\n DateDay,\n DateMillisecond,\n Time,\n TimeSecond,\n TimeMillisecond,\n // TimeMicrosecond,\n // TimeNanosecond,\n Timestamp,\n TimestampSecond,\n TimestampMillisecond,\n TimestampMicrosecond,\n TimestampNanosecond,\n Interval,\n IntervalDayTime,\n IntervalYearMonth,\n FixedSizeList,\n Struct\n} from './impl/type';\n"],"file":"schema.js"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.deduceTypeFromColumn = deduceTypeFromColumn;
|
|
7
|
+
exports.deduceTypeFromValue = deduceTypeFromValue;
|
|
8
|
+
|
|
9
|
+
function deduceTypeFromColumn(value) {
|
|
10
|
+
if (value instanceof Date) {
|
|
11
|
+
return Date;
|
|
12
|
+
} else if (value instanceof Number) {
|
|
13
|
+
return Float32Array;
|
|
14
|
+
} else if (typeof value === 'string') {
|
|
15
|
+
return String;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function deduceTypeFromValue(value) {
|
|
22
|
+
if (value instanceof Date) {
|
|
23
|
+
return Date;
|
|
24
|
+
} else if (value instanceof Number) {
|
|
25
|
+
return Float32Array;
|
|
26
|
+
} else if (typeof value === 'string') {
|
|
27
|
+
return String;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=deduce-column-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/schema-utils/deduce-column-type.ts"],"names":["deduceTypeFromColumn","value","Date","Number","Float32Array","String","deduceTypeFromValue"],"mappings":";;;;;;;;AAmCO,SAASA,oBAAT,CACLC,KADK,EAEiE;AACtE,MAAIA,KAAK,YAAYC,IAArB,EAA2B;AACzB,WAAOA,IAAP;AACD,GAFD,MAEO,IAAID,KAAK,YAAYE,MAArB,EAA6B;AAClC,WAAOC,YAAP;AACD,GAFM,MAEA,IAAI,OAAOH,KAAP,KAAiB,QAArB,EAA+B;AACpC,WAAOI,MAAP;AACD;;AACD,SAAO,IAAP;AACD;;AAEM,SAASC,mBAAT,CACLL,KADK,EAEiE;AACtE,MAAIA,KAAK,YAAYC,IAArB,EAA2B;AACzB,WAAOA,IAAP;AACD,GAFD,MAEO,IAAID,KAAK,YAAYE,MAArB,EAA6B;AAClC,WAAOC,YAAP;AACD,GAFM,MAEA,IAAI,OAAOH,KAAP,KAAiB,QAArB,EAA+B;AACpC,WAAOI,MAAP;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["// Type deduction\n// import {\n// Schema\n// Int,\n// Int8,\n// Int16,\n// Int32,\n// Uint8,\n// Uint16,\n// Uint32,\n// Float32,\n// Float64\n// Bool,\n// Utf8,\n// TimestampMillisecond,\n// Null\n// } from '../schema';\n\n// const TYPED_ARRAY_TO_TYPE = {\n// Int8Array: new Int8(),\n// Int16Array: new Int16(),\n// Int32Array: new Int32(),\n// Uint8Array: new Uint8(),\n// Uint8ClampedArray: new Uint8(),\n// Uint16Array: new Uint16(),\n// Uint32Array: new Uint32(),\n// Float32Array: new Float32(),\n// Float64Array: new Float64()\n// };\n\n// if (typeof BigInt64Array !== 'undefined') {\n// TYPED_ARRAY_TO_TYPE.BigInt64Array = new Int64();\n// TYPED_ARRAY_TO_TYPE.BigUint64Array = new Uint64();\n// }\n\nexport function deduceTypeFromColumn(\n value: unknown\n): StringConstructor | DateConstructor | Float32ArrayConstructor | null {\n if (value instanceof Date) {\n return Date;\n } else if (value instanceof Number) {\n return Float32Array;\n } else if (typeof value === 'string') {\n return String;\n }\n return null;\n}\n\nexport function deduceTypeFromValue(\n value: unknown\n): StringConstructor | DateConstructor | Float32ArrayConstructor | null {\n if (value instanceof Date) {\n return Date;\n } else if (value instanceof Number) {\n return Float32Array;\n } else if (typeof value === 'string') {\n return String;\n }\n return null;\n}\n\n/*\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction deduceSchema(rows) {\n const row = rows[0];\n\n const schema = {};\n let i = 0;\n for (const columnName in row) {\n const value = row[columnName];\n switch (typeof value) {\n case 'number':\n case 'boolean':\n // TODO - booleans could be handled differently...\n schema[columnName] = {name: String(columnName), index: i, type: Float32Array};\n break;\n\n case 'object':\n schema[columnName] = {name: String(columnName), index: i, type: Array};\n break;\n\n case 'string':\n default:\n schema[columnName] = {name: String(columnName), index: i, type: Array};\n // We currently only handle numeric rows\n // TODO we could offer a function to map strings to numbers?\n }\n i++;\n }\n return schema;\n}\n*/\n"],"file":"deduce-column-type.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.assert = assert;
|
|
7
|
+
|
|
8
|
+
function assert(condition, message) {
|
|
9
|
+
if (!condition) {
|
|
10
|
+
throw new Error(message || 'loader assertion failed.');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=assert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/utils/assert.ts"],"names":["assert","condition","message","Error"],"mappings":";;;;;;;AAGO,SAASA,MAAT,CAAgBC,SAAhB,EAAoCC,OAApC,EAAsD;AAC3D,MAAI,CAACD,SAAL,EAAgB;AACd,UAAM,IAAIE,KAAJ,CAAUD,OAAO,IAAI,0BAArB,CAAN;AACD;AACF","sourcesContent":["// Replacement for the external assert method to reduce bundle size\n// Note: We don't use the second \"message\" argument in calling code,\n// so no need to support it here\nexport function assert(condition: boolean, message?: string) {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}\n"],"file":"assert.js"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.takeAsync = takeAsync;
|
|
9
|
+
exports.default = void 0;
|
|
10
|
+
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
|
|
13
|
+
let _Symbol$asyncIterator;
|
|
14
|
+
|
|
15
|
+
class ArrayQueue extends Array {
|
|
16
|
+
enqueue(value) {
|
|
17
|
+
return this.push(value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
dequeue() {
|
|
21
|
+
return this.shift();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_Symbol$asyncIterator = Symbol.asyncIterator;
|
|
27
|
+
|
|
28
|
+
class AsyncQueue {
|
|
29
|
+
constructor() {
|
|
30
|
+
(0, _defineProperty2.default)(this, "_values", void 0);
|
|
31
|
+
(0, _defineProperty2.default)(this, "_settlers", void 0);
|
|
32
|
+
(0, _defineProperty2.default)(this, "_closed", void 0);
|
|
33
|
+
this._values = new ArrayQueue();
|
|
34
|
+
this._settlers = new ArrayQueue();
|
|
35
|
+
this._closed = false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
close() {
|
|
39
|
+
while (this._settlers.length > 0) {
|
|
40
|
+
this._settlers.dequeue().resolve({
|
|
41
|
+
done: true
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
this._closed = true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[_Symbol$asyncIterator]() {
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
enqueue(value) {
|
|
53
|
+
if (this._closed) {
|
|
54
|
+
throw new Error('Closed');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (this._settlers.length > 0) {
|
|
58
|
+
if (this._values.length > 0) {
|
|
59
|
+
throw new Error('Illegal internal state');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const settler = this._settlers.dequeue();
|
|
63
|
+
|
|
64
|
+
if (value instanceof Error) {
|
|
65
|
+
settler.reject(value);
|
|
66
|
+
} else {
|
|
67
|
+
settler.resolve({
|
|
68
|
+
value
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
this._values.enqueue(value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
next() {
|
|
77
|
+
if (this._values.length > 0) {
|
|
78
|
+
const value = this._values.dequeue();
|
|
79
|
+
|
|
80
|
+
if (value instanceof Error) {
|
|
81
|
+
return Promise.reject(value);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return Promise.resolve({
|
|
85
|
+
value
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (this._closed) {
|
|
90
|
+
if (this._settlers.length > 0) {
|
|
91
|
+
throw new Error('Illegal internal state');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return Promise.resolve({
|
|
95
|
+
done: true
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return new Promise((resolve, reject) => {
|
|
100
|
+
this._settlers.enqueue({
|
|
101
|
+
resolve,
|
|
102
|
+
reject
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
exports.default = AsyncQueue;
|
|
110
|
+
|
|
111
|
+
async function takeAsync(asyncIterable, count = Infinity) {
|
|
112
|
+
const result = [];
|
|
113
|
+
const iterator = asyncIterable[Symbol.asyncIterator]();
|
|
114
|
+
|
|
115
|
+
while (result.length < count) {
|
|
116
|
+
const {
|
|
117
|
+
value,
|
|
118
|
+
done
|
|
119
|
+
} = await iterator.next();
|
|
120
|
+
|
|
121
|
+
if (done) {
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
result.push(value);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=async-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/utils/async-queue.ts"],"names":["ArrayQueue","Array","enqueue","value","push","dequeue","shift","Symbol","asyncIterator","AsyncQueue","constructor","_values","_settlers","_closed","close","length","resolve","done","Error","settler","reject","next","Promise","takeAsync","asyncIterable","count","Infinity","result","iterator"],"mappings":"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","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();\n if (done) {\n break;\n }\n result.push(value);\n }\n return result;\n}\n"],"file":"async-queue.js"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.convertToObjectRow = convertToObjectRow;
|
|
7
|
+
exports.convertToArrayRow = convertToArrayRow;
|
|
8
|
+
|
|
9
|
+
function convertToObjectRow(arrayRow, headers) {
|
|
10
|
+
if (!arrayRow) {
|
|
11
|
+
throw new Error('null row');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (!headers) {
|
|
15
|
+
throw new Error('no headers');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const objectRow = {};
|
|
19
|
+
|
|
20
|
+
for (let i = 0; i < headers.length; i++) {
|
|
21
|
+
objectRow[headers[i]] = arrayRow[i];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return objectRow;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function convertToArrayRow(objectRow, headers) {
|
|
28
|
+
if (!objectRow) {
|
|
29
|
+
throw new Error('null row');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (!headers) {
|
|
33
|
+
throw new Error('no headers');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const arrayRow = new Array(headers.length);
|
|
37
|
+
|
|
38
|
+
for (let i = 0; i < headers.length; i++) {
|
|
39
|
+
arrayRow[i] = objectRow[headers[i]];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return arrayRow;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=row-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/utils/row-utils.ts"],"names":["convertToObjectRow","arrayRow","headers","Error","objectRow","i","length","convertToArrayRow","Array"],"mappings":";;;;;;;;AACO,SAASA,kBAAT,CACLC,QADK,EAELC,OAFK,EAGwB;AAC7B,MAAI,CAACD,QAAL,EAAe;AACb,UAAM,IAAIE,KAAJ,CAAU,UAAV,CAAN;AACD;;AACD,MAAI,CAACD,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,YAAV,CAAN;AACD;;AACD,QAAMC,SAAS,GAAG,EAAlB;;AACA,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,OAAO,CAACI,MAA5B,EAAoCD,CAAC,EAArC,EAAyC;AACvCD,IAAAA,SAAS,CAACF,OAAO,CAACG,CAAD,CAAR,CAAT,GAAwBJ,QAAQ,CAACI,CAAD,CAAhC;AACD;;AACD,SAAOD,SAAP;AACD;;AAGM,SAASG,iBAAT,CACLH,SADK,EAELF,OAFK,EAGE;AACP,MAAI,CAACE,SAAL,EAAgB;AACd,UAAM,IAAID,KAAJ,CAAU,UAAV,CAAN;AACD;;AACD,MAAI,CAACD,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,YAAV,CAAN;AACD;;AACD,QAAMF,QAAQ,GAAG,IAAIO,KAAJ,CAAUN,OAAO,CAACI,MAAlB,CAAjB;;AACA,OAAK,IAAID,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,OAAO,CAACI,MAA5B,EAAoCD,CAAC,EAArC,EAAyC;AACvCJ,IAAAA,QAAQ,CAACI,CAAD,CAAR,GAAcD,SAAS,CAACF,OAAO,CAACG,CAAD,CAAR,CAAvB;AACD;;AACD,SAAOJ,QAAP;AACD","sourcesContent":["/** Convert an object row to an array row */\nexport function convertToObjectRow(\n arrayRow: any[],\n headers: string[]\n): {[columnName: string]: any} {\n if (!arrayRow) {\n throw new Error('null row');\n }\n if (!headers) {\n throw new Error('no headers');\n }\n const objectRow = {};\n for (let i = 0; i < headers.length; i++) {\n objectRow[headers[i]] = arrayRow[i];\n }\n return objectRow;\n}\n\n/** Convert an object row to an array row */\nexport function convertToArrayRow(\n objectRow: {[columnName: string]: any},\n headers: string[]\n): any[] {\n if (!objectRow) {\n throw new Error('null row');\n }\n if (!headers) {\n throw new Error('no headers');\n }\n const arrayRow = new Array(headers.length);\n for (let i = 0; i < headers.length; i++) {\n arrayRow[i] = objectRow[headers[i]];\n }\n return arrayRow;\n}\n"],"file":"row-utils.js"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/bundle.ts"],"names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"mappings":"AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACAC,UAAU,CAACC,OAAX,GAAqBD,UAAU,CAACC,OAAX,IAAsB,EAA3C;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcL,UAAU,CAACC,OAAzB,EAAkCH,aAAlC,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"file":"bundle.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"common.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"gis.js"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function convertMesh(mesh, shape, options) {
|
|
2
|
+
switch (shape || 'mesh') {
|
|
3
|
+
case 'mesh':
|
|
4
|
+
return mesh;
|
|
5
|
+
|
|
6
|
+
case 'columnar-table':
|
|
7
|
+
return convertMeshToColumnarTable(mesh);
|
|
8
|
+
|
|
9
|
+
default:
|
|
10
|
+
throw new Error("Unsupported shape ".concat(options === null || options === void 0 ? void 0 : options.shape));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function convertMeshToColumnarTable(mesh) {
|
|
14
|
+
const columns = {};
|
|
15
|
+
|
|
16
|
+
for (const [columnName, attribute] of Object.entries(mesh.attributes)) {
|
|
17
|
+
columns[columnName] = attribute.value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
shape: 'columnar-table',
|
|
22
|
+
schema: mesh.schema,
|
|
23
|
+
data: columns
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=convert-mesh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/category/mesh/convert-mesh.ts"],"names":["convertMesh","mesh","shape","options","convertMeshToColumnarTable","Error","columns","columnName","attribute","Object","entries","attributes","value","schema","data"],"mappings":"AASA,OAAO,SAASA,WAAT,CACLC,IADK,EAELC,KAFK,EAGLC,OAHK,EAI8B;AACnC,UAAQD,KAAK,IAAI,MAAjB;AACE,SAAK,MAAL;AACE,aAAOD,IAAP;;AACF,SAAK,gBAAL;AACE,aAAOG,0BAA0B,CAACH,IAAD,CAAjC;;AAMF;AACE,YAAM,IAAII,KAAJ,6BAA+BF,OAA/B,aAA+BA,OAA/B,uBAA+BA,OAAO,CAAED,KAAxC,EAAN;AAXJ;AAaD;AAOD,OAAO,SAASE,0BAAT,CAAoCH,IAApC,EAA+D;AACpE,QAAMK,OAAO,GAAG,EAAhB;;AAEA,OAAK,MAAM,CAACC,UAAD,EAAaC,SAAb,CAAX,IAAsCC,MAAM,CAACC,OAAP,CAAeT,IAAI,CAACU,UAApB,CAAtC,EAAuE;AACrEL,IAAAA,OAAO,CAACC,UAAD,CAAP,GAAsBC,SAAS,CAACI,KAAhC;AACD;;AAED,SAAO;AACLV,IAAAA,KAAK,EAAE,gBADF;AAELW,IAAAA,MAAM,EAAEZ,IAAI,CAACY,MAFR;AAGLC,IAAAA,IAAI,EAAER;AAHD,GAAP;AAKD","sourcesContent":["import type {Mesh} from './mesh-types';\nimport type {ColumnarTable, ArrowTable} from '../table/table-types';\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"],"file":"convert-mesh.js"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Schema, Field, FixedSizeList } from '../../lib/schema/schema';
|
|
2
|
+
import { getArrowTypeFromTypedArray } from '../../lib/arrow/arrow-like-type-utils';
|
|
3
|
+
export function deduceMeshSchema(attributes, metadata) {
|
|
4
|
+
const fields = deduceMeshFields(attributes);
|
|
5
|
+
return new Schema(fields, metadata);
|
|
6
|
+
}
|
|
7
|
+
export function deduceMeshField(attributeName, attribute, optionalMetadata) {
|
|
8
|
+
const type = getArrowTypeFromTypedArray(attribute.value);
|
|
9
|
+
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
10
|
+
const field = new Field(attributeName, new FixedSizeList(attribute.size, new Field('value', type)), false, metadata);
|
|
11
|
+
return field;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function deduceMeshFields(attributes) {
|
|
15
|
+
const fields = [];
|
|
16
|
+
|
|
17
|
+
for (const attributeName in attributes) {
|
|
18
|
+
const attribute = attributes[attributeName];
|
|
19
|
+
fields.push(deduceMeshField(attributeName, attribute));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return fields;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function makeMeshAttributeMetadata(attribute) {
|
|
26
|
+
const result = new Map();
|
|
27
|
+
|
|
28
|
+
if ('byteOffset' in attribute) {
|
|
29
|
+
result.set('byteOffset', attribute.byteOffset.toString(10));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if ('byteStride' in attribute) {
|
|
33
|
+
result.set('byteStride', attribute.byteStride.toString(10));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if ('normalized' in attribute) {
|
|
37
|
+
result.set('normalized', attribute.normalized.toString());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=deduce-mesh-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/category/mesh/deduce-mesh-schema.ts"],"names":["Schema","Field","FixedSizeList","getArrowTypeFromTypedArray","deduceMeshSchema","attributes","metadata","fields","deduceMeshFields","deduceMeshField","attributeName","attribute","optionalMetadata","type","value","makeMeshAttributeMetadata","field","size","push","result","Map","set","byteOffset","toString","byteStride","normalized"],"mappings":"AACA,SAAQA,MAAR,EAAgBC,KAAhB,EAAuBC,aAAvB,QAA2C,yBAA3C;AACA,SAAQC,0BAAR,QAAyC,uCAAzC;AAQA,OAAO,SAASC,gBAAT,CACLC,UADK,EAELC,QAFK,EAGG;AACR,QAAMC,MAAM,GAAGC,gBAAgB,CAACH,UAAD,CAA/B;AACA,SAAO,IAAIL,MAAJ,CAAWO,MAAX,EAAmBD,QAAnB,CAAP;AACD;AASD,OAAO,SAASG,eAAT,CACLC,aADK,EAELC,SAFK,EAGLC,gBAHK,EAIE;AACP,QAAMC,IAAI,GAAGV,0BAA0B,CAACQ,SAAS,CAACG,KAAX,CAAvC;AACA,QAAMR,QAAQ,GAAGM,gBAAgB,GAAGA,gBAAH,GAAsBG,yBAAyB,CAACJ,SAAD,CAAhF;AACA,QAAMK,KAAK,GAAG,IAAIf,KAAJ,CACZS,aADY,EAEZ,IAAIR,aAAJ,CAAkBS,SAAS,CAACM,IAA5B,EAAkC,IAAIhB,KAAJ,CAAU,OAAV,EAAmBY,IAAnB,CAAlC,CAFY,EAGZ,KAHY,EAIZP,QAJY,CAAd;AAMA,SAAOU,KAAP;AACD;;AAOD,SAASR,gBAAT,CAA0BH,UAA1B,EAA+D;AAC7D,QAAME,MAAe,GAAG,EAAxB;;AACA,OAAK,MAAMG,aAAX,IAA4BL,UAA5B,EAAwC;AACtC,UAAMM,SAAwB,GAAGN,UAAU,CAACK,aAAD,CAA3C;AACAH,IAAAA,MAAM,CAACW,IAAP,CAAYT,eAAe,CAACC,aAAD,EAAgBC,SAAhB,CAA3B;AACD;;AACD,SAAOJ,MAAP;AACD;;AAOD,OAAO,SAASQ,yBAAT,CAAmCJ,SAAnC,EAAkF;AACvF,QAAMQ,MAAM,GAAG,IAAIC,GAAJ,EAAf;;AACA,MAAI,gBAAgBT,SAApB,EAA+B;AAC7BQ,IAAAA,MAAM,CAACE,GAAP,CAAW,YAAX,EAAyBV,SAAS,CAACW,UAAV,CAAsBC,QAAtB,CAA+B,EAA/B,CAAzB;AACD;;AACD,MAAI,gBAAgBZ,SAApB,EAA+B;AAC7BQ,IAAAA,MAAM,CAACE,GAAP,CAAW,YAAX,EAAyBV,SAAS,CAACa,UAAV,CAAsBD,QAAtB,CAA+B,EAA/B,CAAzB;AACD;;AACD,MAAI,gBAAgBZ,SAApB,EAA+B;AAC7BQ,IAAAA,MAAM,CAACE,GAAP,CAAW,YAAX,EAAyBV,SAAS,CAACc,UAAV,CAAsBF,QAAtB,EAAzB;AACD;;AACD,SAAOJ,MAAP;AACD","sourcesContent":["import {MeshAttribute, MeshAttributes} from './mesh-types';\nimport {Schema, Field, FixedSizeList} from '../../lib/schema/schema';\nimport {getArrowTypeFromTypedArray} from '../../lib/arrow/arrow-like-type-utils';\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?: Map<string, string>\n): Schema {\n const fields = deduceMeshFields(attributes);\n return new Schema(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 attributeName: string,\n attribute: MeshAttribute,\n optionalMetadata?: Map<string, string>\n): Field {\n const type = getArrowTypeFromTypedArray(attribute.value);\n const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);\n const field = new Field(\n attributeName,\n new FixedSizeList(attribute.size, new Field('value', type)),\n false,\n metadata\n );\n return field;\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): Map<string, string> {\n const result = new Map();\n if ('byteOffset' in attribute) {\n result.set('byteOffset', attribute.byteOffset!.toString(10));\n }\n if ('byteStride' in attribute) {\n result.set('byteStride', attribute.byteStride!.toString(10));\n }\n if ('normalized' in attribute) {\n result.set('normalized', attribute.normalized!.toString());\n }\n return result;\n}\n"],"file":"deduce-mesh-schema.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"mesh-to-arrow-table.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"mesh-types.js"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function getMeshSize(attributes) {
|
|
2
|
+
let size = 0;
|
|
3
|
+
|
|
4
|
+
for (const attributeName in attributes) {
|
|
5
|
+
const attribute = attributes[attributeName];
|
|
6
|
+
|
|
7
|
+
if (ArrayBuffer.isView(attribute)) {
|
|
8
|
+
size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return size;
|
|
13
|
+
}
|
|
14
|
+
export function getMeshBoundingBox(attributes) {
|
|
15
|
+
let minX = Infinity;
|
|
16
|
+
let minY = Infinity;
|
|
17
|
+
let minZ = Infinity;
|
|
18
|
+
let maxX = -Infinity;
|
|
19
|
+
let maxY = -Infinity;
|
|
20
|
+
let maxZ = -Infinity;
|
|
21
|
+
const positions = attributes.POSITION ? attributes.POSITION.value : [];
|
|
22
|
+
const len = positions && positions.length;
|
|
23
|
+
|
|
24
|
+
for (let i = 0; i < len; i += 3) {
|
|
25
|
+
const x = positions[i];
|
|
26
|
+
const y = positions[i + 1];
|
|
27
|
+
const z = positions[i + 2];
|
|
28
|
+
minX = x < minX ? x : minX;
|
|
29
|
+
minY = y < minY ? y : minY;
|
|
30
|
+
minZ = z < minZ ? z : minZ;
|
|
31
|
+
maxX = x > maxX ? x : maxX;
|
|
32
|
+
maxY = y > maxY ? y : maxY;
|
|
33
|
+
maxZ = z > maxZ ? z : maxZ;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return [[minX, minY, minZ], [maxX, maxY, maxZ]];
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=mesh-utils.js.map
|