@loaders.gl/schema 3.1.0-alpha.2 → 3.1.0-beta.1

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.
Files changed (248) hide show
  1. package/dist/bundle.d.ts +2 -0
  2. package/dist/bundle.d.ts.map +1 -0
  3. package/dist/bundle.js +16157 -5
  4. package/dist/category/common.d.ts +19 -0
  5. package/dist/category/common.d.ts.map +1 -0
  6. package/dist/category/common.js +10 -2
  7. package/dist/category/gis.d.ts +50 -0
  8. package/dist/category/gis.d.ts.map +1 -0
  9. package/dist/category/gis.js +2 -2
  10. package/dist/category/mesh/convert-mesh.d.ts +15 -0
  11. package/dist/category/mesh/convert-mesh.d.ts.map +1 -0
  12. package/dist/category/mesh/convert-mesh.js +38 -31
  13. package/dist/category/mesh/deduce-mesh-schema.d.ts +24 -0
  14. package/dist/category/mesh/deduce-mesh-schema.d.ts.map +1 -0
  15. package/dist/category/mesh/deduce-mesh-schema.js +57 -37
  16. package/dist/category/mesh/mesh-to-arrow-table.d.ts +11 -0
  17. package/dist/category/mesh/mesh-to-arrow-table.d.ts.map +1 -0
  18. package/dist/category/mesh/mesh-to-arrow-table.js +33 -30
  19. package/dist/category/mesh/mesh-types.d.ts +50 -0
  20. package/dist/category/mesh/mesh-types.d.ts.map +1 -0
  21. package/dist/category/mesh/mesh-types.js +2 -2
  22. package/dist/category/mesh/mesh-utils.d.ts +23 -0
  23. package/dist/category/mesh/mesh-utils.d.ts.map +1 -0
  24. package/dist/category/mesh/mesh-utils.js +48 -35
  25. package/dist/category/table/deduce-table-schema.d.ts +9 -0
  26. package/dist/category/table/deduce-table-schema.d.ts.map +1 -0
  27. package/dist/category/table/deduce-table-schema.js +94 -39
  28. package/dist/category/table/table-types.d.ts +76 -0
  29. package/dist/category/table/table-types.d.ts.map +1 -0
  30. package/dist/category/table/table-types.js +2 -2
  31. package/dist/es5/bundle.js +7 -0
  32. package/dist/es5/bundle.js.map +1 -0
  33. package/dist/es5/category/common.js +2 -0
  34. package/dist/{category → es5/category}/common.js.map +0 -0
  35. package/dist/es5/category/gis.js +2 -0
  36. package/dist/{category → es5/category}/gis.js.map +0 -0
  37. package/dist/es5/category/mesh/convert-mesh.js +43 -0
  38. package/dist/{category → es5/category}/mesh/convert-mesh.js.map +1 -1
  39. package/dist/es5/category/mesh/deduce-mesh-schema.js +54 -0
  40. package/dist/es5/category/mesh/deduce-mesh-schema.js.map +1 -0
  41. package/dist/es5/category/mesh/mesh-to-arrow-table.js +41 -0
  42. package/dist/es5/category/mesh/mesh-to-arrow-table.js.map +1 -0
  43. package/dist/es5/category/mesh/mesh-types.js +2 -0
  44. package/dist/{category → es5/category}/mesh/mesh-types.js.map +0 -0
  45. package/dist/es5/category/mesh/mesh-utils.js +47 -0
  46. package/dist/es5/category/mesh/mesh-utils.js.map +1 -0
  47. package/dist/es5/category/table/deduce-table-schema.js +58 -0
  48. package/dist/es5/category/table/deduce-table-schema.js.map +1 -0
  49. package/dist/es5/category/table/table-types.js +2 -0
  50. package/dist/{category → es5/category}/table/table-types.js.map +0 -0
  51. package/dist/es5/index.js +344 -0
  52. package/dist/es5/index.js.map +1 -0
  53. package/dist/es5/lib/arrow/arrow-like-type-utils.js +40 -0
  54. package/dist/es5/lib/arrow/arrow-like-type-utils.js.map +1 -0
  55. package/dist/es5/lib/arrow/arrow-type-utils.js +72 -0
  56. package/dist/es5/lib/arrow/arrow-type-utils.js.map +1 -0
  57. package/dist/es5/lib/arrow/get-type-info.js +33 -0
  58. package/dist/es5/lib/arrow/get-type-info.js.map +1 -0
  59. package/dist/es5/lib/batches/base-table-batch-aggregator.js +81 -0
  60. package/dist/es5/lib/batches/base-table-batch-aggregator.js.map +1 -0
  61. package/dist/es5/lib/batches/columnar-table-batch-aggregator.js +109 -0
  62. package/dist/es5/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
  63. package/dist/es5/lib/batches/row-table-batch-aggregator.js +102 -0
  64. package/dist/es5/lib/batches/row-table-batch-aggregator.js.map +1 -0
  65. package/dist/es5/lib/batches/table-batch-aggregator.js +2 -0
  66. package/dist/{lib → es5/lib}/batches/table-batch-aggregator.js.map +0 -0
  67. package/dist/es5/lib/batches/table-batch-builder.js +187 -0
  68. package/dist/es5/lib/batches/table-batch-builder.js.map +1 -0
  69. package/dist/es5/lib/schema/impl/enum.js +56 -0
  70. package/dist/es5/lib/schema/impl/enum.js.map +1 -0
  71. package/dist/es5/lib/schema/impl/field.js +43 -0
  72. package/dist/es5/lib/schema/impl/field.js.map +1 -0
  73. package/dist/es5/lib/schema/impl/schema.js +103 -0
  74. package/dist/es5/lib/schema/impl/schema.js.map +1 -0
  75. package/dist/es5/lib/schema/impl/type.js +594 -0
  76. package/dist/es5/lib/schema/impl/type.js.map +1 -0
  77. package/dist/es5/lib/schema/schema.js +236 -0
  78. package/dist/es5/lib/schema/schema.js.map +1 -0
  79. package/dist/es5/lib/schema-utils/deduce-column-type.js +32 -0
  80. package/dist/es5/lib/schema-utils/deduce-column-type.js.map +1 -0
  81. package/dist/es5/lib/utils/assert.js +13 -0
  82. package/dist/es5/lib/utils/assert.js.map +1 -0
  83. package/dist/es5/lib/utils/async-queue.js +130 -0
  84. package/dist/es5/lib/utils/async-queue.js.map +1 -0
  85. package/dist/es5/lib/utils/row-utils.js +44 -0
  86. package/dist/es5/lib/utils/row-utils.js.map +1 -0
  87. package/dist/es5/types.js +2 -0
  88. package/dist/{types.js.map → es5/types.js.map} +0 -0
  89. package/dist/esm/bundle.js +5 -0
  90. package/dist/esm/bundle.js.map +1 -0
  91. package/dist/esm/category/common.js +2 -0
  92. package/dist/esm/category/common.js.map +1 -0
  93. package/dist/esm/category/gis.js +2 -0
  94. package/dist/esm/category/gis.js.map +1 -0
  95. package/dist/esm/category/mesh/convert-mesh.js +33 -0
  96. package/dist/esm/category/mesh/convert-mesh.js.map +1 -0
  97. package/dist/esm/category/mesh/deduce-mesh-schema.js +42 -0
  98. package/dist/esm/category/mesh/deduce-mesh-schema.js.map +1 -0
  99. package/dist/esm/category/mesh/mesh-to-arrow-table.js +31 -0
  100. package/dist/esm/category/mesh/mesh-to-arrow-table.js.map +1 -0
  101. package/dist/esm/category/mesh/mesh-types.js +2 -0
  102. package/dist/esm/category/mesh/mesh-types.js.map +1 -0
  103. package/dist/esm/category/mesh/mesh-utils.js +38 -0
  104. package/dist/esm/category/mesh/mesh-utils.js.map +1 -0
  105. package/dist/esm/category/table/deduce-table-schema.js +51 -0
  106. package/dist/esm/category/table/deduce-table-schema.js.map +1 -0
  107. package/dist/esm/category/table/table-types.js +2 -0
  108. package/dist/esm/category/table/table-types.js.map +1 -0
  109. package/dist/esm/index.js +13 -0
  110. package/dist/esm/index.js.map +1 -0
  111. package/dist/esm/lib/arrow/arrow-like-type-utils.js +32 -0
  112. package/dist/esm/lib/arrow/arrow-like-type-utils.js.map +1 -0
  113. package/dist/esm/lib/arrow/arrow-type-utils.js +62 -0
  114. package/dist/esm/lib/arrow/arrow-type-utils.js.map +1 -0
  115. package/dist/esm/lib/arrow/get-type-info.js +24 -0
  116. package/dist/esm/lib/arrow/get-type-info.js.map +1 -0
  117. package/dist/esm/lib/batches/base-table-batch-aggregator.js +74 -0
  118. package/dist/esm/lib/batches/base-table-batch-aggregator.js.map +1 -0
  119. package/dist/esm/lib/batches/columnar-table-batch-aggregator.js +100 -0
  120. package/dist/esm/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
  121. package/dist/esm/lib/batches/row-table-batch-aggregator.js +95 -0
  122. package/dist/esm/lib/batches/row-table-batch-aggregator.js.map +1 -0
  123. package/dist/esm/lib/batches/table-batch-aggregator.js +2 -0
  124. package/dist/esm/lib/batches/table-batch-aggregator.js.map +1 -0
  125. package/dist/esm/lib/batches/table-batch-builder.js +182 -0
  126. package/dist/esm/lib/batches/table-batch-builder.js.map +1 -0
  127. package/dist/esm/lib/schema/impl/enum.js +49 -0
  128. package/dist/esm/lib/schema/impl/enum.js.map +1 -0
  129. package/dist/esm/lib/schema/impl/field.js +35 -0
  130. package/dist/esm/lib/schema/impl/field.js.map +1 -0
  131. package/dist/esm/lib/schema/impl/schema.js +92 -0
  132. package/dist/esm/lib/schema/impl/schema.js.map +1 -0
  133. package/dist/esm/lib/schema/impl/type.js +498 -0
  134. package/dist/esm/lib/schema/impl/type.js.map +1 -0
  135. package/dist/{lib/schema/index.js → esm/lib/schema/schema.js} +1 -1
  136. package/dist/esm/lib/schema/schema.js.map +1 -0
  137. package/dist/esm/lib/schema-utils/deduce-column-type.js +23 -0
  138. package/dist/esm/lib/schema-utils/deduce-column-type.js.map +1 -0
  139. package/dist/esm/lib/utils/assert.js +6 -0
  140. package/dist/esm/lib/utils/assert.js.map +1 -0
  141. package/dist/esm/lib/utils/async-queue.js +119 -0
  142. package/dist/esm/lib/utils/async-queue.js.map +1 -0
  143. package/dist/esm/lib/utils/row-utils.js +35 -0
  144. package/dist/esm/lib/utils/row-utils.js.map +1 -0
  145. package/dist/esm/types.js +2 -0
  146. package/dist/esm/types.js.map +1 -0
  147. package/dist/index.d.ts +23 -0
  148. package/dist/index.d.ts.map +1 -0
  149. package/dist/index.js +75 -13
  150. package/dist/lib/arrow/arrow-like-type-utils.d.ts +4 -0
  151. package/dist/lib/arrow/arrow-like-type-utils.d.ts.map +1 -0
  152. package/dist/lib/arrow/arrow-like-type-utils.js +26 -31
  153. package/dist/lib/arrow/arrow-type-utils.d.ts +6 -0
  154. package/dist/lib/arrow/arrow-type-utils.d.ts.map +1 -0
  155. package/dist/lib/arrow/arrow-type-utils.js +48 -60
  156. package/dist/lib/arrow/get-type-info.d.ts +14 -0
  157. package/dist/lib/arrow/get-type-info.d.ts.map +1 -0
  158. package/dist/lib/arrow/get-type-info.js +23 -19
  159. package/dist/lib/batches/base-table-batch-aggregator.d.ts +19 -0
  160. package/dist/lib/batches/base-table-batch-aggregator.d.ts.map +1 -0
  161. package/dist/lib/batches/base-table-batch-aggregator.js +52 -68
  162. package/dist/lib/batches/columnar-table-batch-aggregator.d.ts +23 -0
  163. package/dist/lib/batches/columnar-table-batch-aggregator.d.ts.map +1 -0
  164. package/dist/lib/batches/columnar-table-batch-aggregator.js +82 -92
  165. package/dist/lib/batches/row-table-batch-aggregator.d.ts +22 -0
  166. package/dist/lib/batches/row-table-batch-aggregator.d.ts.map +1 -0
  167. package/dist/lib/batches/row-table-batch-aggregator.js +72 -88
  168. package/dist/lib/batches/table-batch-aggregator.d.ts +25 -0
  169. package/dist/lib/batches/table-batch-aggregator.d.ts.map +1 -0
  170. package/dist/lib/batches/table-batch-aggregator.js +2 -2
  171. package/dist/lib/batches/table-batch-builder.d.ts +53 -0
  172. package/dist/lib/batches/table-batch-builder.d.ts.map +1 -0
  173. package/dist/lib/batches/table-batch-builder.js +137 -166
  174. package/dist/lib/schema/impl/enum.d.ts +92 -0
  175. package/dist/lib/schema/impl/enum.d.ts.map +1 -0
  176. package/dist/lib/schema/impl/enum.js +96 -48
  177. package/dist/lib/schema/impl/field.d.ts +19 -0
  178. package/dist/lib/schema/impl/field.d.ts.map +1 -0
  179. package/dist/lib/schema/impl/field.js +31 -34
  180. package/dist/lib/schema/impl/schema.d.ts +16 -0
  181. package/dist/lib/schema/impl/schema.d.ts.map +1 -0
  182. package/dist/lib/schema/impl/schema.js +72 -81
  183. package/dist/lib/schema/impl/type.d.ts +176 -0
  184. package/dist/lib/schema/impl/type.d.ts.map +1 -0
  185. package/dist/lib/schema/impl/type.js +454 -490
  186. package/dist/lib/schema/schema.d.ts +5 -0
  187. package/dist/lib/schema/schema.d.ts.map +1 -0
  188. package/dist/lib/schema/schema.js +90 -0
  189. package/dist/lib/schema-utils/deduce-column-type.d.ts +3 -0
  190. package/dist/lib/schema-utils/deduce-column-type.d.ts.map +1 -0
  191. package/dist/lib/schema-utils/deduce-column-type.js +89 -20
  192. package/dist/lib/utils/assert.d.ts +2 -0
  193. package/dist/lib/utils/assert.d.ts.map +1 -0
  194. package/dist/lib/utils/assert.js +11 -5
  195. package/dist/lib/utils/async-queue.d.ts +18 -0
  196. package/dist/lib/utils/async-queue.d.ts.map +1 -0
  197. package/dist/lib/utils/async-queue.js +82 -109
  198. package/dist/lib/utils/row-utils.d.ts +9 -0
  199. package/dist/lib/utils/row-utils.d.ts.map +1 -0
  200. package/dist/lib/utils/row-utils.js +31 -33
  201. package/dist/types.d.ts +8 -0
  202. package/dist/types.d.ts.map +1 -0
  203. package/dist/types.js +2 -2
  204. package/package.json +7 -8
  205. package/src/bundle.ts +2 -3
  206. package/src/category/mesh/deduce-mesh-schema.ts +1 -1
  207. package/src/category/mesh/mesh-to-arrow-table.ts +1 -1
  208. package/src/category/mesh/mesh-types.ts +1 -1
  209. package/src/category/table/deduce-table-schema.ts +1 -1
  210. package/src/category/table/table-types.ts +2 -2
  211. package/src/index.ts +1 -1
  212. package/src/lib/arrow/arrow-like-type-utils.ts +11 -1
  213. package/src/lib/arrow/arrow-type-utils.ts +1 -1
  214. package/src/lib/arrow/get-type-info.ts +1 -1
  215. package/src/lib/batches/base-table-batch-aggregator.ts +1 -1
  216. package/src/lib/batches/columnar-table-batch-aggregator.ts +1 -1
  217. package/src/lib/batches/row-table-batch-aggregator.ts +1 -1
  218. package/src/lib/batches/table-batch-aggregator.ts +1 -1
  219. package/src/lib/batches/table-batch-builder.ts +2 -2
  220. package/src/lib/schema/impl/schema.ts +2 -2
  221. package/src/lib/schema/impl/type.ts +2 -2
  222. package/src/lib/schema/{index.ts → schema.ts} +0 -0
  223. package/src/lib/schema-utils/deduce-column-type.ts +6 -2
  224. package/src/lib/utils/async-queue.ts +7 -4
  225. package/dist/bundle.js.map +0 -1
  226. package/dist/category/mesh/deduce-mesh-schema.js.map +0 -1
  227. package/dist/category/mesh/mesh-to-arrow-table.js.map +0 -1
  228. package/dist/category/mesh/mesh-utils.js.map +0 -1
  229. package/dist/category/table/deduce-table-schema.js.map +0 -1
  230. package/dist/dist.min.js +0 -2
  231. package/dist/dist.min.js.map +0 -1
  232. package/dist/index.js.map +0 -1
  233. package/dist/lib/arrow/arrow-like-type-utils.js.map +0 -1
  234. package/dist/lib/arrow/arrow-type-utils.js.map +0 -1
  235. package/dist/lib/arrow/get-type-info.js.map +0 -1
  236. package/dist/lib/batches/base-table-batch-aggregator.js.map +0 -1
  237. package/dist/lib/batches/columnar-table-batch-aggregator.js.map +0 -1
  238. package/dist/lib/batches/row-table-batch-aggregator.js.map +0 -1
  239. package/dist/lib/batches/table-batch-builder.js.map +0 -1
  240. package/dist/lib/schema/impl/enum.js.map +0 -1
  241. package/dist/lib/schema/impl/field.js.map +0 -1
  242. package/dist/lib/schema/impl/schema.js.map +0 -1
  243. package/dist/lib/schema/impl/type.js.map +0 -1
  244. package/dist/lib/schema/index.js.map +0 -1
  245. package/dist/lib/schema-utils/deduce-column-type.js.map +0 -1
  246. package/dist/lib/utils/assert.js.map +0 -1
  247. package/dist/lib/utils/async-queue.js.map +0 -1
  248. package/dist/lib/utils/row-utils.js.map +0 -1
@@ -0,0 +1,5 @@
1
+ export { default as Schema } from './impl/schema';
2
+ export { default as Field } from './impl/field';
3
+ export { Type } from './impl/type';
4
+ export { DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Binary, Utf8, Date, DateDay, DateMillisecond, Time, TimeSecond, TimeMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Struct } from './impl/type';
5
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/lib/schema/schema.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,eAAe,EACf,IAAI,EACJ,UAAU,EACV,eAAe,EAGf,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,MAAM,EACP,MAAM,aAAa,CAAC"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Struct = exports.FixedSizeList = exports.IntervalYearMonth = exports.IntervalDayTime = exports.Interval = exports.TimestampNanosecond = exports.TimestampMicrosecond = exports.TimestampMillisecond = exports.TimestampSecond = exports.Timestamp = exports.TimeMillisecond = exports.TimeSecond = exports.Time = exports.DateMillisecond = exports.DateDay = exports.Date = exports.Utf8 = exports.Binary = exports.Float64 = exports.Float32 = exports.Float16 = exports.Float = exports.Uint64 = exports.Uint32 = exports.Uint16 = exports.Uint8 = exports.Int64 = exports.Int32 = exports.Int16 = exports.Int8 = exports.Int = exports.Bool = exports.Null = exports.DataType = exports.Type = exports.Field = exports.Schema = void 0;
7
+ /*
8
+ export {
9
+ Schema,
10
+ Field,
11
+ DataType,
12
+ Null,
13
+ Bool,
14
+ Int,
15
+ Int8,
16
+ Int16,
17
+ Int32,
18
+ Int64,
19
+ Uint8,
20
+ Uint16,
21
+ Uint32,
22
+ Uint64,
23
+ Float,
24
+ Float16,
25
+ Float32,
26
+ Float64,
27
+ Binary,
28
+ Utf8,
29
+ Date,
30
+ DateDay,
31
+ DateMillisecond,
32
+ Time,
33
+ TimeSecond,
34
+ TimeMillisecond,
35
+ TimeMicrosecond,
36
+ TimeNanosecond,
37
+ Timestamp,
38
+ TimestampSecond,
39
+ TimestampMillisecond,
40
+ TimestampMicrosecond,
41
+ TimestampNanosecond,
42
+ Interval,
43
+ IntervalDayTime,
44
+ IntervalYearMonth,
45
+ FixedSizeList
46
+ } from 'apache-arrow';
47
+ */
48
+ var schema_1 = require("./impl/schema");
49
+ Object.defineProperty(exports, "Schema", { enumerable: true, get: function () { return __importDefault(schema_1).default; } });
50
+ var field_1 = require("./impl/field");
51
+ Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return __importDefault(field_1).default; } });
52
+ var type_1 = require("./impl/type");
53
+ Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return type_1.Type; } });
54
+ var type_2 = require("./impl/type");
55
+ Object.defineProperty(exports, "DataType", { enumerable: true, get: function () { return type_2.DataType; } });
56
+ Object.defineProperty(exports, "Null", { enumerable: true, get: function () { return type_2.Null; } });
57
+ Object.defineProperty(exports, "Bool", { enumerable: true, get: function () { return type_2.Bool; } });
58
+ Object.defineProperty(exports, "Int", { enumerable: true, get: function () { return type_2.Int; } });
59
+ Object.defineProperty(exports, "Int8", { enumerable: true, get: function () { return type_2.Int8; } });
60
+ Object.defineProperty(exports, "Int16", { enumerable: true, get: function () { return type_2.Int16; } });
61
+ Object.defineProperty(exports, "Int32", { enumerable: true, get: function () { return type_2.Int32; } });
62
+ Object.defineProperty(exports, "Int64", { enumerable: true, get: function () { return type_2.Int64; } });
63
+ Object.defineProperty(exports, "Uint8", { enumerable: true, get: function () { return type_2.Uint8; } });
64
+ Object.defineProperty(exports, "Uint16", { enumerable: true, get: function () { return type_2.Uint16; } });
65
+ Object.defineProperty(exports, "Uint32", { enumerable: true, get: function () { return type_2.Uint32; } });
66
+ Object.defineProperty(exports, "Uint64", { enumerable: true, get: function () { return type_2.Uint64; } });
67
+ Object.defineProperty(exports, "Float", { enumerable: true, get: function () { return type_2.Float; } });
68
+ Object.defineProperty(exports, "Float16", { enumerable: true, get: function () { return type_2.Float16; } });
69
+ Object.defineProperty(exports, "Float32", { enumerable: true, get: function () { return type_2.Float32; } });
70
+ Object.defineProperty(exports, "Float64", { enumerable: true, get: function () { return type_2.Float64; } });
71
+ Object.defineProperty(exports, "Binary", { enumerable: true, get: function () { return type_2.Binary; } });
72
+ Object.defineProperty(exports, "Utf8", { enumerable: true, get: function () { return type_2.Utf8; } });
73
+ Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return type_2.Date; } });
74
+ Object.defineProperty(exports, "DateDay", { enumerable: true, get: function () { return type_2.DateDay; } });
75
+ Object.defineProperty(exports, "DateMillisecond", { enumerable: true, get: function () { return type_2.DateMillisecond; } });
76
+ Object.defineProperty(exports, "Time", { enumerable: true, get: function () { return type_2.Time; } });
77
+ Object.defineProperty(exports, "TimeSecond", { enumerable: true, get: function () { return type_2.TimeSecond; } });
78
+ Object.defineProperty(exports, "TimeMillisecond", { enumerable: true, get: function () { return type_2.TimeMillisecond; } });
79
+ // TimeMicrosecond,
80
+ // TimeNanosecond,
81
+ Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return type_2.Timestamp; } });
82
+ Object.defineProperty(exports, "TimestampSecond", { enumerable: true, get: function () { return type_2.TimestampSecond; } });
83
+ Object.defineProperty(exports, "TimestampMillisecond", { enumerable: true, get: function () { return type_2.TimestampMillisecond; } });
84
+ Object.defineProperty(exports, "TimestampMicrosecond", { enumerable: true, get: function () { return type_2.TimestampMicrosecond; } });
85
+ Object.defineProperty(exports, "TimestampNanosecond", { enumerable: true, get: function () { return type_2.TimestampNanosecond; } });
86
+ Object.defineProperty(exports, "Interval", { enumerable: true, get: function () { return type_2.Interval; } });
87
+ Object.defineProperty(exports, "IntervalDayTime", { enumerable: true, get: function () { return type_2.IntervalDayTime; } });
88
+ Object.defineProperty(exports, "IntervalYearMonth", { enumerable: true, get: function () { return type_2.IntervalYearMonth; } });
89
+ Object.defineProperty(exports, "FixedSizeList", { enumerable: true, get: function () { return type_2.FixedSizeList; } });
90
+ Object.defineProperty(exports, "Struct", { enumerable: true, get: function () { return type_2.Struct; } });
@@ -0,0 +1,3 @@
1
+ export declare function deduceTypeFromColumn(value: unknown): StringConstructor | DateConstructor | Float32ArrayConstructor | null;
2
+ export declare function deduceTypeFromValue(value: unknown): StringConstructor | DateConstructor | Float32ArrayConstructor | null;
3
+ //# sourceMappingURL=deduce-column-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deduce-column-type.d.ts","sourceRoot":"","sources":["../../../src/lib/schema-utils/deduce-column-type.ts"],"names":[],"mappings":"AAmCA,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,iBAAiB,GAAG,eAAe,GAAG,uBAAuB,GAAG,IAAI,CAStE;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,GACb,iBAAiB,GAAG,eAAe,GAAG,uBAAuB,GAAG,IAAI,CAStE"}
@@ -1,23 +1,92 @@
1
- export function deduceTypeFromColumn(value) {
2
- if (value instanceof Date) {
3
- return Date;
4
- } else if (value instanceof Number) {
5
- return Float32Array;
6
- } else if (typeof value === 'string') {
7
- return String;
8
- }
9
-
10
- return null;
1
+ "use strict";
2
+ // Type deduction
3
+ // import {
4
+ // Schema
5
+ // Int,
6
+ // Int8,
7
+ // Int16,
8
+ // Int32,
9
+ // Uint8,
10
+ // Uint16,
11
+ // Uint32,
12
+ // Float32,
13
+ // Float64
14
+ // Bool,
15
+ // Utf8,
16
+ // TimestampMillisecond,
17
+ // Null
18
+ // } from '../schema.js';
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.deduceTypeFromValue = exports.deduceTypeFromColumn = void 0;
21
+ // const TYPED_ARRAY_TO_TYPE = {
22
+ // Int8Array: new Int8(),
23
+ // Int16Array: new Int16(),
24
+ // Int32Array: new Int32(),
25
+ // Uint8Array: new Uint8(),
26
+ // Uint8ClampedArray: new Uint8(),
27
+ // Uint16Array: new Uint16(),
28
+ // Uint32Array: new Uint32(),
29
+ // Float32Array: new Float32(),
30
+ // Float64Array: new Float64()
31
+ // };
32
+ // if (typeof BigInt64Array !== 'undefined') {
33
+ // TYPED_ARRAY_TO_TYPE.BigInt64Array = new Int64();
34
+ // TYPED_ARRAY_TO_TYPE.BigUint64Array = new Uint64();
35
+ // }
36
+ function deduceTypeFromColumn(value) {
37
+ if (value instanceof Date) {
38
+ return Date;
39
+ }
40
+ else if (value instanceof Number) {
41
+ return Float32Array;
42
+ }
43
+ else if (typeof value === 'string') {
44
+ return String;
45
+ }
46
+ return null;
11
47
  }
12
- export function deduceTypeFromValue(value) {
13
- if (value instanceof Date) {
14
- return Date;
15
- } else if (value instanceof Number) {
16
- return Float32Array;
17
- } else if (typeof value === 'string') {
18
- return String;
19
- }
48
+ exports.deduceTypeFromColumn = deduceTypeFromColumn;
49
+ function deduceTypeFromValue(value) {
50
+ if (value instanceof Date) {
51
+ return Date;
52
+ }
53
+ else if (value instanceof Number) {
54
+ return Float32Array;
55
+ }
56
+ else if (typeof value === 'string') {
57
+ return String;
58
+ }
59
+ return null;
60
+ }
61
+ exports.deduceTypeFromValue = deduceTypeFromValue;
62
+ /*
63
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
64
+ function deduceSchema(rows) {
65
+ const row = rows[0];
20
66
 
21
- return null;
67
+ const schema = {};
68
+ let i = 0;
69
+ for (const columnName in row) {
70
+ const value = row[columnName];
71
+ switch (typeof value) {
72
+ case 'number':
73
+ case 'boolean':
74
+ // TODO - booleans could be handled differently...
75
+ schema[columnName] = {name: String(columnName), index: i, type: Float32Array};
76
+ break;
77
+
78
+ case 'object':
79
+ schema[columnName] = {name: String(columnName), index: i, type: Array};
80
+ break;
81
+
82
+ case 'string':
83
+ default:
84
+ schema[columnName] = {name: String(columnName), index: i, type: Array};
85
+ // We currently only handle numeric rows
86
+ // TODO we could offer a function to map strings to numbers?
87
+ }
88
+ i++;
89
+ }
90
+ return schema;
22
91
  }
23
- //# sourceMappingURL=deduce-column-type.js.map
92
+ */
@@ -0,0 +1,2 @@
1
+ export declare function assert(condition: boolean, message?: string): void;
2
+ //# sourceMappingURL=assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/assert.ts"],"names":[],"mappings":"AAGA,wBAAgB,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,QAI1D"}
@@ -1,6 +1,12 @@
1
- export function assert(condition, message) {
2
- if (!condition) {
3
- throw new Error(message || 'loader assertion failed.');
4
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assert = void 0;
4
+ // Replacement for the external assert method to reduce bundle size
5
+ // Note: We don't use the second "message" argument in calling code,
6
+ // so no need to support it here
7
+ function assert(condition, message) {
8
+ if (!condition) {
9
+ throw new Error(message || 'loader assertion failed.');
10
+ }
5
11
  }
6
- //# sourceMappingURL=assert.js.map
12
+ exports.assert = assert;
@@ -0,0 +1,18 @@
1
+ export default class AsyncQueue<T> {
2
+ private _values;
3
+ private _settlers;
4
+ private _closed;
5
+ constructor();
6
+ close(): void;
7
+ [Symbol.asyncIterator](): AsyncIterator<T>;
8
+ enqueue(value: T | Error): void;
9
+ /**
10
+ * @returns a Promise for an IteratorResult
11
+ */
12
+ next(): Promise<any>;
13
+ }
14
+ /**
15
+ * @returns a Promise for an Array with the elements in `asyncIterable`
16
+ */
17
+ export declare function takeAsync(asyncIterable: AsyncIterable<any>, count?: number): Promise<any[]>;
18
+ //# sourceMappingURL=async-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-queue.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/async-queue.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,CAAC;IAC/B,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,SAAS,CAA8E;IAC/F,OAAO,CAAC,OAAO,CAAU;;IAazB,KAAK,IAAI,IAAI;IAOb,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;IAI1C,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI;IAoB/B;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;CAoBrB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,aAAa,EAAE,aAAa,CAAC,GAAG,CAAC,EACjC,KAAK,SAAW,GACf,OAAO,CAAC,GAAG,EAAE,CAAC,CAWhB"}
@@ -1,119 +1,92 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
-
3
- let _Symbol$asyncIterator;
4
-
1
+ "use strict";
2
+ // From https://github.com/rauschma/async-iter-demo/tree/master/src under MIT license
3
+ // http://2ality.com/2016/10/asynchronous-iteration.html
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.takeAsync = void 0;
5
6
  class ArrayQueue extends Array {
6
- enqueue(value) {
7
- return this.push(value);
8
- }
9
-
10
- dequeue() {
11
- return this.shift();
12
- }
13
-
7
+ enqueue(value) {
8
+ // Add at the end
9
+ return this.push(value);
10
+ }
11
+ dequeue() {
12
+ // Remove first element
13
+ return this.shift();
14
+ }
14
15
  }
15
-
16
- _Symbol$asyncIterator = Symbol.asyncIterator;
17
- export default class AsyncQueue {
18
- constructor() {
19
- _defineProperty(this, "_values", void 0);
20
-
21
- _defineProperty(this, "_settlers", void 0);
22
-
23
- _defineProperty(this, "_closed", void 0);
24
-
25
- this._values = new ArrayQueue();
26
- this._settlers = new ArrayQueue();
27
- this._closed = false;
28
- }
29
-
30
- close() {
31
- while (this._settlers.length > 0) {
32
- this._settlers.dequeue().resolve({
33
- done: true
34
- });
16
+ class AsyncQueue {
17
+ constructor() {
18
+ // enqueues > dequeues
19
+ this._values = new ArrayQueue();
20
+ // dequeues > enqueues
21
+ this._settlers = new ArrayQueue();
22
+ this._closed = false;
35
23
  }
36
-
37
- this._closed = true;
38
- }
39
-
40
- [_Symbol$asyncIterator]() {
41
- return this;
42
- }
43
-
44
- enqueue(value) {
45
- if (this._closed) {
46
- throw new Error('Closed');
24
+ close() {
25
+ while (this._settlers.length > 0) {
26
+ this._settlers.dequeue().resolve({ done: true });
27
+ }
28
+ this._closed = true;
47
29
  }
48
-
49
- if (this._settlers.length > 0) {
50
- if (this._values.length > 0) {
51
- throw new Error('Illegal internal state');
52
- }
53
-
54
- const settler = this._settlers.dequeue();
55
-
56
- if (value instanceof Error) {
57
- settler.reject(value);
58
- } else {
59
- settler.resolve({
60
- value
61
- });
62
- }
63
- } else {
64
- this._values.enqueue(value);
30
+ [Symbol.asyncIterator]() {
31
+ return this;
65
32
  }
66
- }
67
-
68
- next() {
69
- if (this._values.length > 0) {
70
- const value = this._values.dequeue();
71
-
72
- if (value instanceof Error) {
73
- return Promise.reject(value);
74
- }
75
-
76
- return Promise.resolve({
77
- value
78
- });
33
+ enqueue(value) {
34
+ if (this._closed) {
35
+ throw new Error('Closed');
36
+ }
37
+ if (this._settlers.length > 0) {
38
+ if (this._values.length > 0) {
39
+ throw new Error('Illegal internal state');
40
+ }
41
+ const settler = this._settlers.dequeue();
42
+ if (value instanceof Error) {
43
+ settler.reject(value);
44
+ }
45
+ else {
46
+ settler.resolve({ value });
47
+ }
48
+ }
49
+ else {
50
+ this._values.enqueue(value);
51
+ }
79
52
  }
80
-
81
- if (this._closed) {
82
- if (this._settlers.length > 0) {
83
- throw new Error('Illegal internal state');
84
- }
85
-
86
- return Promise.resolve({
87
- done: true
88
- });
53
+ /**
54
+ * @returns a Promise for an IteratorResult
55
+ */
56
+ next() {
57
+ if (this._values.length > 0) {
58
+ const value = this._values.dequeue();
59
+ if (value instanceof Error) {
60
+ return Promise.reject(value);
61
+ }
62
+ return Promise.resolve({ value });
63
+ }
64
+ if (this._closed) {
65
+ if (this._settlers.length > 0) {
66
+ throw new Error('Illegal internal state');
67
+ }
68
+ return Promise.resolve({ done: true });
69
+ }
70
+ // Wait for new values to be enqueued
71
+ return new Promise((resolve, reject) => {
72
+ this._settlers.enqueue({ resolve, reject });
73
+ });
89
74
  }
90
-
91
- return new Promise((resolve, reject) => {
92
- this._settlers.enqueue({
93
- resolve,
94
- reject
95
- });
96
- });
97
- }
98
-
99
75
  }
100
- export async function takeAsync(asyncIterable, count = Infinity) {
101
- const result = [];
102
- const iterator = asyncIterable[Symbol.asyncIterator]();
103
-
104
- while (result.length < count) {
105
- const {
106
- value,
107
- done
108
- } = await iterator.next();
109
-
110
- if (done) {
111
- break;
76
+ exports.default = AsyncQueue;
77
+ /**
78
+ * @returns a Promise for an Array with the elements in `asyncIterable`
79
+ */
80
+ async function takeAsync(asyncIterable, count = Infinity) {
81
+ const result = [];
82
+ const iterator = asyncIterable[Symbol.asyncIterator]();
83
+ while (result.length < count) {
84
+ const { value, done } = await iterator.next();
85
+ if (done) {
86
+ break;
87
+ }
88
+ result.push(value);
112
89
  }
113
-
114
- result.push(value);
115
- }
116
-
117
- return result;
90
+ return result;
118
91
  }
119
- //# sourceMappingURL=async-queue.js.map
92
+ exports.takeAsync = takeAsync;
@@ -0,0 +1,9 @@
1
+ /** Convert an object row to an array row */
2
+ export declare function convertToObjectRow(arrayRow: any[], headers: string[]): {
3
+ [columnName: string]: any;
4
+ };
5
+ /** Convert an object row to an array row */
6
+ export declare function convertToArrayRow(objectRow: {
7
+ [columnName: string]: any;
8
+ }, headers: string[]): any[];
9
+ //# sourceMappingURL=row-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/row-utils.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,GAAG,EAAE,EACf,OAAO,EAAE,MAAM,EAAE,GAChB;IAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,CAY7B;AAED,4CAA4C;AAC5C,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE;IAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,EACtC,OAAO,EAAE,MAAM,EAAE,GAChB,GAAG,EAAE,CAYP"}
@@ -1,35 +1,33 @@
1
- export function convertToObjectRow(arrayRow, headers) {
2
- if (!arrayRow) {
3
- throw new Error('null row');
4
- }
5
-
6
- if (!headers) {
7
- throw new Error('no headers');
8
- }
9
-
10
- const objectRow = {};
11
-
12
- for (let i = 0; i < headers.length; i++) {
13
- objectRow[headers[i]] = arrayRow[i];
14
- }
15
-
16
- return objectRow;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertToArrayRow = exports.convertToObjectRow = void 0;
4
+ /** Convert an object row to an array row */
5
+ function convertToObjectRow(arrayRow, headers) {
6
+ if (!arrayRow) {
7
+ throw new Error('null row');
8
+ }
9
+ if (!headers) {
10
+ throw new Error('no headers');
11
+ }
12
+ const objectRow = {};
13
+ for (let i = 0; i < headers.length; i++) {
14
+ objectRow[headers[i]] = arrayRow[i];
15
+ }
16
+ return objectRow;
17
17
  }
18
- export function convertToArrayRow(objectRow, headers) {
19
- if (!objectRow) {
20
- throw new Error('null row');
21
- }
22
-
23
- if (!headers) {
24
- throw new Error('no headers');
25
- }
26
-
27
- const arrayRow = new Array(headers.length);
28
-
29
- for (let i = 0; i < headers.length; i++) {
30
- arrayRow[i] = objectRow[headers[i]];
31
- }
32
-
33
- return arrayRow;
18
+ exports.convertToObjectRow = convertToObjectRow;
19
+ /** Convert an object row to an array row */
20
+ function convertToArrayRow(objectRow, headers) {
21
+ if (!objectRow) {
22
+ throw new Error('null row');
23
+ }
24
+ if (!headers) {
25
+ throw new Error('no headers');
26
+ }
27
+ const arrayRow = new Array(headers.length);
28
+ for (let i = 0; i < headers.length; i++) {
29
+ arrayRow[i] = objectRow[headers[i]];
30
+ }
31
+ return arrayRow;
34
32
  }
35
- //# sourceMappingURL=row-utils.js.map
33
+ exports.convertToArrayRow = convertToArrayRow;
@@ -0,0 +1,8 @@
1
+ /** Any typed array */
2
+ export declare type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
3
+ export declare type BigTypedArray = TypedArray | BigInt64Array | BigUint64Array;
4
+ /** Any numeric array: typed array or `number[]` */
5
+ export declare type NumberArray = number[] | TypedArray;
6
+ /** Any array: typed array or js array (`any[]`) */
7
+ export declare type AnyArray = any[] | TypedArray;
8
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,oBAAY,UAAU,GAClB,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,YAAY,GACZ,YAAY,CAAC;AAEjB,oBAAY,aAAa,GAAG,UAAU,GAAG,aAAa,GAAG,cAAc,CAAC;AAExE,mDAAmD;AACnD,oBAAY,WAAW,GAAG,MAAM,EAAE,GAAG,UAAU,CAAC;AAEhD,mDAAmD;AACnD,oBAAY,QAAQ,GAAG,GAAG,EAAE,GAAG,UAAU,CAAC"}
package/dist/types.js CHANGED
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/schema",
3
- "version": "3.1.0-alpha.2",
3
+ "version": "3.1.0-beta.1",
4
4
  "description": "Table format APIs for JSON, CSV, etc...",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -18,9 +18,9 @@
18
18
  "point cloud",
19
19
  "PLY"
20
20
  ],
21
- "types": "src/index.ts",
22
- "main": "dist/index.js",
23
- "module": "dist/index.js",
21
+ "types": "dist/index.d.ts",
22
+ "main": "dist/es5/index.js",
23
+ "module": "dist/esm/index.js",
24
24
  "sideEffects": false,
25
25
  "files": [
26
26
  "src",
@@ -29,12 +29,11 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "pre-build": "npm run build-bundle",
32
- "build-bundle": "webpack --display=minimal --config ../../scripts/webpack/bundle.js"
32
+ "build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/bundle.js"
33
33
  },
34
34
  "dependencies": {
35
35
  "@types/geojson": "^7946.0.7",
36
- "apache-arrow": "^4.0.0",
37
- "d3-dsv": "^1.2.0"
36
+ "apache-arrow": "^4.0.0"
38
37
  },
39
- "gitHead": "ca83b8f05a6874db93051d446266d9ea360affb2"
38
+ "gitHead": "980cdefb4e8ec9ef9c951d20c78cf77777707f49"
40
39
  }
package/src/bundle.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  // @ts-nocheck
2
2
  const moduleExports = require('./index');
3
- const _global = typeof window === 'undefined' ? global : window;
4
- _global.loaders = _global.loaders || {};
5
- module.exports = Object.assign(_global.loaders, moduleExports);
3
+ globalThis.loaders = globalThis.loaders || {};
4
+ module.exports = Object.assign(globalThis.loaders, moduleExports);
@@ -1,5 +1,5 @@
1
1
  import {MeshAttribute, MeshAttributes} from './mesh-types';
2
- import {Schema, Field, FixedSizeList} from '../../lib/schema';
2
+ import {Schema, Field, FixedSizeList} from '../../lib/schema/schema';
3
3
  import {getArrowTypeFromTypedArray} from '../../lib/arrow/arrow-like-type-utils';
4
4
 
5
5
  /**
@@ -6,7 +6,7 @@ import {
6
6
  Field,
7
7
  Data,
8
8
  FixedSizeListVector
9
- } from 'apache-arrow/Arrow';
9
+ } from 'apache-arrow/Arrow.dom';
10
10
  import {AbstractVector} from 'apache-arrow/vector';
11
11
  import {getArrowType, getArrowVector} from '../../lib/arrow/arrow-type-utils';
12
12
  import type {Mesh} from './mesh-types';
@@ -1,4 +1,4 @@
1
- import type {Schema} from '../../lib/schema';
1
+ import type {Schema} from '../../lib/schema/schema';
2
2
  import type {TypedArray} from '../../types';
3
3
  import type {ColumnarTable, ArrowTable} from '../table/table-types';
4
4