@loaders.gl/schema 4.0.0-beta.7 → 4.0.0
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/LICENSE +7 -7
- package/dist/lib/mesh/convert-mesh.d.ts.map +1 -1
- package/dist/lib/mesh/convert-mesh.js.map +1 -1
- package/dist/lib/mesh/deduce-mesh-schema.d.ts.map +1 -1
- package/dist/lib/mesh/deduce-mesh-schema.js.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-field.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-field.js.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-schema.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-schema.js.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/arrow-like-table.js.map +1 -1
- package/dist/lib/table/arrow-api/get-type-info.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/get-type-info.js.map +1 -1
- package/dist/lib/table/arrow-api/index.d.ts.map +1 -1
- package/dist/lib/table/arrow-api/index.js.map +1 -1
- package/dist/lib/table/batches/base-table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/table/batches/base-table-batch-aggregator.js.map +1 -1
- package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/table/batches/columnar-table-batch-aggregator.js.map +1 -1
- package/dist/lib/table/batches/row-table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/table/batches/row-table-batch-aggregator.js.map +1 -1
- package/dist/lib/table/batches/table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/table/batches/table-batch-aggregator.js.map +1 -1
- package/dist/lib/table/batches/table-batch-builder.d.ts.map +1 -1
- package/dist/lib/table/batches/table-batch-builder.js.map +1 -1
- package/dist/lib/table/simple-table/convert-table.d.ts.map +1 -1
- package/dist/lib/table/simple-table/convert-table.js.map +1 -1
- package/dist/lib/table/simple-table/data-type.d.ts.map +1 -1
- package/dist/lib/table/simple-table/data-type.js.map +1 -1
- package/dist/lib/table/simple-table/make-table.d.ts.map +1 -1
- package/dist/lib/table/simple-table/make-table.js.map +1 -1
- package/dist/lib/table/simple-table/table-accessors.d.ts.map +1 -1
- package/dist/lib/table/simple-table/table-accessors.js.map +1 -1
- package/dist/lib/table/simple-table/table-column.d.ts.map +1 -1
- package/dist/lib/table/simple-table/table-column.js.map +1 -1
- package/dist/types/batch.d.ts.map +1 -1
- package/dist/types/batch.js.map +1 -1
- package/dist/types/category-mesh.d.ts.map +1 -1
- package/dist/types/category-mesh.js.map +1 -1
- package/dist/types/category-table.d.ts.map +1 -1
- package/dist/types/category-table.js.map +1 -1
- package/dist/types/category-texture.d.ts.map +1 -1
- package/dist/types/category-texture.js.map +1 -1
- package/dist/types/flat-geometries.d.ts.map +1 -1
- package/dist/types/flat-geometries.js.map +1 -1
- package/dist/types/schema.d.ts.map +1 -1
- package/dist/types/schema.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/mesh/convert-mesh.ts +1 -0
- package/src/lib/mesh/deduce-mesh-schema.ts +1 -0
- package/src/lib/table/arrow-api/arrow-like-field.ts +1 -0
- package/src/lib/table/arrow-api/arrow-like-schema.ts +1 -0
- package/src/lib/table/arrow-api/arrow-like-table.ts +1 -0
- package/src/lib/table/arrow-api/get-type-info.ts +1 -0
- package/src/lib/table/arrow-api/index.ts +1 -0
- package/src/lib/table/batches/base-table-batch-aggregator.ts +1 -0
- package/src/lib/table/batches/columnar-table-batch-aggregator.ts +1 -0
- package/src/lib/table/batches/row-table-batch-aggregator.ts +1 -0
- package/src/lib/table/batches/table-batch-aggregator.ts +1 -0
- package/src/lib/table/batches/table-batch-builder.ts +1 -0
- package/src/lib/table/simple-table/convert-table.ts +1 -0
- package/src/lib/table/simple-table/data-type.ts +1 -0
- package/src/lib/table/simple-table/make-table.ts +1 -0
- package/src/lib/table/simple-table/table-accessors.ts +1 -0
- package/src/lib/table/simple-table/table-column.ts +1 -0
- package/src/types/batch.ts +1 -0
- package/src/types/category-mesh.ts +1 -0
- package/src/types/category-table.ts +1 -0
- package/src/types/category-texture.ts +1 -0
- package/src/types/flat-geometries.ts +1 -0
- package/src/types/schema.ts +1 -0
package/LICENSE
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This software includes parts of PhiloGL (https://github.com/philogb/philogl)
|
|
4
|
-
under MIT license. PhiloGL parts Copyright © 2013 Sencha Labs.
|
|
1
|
+
loaders.gl is licensed under the MIT license
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
Copyright (c) vis.gl contributors
|
|
7
4
|
|
|
8
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -23,8 +20,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
23
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
21
|
THE SOFTWARE.
|
|
25
22
|
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2015 Uber Technologies, Inc.
|
|
26
26
|
|
|
27
|
-
loaders.gl includes certain files from Cesium (https://github.com/AnalyticalGraphicsInc/cesium)
|
|
27
|
+
loaders.gl includes certain files from Cesium (https://github.com/AnalyticalGraphicsInc/cesium)
|
|
28
|
+
under the Apache 2 License (found in the submodule: modules/3d-tiles):)
|
|
28
29
|
|
|
29
30
|
Copyright 2011-2018 CesiumJS Contributors
|
|
30
31
|
|
|
@@ -38,4 +39,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
38
39
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
39
40
|
See the License for the specific language governing permissions and limitations under the License.
|
|
40
41
|
|
|
41
|
-
Cesium-derived code can be found in the submodule: modules/3d-tiles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-mesh.d.ts","sourceRoot":"","sources":["../../../src/lib/mesh/convert-mesh.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-mesh.d.ts","sourceRoot":"","sources":["../../../src/lib/mesh/convert-mesh.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,4BAA4B,CAAC;AAG1E,KAAK,WAAW,GAAG,MAAM,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE7D;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI,GAAG,aAAa,GAAG,UAAU,CAcnC;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,CAYpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-mesh.js","names":["convertMesh","mesh","shape","options","convertMeshToColumnarTable","Error","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":"
|
|
1
|
+
{"version":3,"file":"convert-mesh.js","names":["convertMesh","mesh","shape","options","convertMeshToColumnarTable","Error","columns","columnName","attribute","Object","entries","attributes","value","schema","data"],"sources":["../../../src/lib/mesh/convert-mesh.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\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":"AAYA,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,CAAE,qBAAoBF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAED,KAAM,EAAC,CAAC;EAC1D;AACF;AAOA,OAAO,SAASE,0BAA0BA,CAACH,IAAU,EAAiB;EACpE,MAAMK,OAAO,GAAG,CAAC,CAAC;EAElB,KAAK,MAAM,CAACC,UAAU,EAAEC,SAAS,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACT,IAAI,CAACU,UAAU,CAAC,EAAE;IACrEL,OAAO,CAACC,UAAU,CAAC,GAAGC,SAAS,CAACI,KAAK;EACvC;EAEA,OAAO;IACLV,KAAK,EAAE,gBAAgB;IACvBW,MAAM,EAAEZ,IAAI,CAACY,MAAM;IACnBC,IAAI,EAAER;EACR,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deduce-mesh-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/mesh/deduce-mesh-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deduce-mesh-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/mesh/deduce-mesh-schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAGjD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,cAAc,EAC1B,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACpC,MAAM,CAGR;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,aAAa,EACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACxC,KAAK,CASP;AAgBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAY1F"}
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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// Copyright (c) vis.gl contributors\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":"SAKQA,yBAAyB;AAQjC,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,GAAGC,gBAAgB,CAACN,UAAU,CAAC;EAC3C,OAAO;IAACK,MAAM;IAAEJ;EAAQ,CAAC;AAC3B;AASA,OAAO,SAASM,eAAeA,CAC7BC,IAAY,EACZC,SAAwB,EACxBC,gBAAyC,EAClC;EACP,MAAMC,IAAI,GAAGb,yBAAyB,CAACW,SAAS,CAACG,KAAK,CAAC;EACvD,MAAMX,QAAQ,GAAGS,gBAAgB,GAAGA,gBAAgB,GAAGG,yBAAyB,CAACJ,SAAS,CAAC;EAC3F,OAAO;IACLD,IAAI;IACJG,IAAI,EAAE;MAACA,IAAI,EAAE,iBAAiB;MAAEG,QAAQ,EAAEL,SAAS,CAACM,IAAI;MAAEC,QAAQ,EAAE,CAAC;QAACR,IAAI,EAAE,OAAO;QAAEG;MAAI,CAAC;IAAC,CAAC;IAC5FM,QAAQ,EAAE,KAAK;IACfhB;EACF,CAAC;AACH;AAOA,SAASK,gBAAgBA,CAACN,UAA0B,EAAW;EAC7D,MAAMK,MAAe,GAAG,EAAE;EAC1B,KAAK,MAAMa,aAAa,IAAIlB,UAAU,EAAE;IACtC,MAAMS,SAAwB,GAAGT,UAAU,CAACkB,aAAa,CAAC;IAC1Db,MAAM,CAACc,IAAI,CAACZ,eAAe,CAACW,aAAa,EAAET,SAAS,CAAC,CAAC;EACxD;EACA,OAAOJ,MAAM;AACf;AAOA,OAAO,SAASQ,yBAAyBA,CAACJ,SAAwB,EAA0B;EAC1F,MAAMW,MAA8B,GAAG,CAAC,CAAC;EACzC,IAAI,YAAY,IAAIX,SAAS,EAAE;IAC7BW,MAAM,CAACC,UAAU,GAAGZ,SAAS,CAACY,UAAU,CAAEC,QAAQ,CAAC,EAAE,CAAC;EACxD;EACA,IAAI,YAAY,IAAIb,SAAS,EAAE;IAC7BW,MAAM,CAACG,UAAU,GAAGd,SAAS,CAACc,UAAU,CAAED,QAAQ,CAAC,EAAE,CAAC;EACxD;EACA,IAAI,YAAY,IAAIb,SAAS,EAAE;IAC7BW,MAAM,CAACI,UAAU,GAAGf,SAAS,CAACe,UAAU,CAAEF,QAAQ,CAAC,CAAC;EACtD;EACA,OAAOF,MAAM;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-like-field.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/arrow-like-field.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-like-field.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/arrow-like-field.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAG5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,QAAQ,UAAQ,EAChB,QAAQ,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAa;IAQ3C,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,KAAK,IAAI,cAAc;IAIvB,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;IAS/B,QAAQ,IAAI,MAAM;CAKnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-like-field.js","names":["ArrowLikeField","constructor","name","type","nullable","arguments","length","undefined","metadata","Map","typeId","clone","compareTo","other","toString"],"sources":["../../../../src/lib/table/arrow-api/arrow-like-field.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {DataType} from './arrow-like-type';\n\n/**\n * ArrowJS `Field` API-compatible class for row-based tables\n * https://loaders.gl/arrowjs/docs/api-reference/field\n * A field holds name, nullable, and metadata information about a table \"column\"\n * A Schema is essentially a list of fields\n */\nexport class ArrowLikeField {\n name: string;\n type: DataType;\n nullable: boolean;\n metadata: Map<string, string>;\n\n constructor(\n name: string,\n type: DataType,\n nullable = false,\n metadata: Map<string, string> = new Map()\n ) {\n this.name = name;\n this.type = type;\n this.nullable = nullable;\n this.metadata = metadata;\n }\n\n get typeId(): number {\n return this.type && this.type.typeId;\n }\n\n clone(): ArrowLikeField {\n return new ArrowLikeField(this.name, this.type, this.nullable, this.metadata);\n }\n\n compareTo(other: this): boolean {\n return (\n this.name === other.name &&\n this.type === other.type &&\n this.nullable === other.nullable &&\n this.metadata === other.metadata\n );\n }\n\n toString(): string {\n return `${this.type}${this.nullable ? ', nullable' : ''}${\n this.metadata ? `, metadata: ${this.metadata}` : ''\n }`;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-like-field.js","names":["ArrowLikeField","constructor","name","type","nullable","arguments","length","undefined","metadata","Map","typeId","clone","compareTo","other","toString"],"sources":["../../../../src/lib/table/arrow-api/arrow-like-field.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {DataType} from './arrow-like-type';\n\n/**\n * ArrowJS `Field` API-compatible class for row-based tables\n * https://loaders.gl/arrowjs/docs/api-reference/field\n * A field holds name, nullable, and metadata information about a table \"column\"\n * A Schema is essentially a list of fields\n */\nexport class ArrowLikeField {\n name: string;\n type: DataType;\n nullable: boolean;\n metadata: Map<string, string>;\n\n constructor(\n name: string,\n type: DataType,\n nullable = false,\n metadata: Map<string, string> = new Map()\n ) {\n this.name = name;\n this.type = type;\n this.nullable = nullable;\n this.metadata = metadata;\n }\n\n get typeId(): number {\n return this.type && this.type.typeId;\n }\n\n clone(): ArrowLikeField {\n return new ArrowLikeField(this.name, this.type, this.nullable, this.metadata);\n }\n\n compareTo(other: this): boolean {\n return (\n this.name === other.name &&\n this.type === other.type &&\n this.nullable === other.nullable &&\n this.metadata === other.metadata\n );\n }\n\n toString(): string {\n return `${this.type}${this.nullable ? ', nullable' : ''}${\n this.metadata ? `, metadata: ${this.metadata}` : ''\n }`;\n }\n}\n"],"mappings":"AAWA,OAAO,MAAMA,cAAc,CAAC;EAM1BC,WAAWA,CACTC,IAAY,EACZC,IAAc,EAGd;IAAA,IAFAC,QAAQ,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;IAAA,IAChBG,QAA6B,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAII,GAAG,CAAC,CAAC;IAAA,KAT3CP,IAAI;IAAA,KACJC,IAAI;IAAA,KACJC,QAAQ;IAAA,KACRI,QAAQ;IAQN,IAAI,CAACN,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACI,QAAQ,GAAGA,QAAQ;EAC1B;EAEA,IAAIE,MAAMA,CAAA,EAAW;IACnB,OAAO,IAAI,CAACP,IAAI,IAAI,IAAI,CAACA,IAAI,CAACO,MAAM;EACtC;EAEAC,KAAKA,CAAA,EAAmB;IACtB,OAAO,IAAIX,cAAc,CAAC,IAAI,CAACE,IAAI,EAAE,IAAI,CAACC,IAAI,EAAE,IAAI,CAACC,QAAQ,EAAE,IAAI,CAACI,QAAQ,CAAC;EAC/E;EAEAI,SAASA,CAACC,KAAW,EAAW;IAC9B,OACE,IAAI,CAACX,IAAI,KAAKW,KAAK,CAACX,IAAI,IACxB,IAAI,CAACC,IAAI,KAAKU,KAAK,CAACV,IAAI,IACxB,IAAI,CAACC,QAAQ,KAAKS,KAAK,CAACT,QAAQ,IAChC,IAAI,CAACI,QAAQ,KAAKK,KAAK,CAACL,QAAQ;EAEpC;EAEAM,QAAQA,CAAA,EAAW;IACjB,OAAQ,GAAE,IAAI,CAACX,IAAK,GAAE,IAAI,CAACC,QAAQ,GAAG,YAAY,GAAG,EAAG,GACtD,IAAI,CAACI,QAAQ,GAAI,eAAc,IAAI,CAACA,QAAS,EAAC,GAAG,EAClD,EAAC;EACJ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-like-schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/arrow-like-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-like-schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/arrow-like-schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,cAAc,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAElD,qBAAa,eAAe;IAC1B,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAG5B,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,EAClC,QAAQ,GAAE,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAA6B;IAY5E,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;IAe1C,MAAM,CAAC,GAAG,WAAW,EAAE,MAAM,EAAE,GAAG,eAAe;IAUjD,QAAQ,CAAC,GAAG,aAAa,EAAE,MAAM,EAAE,GAAG,eAAe;IAMrD,MAAM,CAAC,cAAc,EAAE,eAAe,GAAG,cAAc,EAAE,GAAG,eAAe;CA2B5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-like-schema.js","names":["ArrowLikeField","ArrowLikeSchema","constructor","fields","metadata","arguments","length","undefined","Map","map","field","name","type","nullable","Object","entries","compareTo","other","i","select","nameMap","create","_len","columnNames","Array","_key","selectedFields","filter","selectAt","_len2","columnIndices","_key2","index","Boolean","assign","schemaOrFields","otherArrowLikeSchema","mergeMaps","fieldMap","mergedFields","values","m1","m2"],"sources":["../../../../src/lib/table/arrow-api/arrow-like-schema.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {SchemaMetadata, Field} from '../../../types/schema';\nimport {ArrowLikeField} from './arrow-like-field';\n\nexport class ArrowLikeSchema {\n fields: ArrowLikeField[];\n metadata: Map<string, string>;\n\n constructor(\n fields: ArrowLikeField[] | Field[],\n metadata: SchemaMetadata | Map<string, string> = new Map<string, string>()\n ) {\n // checkNames(fields);\n // For kepler fields, create arrow compatible `Fields` that have kepler fields as `metadata`\n this.fields = fields.map(\n (field) => new ArrowLikeField(field.name, field.type, field.nullable, field.metadata)\n );\n this.metadata =\n metadata instanceof Map ? metadata : new Map<string, string>(Object.entries(metadata));\n }\n\n // TODO - arrow only seems to compare fields, not metadata\n compareTo(other: ArrowLikeSchema): boolean {\n if (this.metadata !== other.metadata) {\n return false;\n }\n if (this.fields.length !== other.fields.length) {\n return false;\n }\n for (let i = 0; i < this.fields.length; ++i) {\n if (!this.fields[i].compareTo(other.fields[i])) {\n return false;\n }\n }\n return true;\n }\n\n select(...columnNames: string[]): ArrowLikeSchema {\n // Ensure column names reference valid fields\n const nameMap = Object.create(null);\n for (const name of columnNames) {\n nameMap[name] = true;\n }\n const selectedFields = this.fields.filter((field) => nameMap[field.name]);\n return new ArrowLikeSchema(selectedFields, this.metadata);\n }\n\n selectAt(...columnIndices: number[]): ArrowLikeSchema {\n // Ensure column indices reference valid fields\n const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean);\n return new ArrowLikeSchema(selectedFields, this.metadata);\n }\n\n assign(schemaOrFields: ArrowLikeSchema | ArrowLikeField[]): ArrowLikeSchema {\n let fields: ArrowLikeField[];\n let metadata = this.metadata;\n\n if (schemaOrFields instanceof ArrowLikeSchema) {\n const otherArrowLikeSchema = schemaOrFields;\n fields = otherArrowLikeSchema.fields;\n metadata = mergeMaps(mergeMaps(new Map(), this.metadata), otherArrowLikeSchema.metadata);\n } else {\n fields = schemaOrFields;\n }\n\n // Create a merged list of fields, overwrite fields in place, new fields at end\n const fieldMap: {[key: string]: ArrowLikeField} = Object.create(null);\n\n for (const field of this.fields) {\n fieldMap[field.name] = field;\n }\n\n for (const field of fields) {\n fieldMap[field.name] = field;\n }\n\n const mergedFields = Object.values(fieldMap);\n\n return new ArrowLikeSchema(mergedFields, metadata);\n }\n}\n\n// Warn if any duplicated field names\n// function checkNames(fields: Field[]): void {\n// const usedNames: Record<string, boolean> = {};\n// for (const field of fields) {\n// if (usedNames[field.name]) {\n// // eslint-disable-next-line\n// console.warn('ArrowLikeSchema: duplicated field name', field.name, field);\n// }\n// usedNames[field.name] = true;\n// }\n// }\n\nfunction mergeMaps<T>(m1: T, m2: T): T {\n // @ts-ignore\n return new Map([...(m1 || new Map()), ...(m2 || new Map())]);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-like-schema.js","names":["ArrowLikeField","ArrowLikeSchema","constructor","fields","metadata","arguments","length","undefined","Map","map","field","name","type","nullable","Object","entries","compareTo","other","i","select","nameMap","create","_len","columnNames","Array","_key","selectedFields","filter","selectAt","_len2","columnIndices","_key2","index","Boolean","assign","schemaOrFields","otherArrowLikeSchema","mergeMaps","fieldMap","mergedFields","values","m1","m2"],"sources":["../../../../src/lib/table/arrow-api/arrow-like-schema.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {SchemaMetadata, Field} from '../../../types/schema';\nimport {ArrowLikeField} from './arrow-like-field';\n\nexport class ArrowLikeSchema {\n fields: ArrowLikeField[];\n metadata: Map<string, string>;\n\n constructor(\n fields: ArrowLikeField[] | Field[],\n metadata: SchemaMetadata | Map<string, string> = new Map<string, string>()\n ) {\n // checkNames(fields);\n // For kepler fields, create arrow compatible `Fields` that have kepler fields as `metadata`\n this.fields = fields.map(\n (field) => new ArrowLikeField(field.name, field.type, field.nullable, field.metadata)\n );\n this.metadata =\n metadata instanceof Map ? metadata : new Map<string, string>(Object.entries(metadata));\n }\n\n // TODO - arrow only seems to compare fields, not metadata\n compareTo(other: ArrowLikeSchema): boolean {\n if (this.metadata !== other.metadata) {\n return false;\n }\n if (this.fields.length !== other.fields.length) {\n return false;\n }\n for (let i = 0; i < this.fields.length; ++i) {\n if (!this.fields[i].compareTo(other.fields[i])) {\n return false;\n }\n }\n return true;\n }\n\n select(...columnNames: string[]): ArrowLikeSchema {\n // Ensure column names reference valid fields\n const nameMap = Object.create(null);\n for (const name of columnNames) {\n nameMap[name] = true;\n }\n const selectedFields = this.fields.filter((field) => nameMap[field.name]);\n return new ArrowLikeSchema(selectedFields, this.metadata);\n }\n\n selectAt(...columnIndices: number[]): ArrowLikeSchema {\n // Ensure column indices reference valid fields\n const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean);\n return new ArrowLikeSchema(selectedFields, this.metadata);\n }\n\n assign(schemaOrFields: ArrowLikeSchema | ArrowLikeField[]): ArrowLikeSchema {\n let fields: ArrowLikeField[];\n let metadata = this.metadata;\n\n if (schemaOrFields instanceof ArrowLikeSchema) {\n const otherArrowLikeSchema = schemaOrFields;\n fields = otherArrowLikeSchema.fields;\n metadata = mergeMaps(mergeMaps(new Map(), this.metadata), otherArrowLikeSchema.metadata);\n } else {\n fields = schemaOrFields;\n }\n\n // Create a merged list of fields, overwrite fields in place, new fields at end\n const fieldMap: {[key: string]: ArrowLikeField} = Object.create(null);\n\n for (const field of this.fields) {\n fieldMap[field.name] = field;\n }\n\n for (const field of fields) {\n fieldMap[field.name] = field;\n }\n\n const mergedFields = Object.values(fieldMap);\n\n return new ArrowLikeSchema(mergedFields, metadata);\n }\n}\n\n// Warn if any duplicated field names\n// function checkNames(fields: Field[]): void {\n// const usedNames: Record<string, boolean> = {};\n// for (const field of fields) {\n// if (usedNames[field.name]) {\n// // eslint-disable-next-line\n// console.warn('ArrowLikeSchema: duplicated field name', field.name, field);\n// }\n// usedNames[field.name] = true;\n// }\n// }\n\nfunction mergeMaps<T>(m1: T, m2: T): T {\n // @ts-ignore\n return new Map([...(m1 || new Map()), ...(m2 || new Map())]);\n}\n"],"mappings":"SAIQA,cAAc;AAEtB,OAAO,MAAMC,eAAe,CAAC;EAI3BC,WAAWA,CACTC,MAAkC,EAElC;IAAA,IADAC,QAA8C,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAIG,GAAG,CAAiB,CAAC;IAAA,KAL5EL,MAAM;IAAA,KACNC,QAAQ;IAQN,IAAI,CAACD,MAAM,GAAGA,MAAM,CAACM,GAAG,CACrBC,KAAK,IAAK,IAAIV,cAAc,CAACU,KAAK,CAACC,IAAI,EAAED,KAAK,CAACE,IAAI,EAAEF,KAAK,CAACG,QAAQ,EAAEH,KAAK,CAACN,QAAQ,CACtF,CAAC;IACD,IAAI,CAACA,QAAQ,GACXA,QAAQ,YAAYI,GAAG,GAAGJ,QAAQ,GAAG,IAAII,GAAG,CAAiBM,MAAM,CAACC,OAAO,CAACX,QAAQ,CAAC,CAAC;EAC1F;EAGAY,SAASA,CAACC,KAAsB,EAAW;IACzC,IAAI,IAAI,CAACb,QAAQ,KAAKa,KAAK,CAACb,QAAQ,EAAE;MACpC,OAAO,KAAK;IACd;IACA,IAAI,IAAI,CAACD,MAAM,CAACG,MAAM,KAAKW,KAAK,CAACd,MAAM,CAACG,MAA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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-like-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/arrow-like-table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-like-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/arrow-like-table.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,KAAK,EAAC,MAAM,+BAA+B,CAAC;AAEpD,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAgBpD,cAAM,eAAe;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;gBAEP,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM;IAK5C,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI9B,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC;CAW9B;AAED;;;GAGG;AACH,qBAAa,cAAc;IACzB,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC;gBAED,KAAK,EAAE,KAAK;IAUxB,IAAI,IAAI,YAEP;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe;CAO9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-like-table.js","names":["ArrowLikeSchema","deduceTableSchema","getTableCell","getTableLength","getTableNumCols","ArrowLikeVector","constructor","table","columnName","get","rowIndex","toArray","_arrowTable$getChild","shape","arrowTable","data","getChild","Error","ArrowLikeTable","schema","fields","metadata","features","numCols","length"],"sources":["../../../../src/lib/table/arrow-api/arrow-like-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {Table} from '../../../types/category-table';\n\nimport {ArrowLikeSchema} from './arrow-like-schema';\n\nimport {deduceTableSchema} from '../simple-table/table-schema';\n\nimport {\n getTableCell,\n getTableLength,\n getTableNumCols\n // getTableCell,\n // getTableRowShape,\n // getTableColumnIndex,\n // getTableColumnName,\n // getTableRowAsObject,\n // getTableRowAsArray\n} from '../simple-table/table-accessors';\n\nclass ArrowLikeVector {\n table: Table;\n columnName: string;\n\n constructor(table: Table, columnName: string) {\n this.table = table;\n this.columnName = columnName;\n }\n\n get(rowIndex: number): unknown {\n return getTableCell(this.table, rowIndex, this.columnName);\n }\n\n toArray(): ArrayLike<unknown> {\n switch (this.table.shape) {\n case 'arrow-table':\n const arrowTable = this.table.data as any;\n return arrowTable.getChild(this.columnName)?.toArray();\n case 'columnar-table':\n return this.table.data[this.columnName];\n default:\n throw new Error(this.table.shape);\n }\n }\n}\n\n/**\n * Class that provides an API similar to Apache Arrow Table class\n * Forwards methods directly if the underlying table is Arrow, otherwise calls accessor functions\n */\nexport class ArrowLikeTable {\n schema: ArrowLikeSchema;\n table: Table;\n\n constructor(table: Table) {\n const schema = table.schema || deduceTableSchema(table);\n this.schema = new ArrowLikeSchema(schema.fields, schema.metadata);\n this.table = {...table, schema};\n }\n\n // get schema() {\n // return this.table.schema;\n // }\n\n get data() {\n return this.table.shape === 'geojson-table' ? this.table.features : this.table.data;\n }\n\n get numCols(): number {\n return getTableNumCols(this.table);\n }\n\n get length(): number {\n return getTableLength(this.table);\n }\n\n getChild(columnName: string): ArrowLikeVector {\n return new ArrowLikeVector(this.table, columnName);\n }\n\n // getChildAt(columnIndex: number): ArrowLikeVector {\n // return\n // }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-like-table.js","names":["ArrowLikeSchema","deduceTableSchema","getTableCell","getTableLength","getTableNumCols","ArrowLikeVector","constructor","table","columnName","get","rowIndex","toArray","_arrowTable$getChild","shape","arrowTable","data","getChild","Error","ArrowLikeTable","schema","fields","metadata","features","numCols","length"],"sources":["../../../../src/lib/table/arrow-api/arrow-like-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {Table} from '../../../types/category-table';\n\nimport {ArrowLikeSchema} from './arrow-like-schema';\n\nimport {deduceTableSchema} from '../simple-table/table-schema';\n\nimport {\n getTableCell,\n getTableLength,\n getTableNumCols\n // getTableCell,\n // getTableRowShape,\n // getTableColumnIndex,\n // getTableColumnName,\n // getTableRowAsObject,\n // getTableRowAsArray\n} from '../simple-table/table-accessors';\n\nclass ArrowLikeVector {\n table: Table;\n columnName: string;\n\n constructor(table: Table, columnName: string) {\n this.table = table;\n this.columnName = columnName;\n }\n\n get(rowIndex: number): unknown {\n return getTableCell(this.table, rowIndex, this.columnName);\n }\n\n toArray(): ArrayLike<unknown> {\n switch (this.table.shape) {\n case 'arrow-table':\n const arrowTable = this.table.data as any;\n return arrowTable.getChild(this.columnName)?.toArray();\n case 'columnar-table':\n return this.table.data[this.columnName];\n default:\n throw new Error(this.table.shape);\n }\n }\n}\n\n/**\n * Class that provides an API similar to Apache Arrow Table class\n * Forwards methods directly if the underlying table is Arrow, otherwise calls accessor functions\n */\nexport class ArrowLikeTable {\n schema: ArrowLikeSchema;\n table: Table;\n\n constructor(table: Table) {\n const schema = table.schema || deduceTableSchema(table);\n this.schema = new ArrowLikeSchema(schema.fields, schema.metadata);\n this.table = {...table, schema};\n }\n\n // get schema() {\n // return this.table.schema;\n // }\n\n get data() {\n return this.table.shape === 'geojson-table' ? this.table.features : this.table.data;\n }\n\n get numCols(): number {\n return getTableNumCols(this.table);\n }\n\n get length(): number {\n return getTableLength(this.table);\n }\n\n getChild(columnName: string): ArrowLikeVector {\n return new ArrowLikeVector(this.table, columnName);\n }\n\n // getChildAt(columnIndex: number): ArrowLikeVector {\n // return\n // }\n}\n"],"mappings":"SAKQA,eAAe;AAAA,SAEfC,iBAAiB;AAAA,SAGvBC,YAAY,EACZC,cAAc,EACdC,eAAe;AASjB,MAAMC,eAAe,CAAC;EAIpBC,WAAWA,CAACC,KAAY,EAAEC,UAAkB,EAAE;IAAA,KAH9CD,KAAK;IAAA,KACLC,UAAU;IAGR,IAAI,CAACD,KAAK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W;IACpB,OAAOnB,eAAe,CAAC,IAAI,CAACG,KAAK,CAAC;EACpC;EAEA,IAAIiB,MAAMA,CAAA,EAAW;IACnB,OAAOrB,cAAc,CAAC,IAAI,CAACI,KAAK,CAAC;EACnC;EAEAS,QAAQA,CAACR,UAAkB,EAAmB;IAC5C,OAAO,IAAIH,eAAe,CAAC,IAAI,CAACE,KAAK,EAAEC,UAAU,CAAC;EACpD;AAKF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-type-info.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/get-type-info.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-type-info.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/get-type-info.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,GAAG,GAAG;IAC/C,MAAM,EAAE,IAAI,CAAC;IACb,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAQA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-type-info.js","names":["Type","getTypeInfo","arrowTypeLike","typeId","ArrayType","typeName","toString","typeEnumName","getTypeKey","precision","ReverseType","typeKey","key"],"sources":["../../../../src/lib/table/arrow-api/get-type-info.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {Type} from './arrow-like-type';\n\n/**\n * Gets type information from an Arrow type object or \"mock\" Arrow type object\n * @param arrowTypeLike Arrow Type or type object of similar shape\n */\nexport function getTypeInfo(arrowTypeLike: any): {\n typeId: Type;\n ArrayType: ArrayLike<unknown>;\n typeName: string;\n typeEnumName?: string;\n precision?: number;\n} {\n return {\n typeId: arrowTypeLike.typeId,\n ArrayType: arrowTypeLike.ArrayType,\n typeName: arrowTypeLike.toString(),\n typeEnumName: getTypeKey(arrowTypeLike.typeId),\n precision: arrowTypeLike.precision\n };\n}\n\nlet ReverseType: {[key: string]: string} | null = null;\n\nfunction getTypeKey(typeKey) {\n if (!ReverseType) {\n ReverseType = {};\n for (const key in Type) {\n ReverseType[Type[key]] = key;\n }\n }\n\n return ReverseType[typeKey];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-type-info.js","names":["Type","getTypeInfo","arrowTypeLike","typeId","ArrayType","typeName","toString","typeEnumName","getTypeKey","precision","ReverseType","typeKey","key"],"sources":["../../../../src/lib/table/arrow-api/get-type-info.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {Type} from './arrow-like-type';\n\n/**\n * Gets type information from an Arrow type object or \"mock\" Arrow type object\n * @param arrowTypeLike Arrow Type or type object of similar shape\n */\nexport function getTypeInfo(arrowTypeLike: any): {\n typeId: Type;\n ArrayType: ArrayLike<unknown>;\n typeName: string;\n typeEnumName?: string;\n precision?: number;\n} {\n return {\n typeId: arrowTypeLike.typeId,\n ArrayType: arrowTypeLike.ArrayType,\n typeName: arrowTypeLike.toString(),\n typeEnumName: getTypeKey(arrowTypeLike.typeId),\n precision: arrowTypeLike.precision\n };\n}\n\nlet ReverseType: {[key: string]: string} | null = null;\n\nfunction getTypeKey(typeKey) {\n if (!ReverseType) {\n ReverseType = {};\n for (const key in Type) {\n ReverseType[Type[key]] = key;\n }\n }\n\n return ReverseType[typeKey];\n}\n"],"mappings":"SAGQA,IAAI;AAMZ,OAAO,SAASC,WAAWA,CAACC,aAAkB,EAM5C;EACA,OAAO;IACLC,MAAM,EAAED,aAAa,CAACC,MAAM;IAC5BC,SAAS,EAAEF,aAAa,CAACE,SAAS;IAClCC,QAAQ,EAAEH,aAAa,CAACI,QAAQ,CAAC,CAAC;IAClCC,YAAY,EAAEC,UAAU,CAACN,aAAa,CAACC,MAAM,CAAC;IAC9CM,SAAS,EAAEP,aAAa,CAACO;EAC3B,CAAC;AACH;AAEA,IAAIC,WAA2C,GAAG,IAAI;AAEtD,SAASF,UAAUA,CAACG,OAAO,EAAE;EAC3B,IAAI,CAACD,WAAW,EAAE;IAChBA,WAAW,GAAG,CAAC,CAAC;IAChB,KAAK,MAAME,GAAG,IAAIZ,IAAI,EAAE;MACtBU,WAAW,CAACV,IAAI,CAACY,GAAG,CAAC,CAAC,GAAGA,GAAG;IAC9B;EACF;EAEA,OAAOF,WAAW,CAACC,OAAO,CAAC;AAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,cAAc,IAAI,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,eAAe,IAAI,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,cAAc,IAAI,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAC3D,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ArrowLikeField","Field","ArrowLikeSchema","Schema","ArrowLikeTable","Table"],"sources":["../../../../src/lib/table/arrow-api/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nexport {ArrowLikeField as Field} from './arrow-like-field';\nexport {ArrowLikeSchema as Schema} from './arrow-like-schema';\nexport {ArrowLikeTable as Table} from './arrow-like-table';\nexport * from './arrow-like-type';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["ArrowLikeField","Field","ArrowLikeSchema","Schema","ArrowLikeTable","Table"],"sources":["../../../../src/lib/table/arrow-api/index.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nexport {ArrowLikeField as Field} from './arrow-like-field';\nexport {ArrowLikeSchema as Schema} from './arrow-like-schema';\nexport {ArrowLikeTable as Table} from './arrow-like-table';\nexport * from './arrow-like-type';\n"],"mappings":"SAGQA,cAAc,IAAIC,KAAK;AAAA,SACvBC,eAAe,IAAIC,MAAM;AAAA,SACzBC,cAAc,IAAIC,KAAK;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/base-table-batch-aggregator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/base-table-batch-aggregator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAIjF,qBAAa,wBAAyB,YAAW,oBAAoB;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;IAE3B,MAAM,EAAE,MAAM,CAAK;IACnB,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAQ;IAC1B,MAAM,EAAE,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAgB;gBAEpB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IActD,QAAQ,IAAI,MAAM;IAIlB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAU9C,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAUrE,QAAQ,IAAI,UAAU,GAAG,IAAI;CAoB9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-table-batch-aggregator.js","names":["DEFAULT_ROW_COUNT","BaseTableBatchAggregator","constructor","schema","options","length","rows","cursor","_headers","Array","isArray","key","index","name","rowCount","addArrayRow","row","Number","isFinite","addObjectRow","getBatch","slice","batch","shape","batchType","data"],"sources":["../../../../src/lib/table/batches/base-table-batch-aggregator.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Schema} from '../../../types/schema';\nimport type {TableBatch} from '../../../types/category-table';\nimport {TableBatchAggregator, TableBatchOptions} from './table-batch-aggregator';\n\nconst DEFAULT_ROW_COUNT = 100;\n\nexport class BaseTableBatchAggregator implements TableBatchAggregator {\n schema: Schema;\n options: TableBatchOptions;\n\n length: number = 0;\n rows: any[] | null = null;\n cursor: number = 0;\n private _headers: string[] = [];\n\n constructor(schema: Schema, options: TableBatchOptions) {\n this.options = options;\n this.schema = schema;\n\n // schema is an array if there're no headers\n // object if there are headers\n if (!Array.isArray(schema)) {\n this._headers = [];\n for (const key in schema) {\n this._headers[schema[key].index] = schema[key].name;\n }\n }\n }\n\n rowCount(): number {\n return this.length;\n }\n\n addArrayRow(row: any[], cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);\n this.rows[this.length] = row;\n this.length++;\n }\n\n addObjectRow(row: {[columnName: string]: any}, cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);\n this.rows[this.length] = row;\n this.length++;\n }\n\n getBatch(): TableBatch | null {\n let rows = this.rows;\n if (!rows) {\n return null;\n }\n\n rows = rows.slice(0, this.length);\n this.rows = null;\n\n const batch: TableBatch = {\n shape: this.options.shape,\n batchType: 'data',\n data: rows,\n length: this.length,\n schema: this.schema,\n cursor: this.cursor\n };\n\n return batch;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-table-batch-aggregator.js","names":["DEFAULT_ROW_COUNT","BaseTableBatchAggregator","constructor","schema","options","length","rows","cursor","_headers","Array","isArray","key","index","name","rowCount","addArrayRow","row","Number","isFinite","addObjectRow","getBatch","slice","batch","shape","batchType","data"],"sources":["../../../../src/lib/table/batches/base-table-batch-aggregator.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Schema} from '../../../types/schema';\nimport type {TableBatch} from '../../../types/category-table';\nimport {TableBatchAggregator, TableBatchOptions} from './table-batch-aggregator';\n\nconst DEFAULT_ROW_COUNT = 100;\n\nexport class BaseTableBatchAggregator implements TableBatchAggregator {\n schema: Schema;\n options: TableBatchOptions;\n\n length: number = 0;\n rows: any[] | null = null;\n cursor: number = 0;\n private _headers: string[] = [];\n\n constructor(schema: Schema, options: TableBatchOptions) {\n this.options = options;\n this.schema = schema;\n\n // schema is an array if there're no headers\n // object if there are headers\n if (!Array.isArray(schema)) {\n this._headers = [];\n for (const key in schema) {\n this._headers[schema[key].index] = schema[key].name;\n }\n }\n }\n\n rowCount(): number {\n return this.length;\n }\n\n addArrayRow(row: any[], cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);\n this.rows[this.length] = row;\n this.length++;\n }\n\n addObjectRow(row: {[columnName: string]: any}, cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);\n this.rows[this.length] = row;\n this.length++;\n }\n\n getBatch(): TableBatch | null {\n let rows = this.rows;\n if (!rows) {\n return null;\n }\n\n rows = rows.slice(0, this.length);\n this.rows = null;\n\n const batch: TableBatch = {\n shape: this.options.shape,\n batchType: 'data',\n data: rows,\n length: this.length,\n schema: this.schema,\n cursor: this.cursor\n };\n\n return batch;\n }\n}\n"],"mappings":"AAOA,MA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I,IAAIG,KAAK,CAACT,iBAAiB,CAAC;IACrD,IAAI,CAACM,IAAI,CAAC,IAAI,CAACD,MAAM,CAAC,GAAGW,GAAG;IAC5B,IAAI,CAACX,MAAM,EAAE;EACf;EAEAe,QAAQA,CAAA,EAAsB;IAC5B,IAAId,IAAI,GAAG,IAAI,CAACA,IAAI;IACpB,IAAI,CAACA,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IAEAA,IAAI,GAAGA,IAAI,CAACe,KAAK,CAAC,CAAC,EAAE,IAAI,CAAChB,MAAM,CAAC;IACjC,IAAI,CAACC,IAAI,GAAG,IAAI;IAEhB,MAAMgB,KAAiB,GAAG;MACxBC,KAAK,EAAE,IAAI,CAACnB,OAAO,CAACmB,KAAK;MACzBC,SAAS,EAAE,MAAM;MACjBC,IAAI,EAAEnB,IAAI;MACVD,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBF,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBI,MAAM,EAAE,IAAI,CAACA;IACf,CAAC;IAED,OAAOe,KAAK;EACd;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnar-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/columnar-table-batch-aggregator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"columnar-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/columnar-table-batch-aggregator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAE9D,KAAK,yBAAyB,GAAG,EAAE,CAAC;AAIpC,qBAAa,4BAA6B,YAAW,oBAAoB;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAK;IACnB,SAAS,EAAE,MAAM,CAAK;IACtB,OAAO,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,EAAE,CAAA;KAAC,CAAM;gBAEhC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB;IAK9D,QAAQ,IAAI,MAAM;IAIlB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;IAWtB,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,GAAG,IAAI;IASpD,QAAQ,IAAI,kBAAkB,GAAG,eAAe,GAAG,IAAI;IA6BvD,kBAAkB;IA8BlB,aAAa;CAKd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnar-table-batch-aggregator.js","names":["DEFAULT_ROW_COUNT","ColumnarTableBatchAggregator","constructor","schema","options","length","allocated","columns","_reallocateColumns","rowCount","addArrayRow","row","i","fieldName","addObjectRow","getBatch","_pruneColumns","Array","isArray","field","name","index","batch","shape","batchType","data","ArrayType","type","Float32Array","oldColumn","ArrayBuffer","isView","typedArray","set","columnName","column","Object","entries","slice"],"sources":["../../../../src/lib/table/batches/columnar-table-batch-aggregator.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Schema} from '../../../types/schema';\nimport type {ColumnarTableBatch, ArrowTableBatch} from '../../../types/category-table';\nimport {TableBatchAggregator} from './table-batch-aggregator';\n\ntype ColumnarTableBatchOptions = {};\n\nconst DEFAULT_ROW_COUNT = 100;\n\nexport class ColumnarTableBatchAggregator implements TableBatchAggregator {\n schema: Schema;\n length: number = 0;\n allocated: number = 0;\n columns: {[columnName: string]: any[]} = {};\n\n constructor(schema: Schema, options: ColumnarTableBatchOptions) {\n this.schema = schema;\n this._reallocateColumns();\n }\n\n rowCount(): number {\n return this.length;\n }\n\n addArrayRow(row: any[]) {\n // If user keeps pushing rows beyond batch size, reallocate\n this._reallocateColumns();\n let i = 0;\n // TODO what if no csv header, columns not populated?\n for (const fieldName in this.columns) {\n this.columns[fieldName][this.length] = row[i++];\n }\n this.length++;\n }\n\n addObjectRow(row: {[columnName: string]: any}): void {\n // If user keeps pushing rows beyond batch size, reallocate\n this._reallocateColumns();\n for (const fieldName in row) {\n this.columns[fieldName][this.length] = row[fieldName];\n }\n this.length++;\n }\n\n getBatch(): ColumnarTableBatch | ArrowTableBatch | null {\n this._pruneColumns();\n const columns = Array.isArray(this.schema) ? this.columns : {};\n\n // schema is an array if there're no headers\n // object if there are headers\n // columns should match schema format\n if (!Array.isArray(this.schema)) {\n for (const fieldName in this.schema) {\n const field = this.schema[fieldName];\n columns[field.name] = this.columns[field.index];\n }\n }\n\n this.columns = {};\n\n const batch: ColumnarTableBatch = {\n shape: 'columnar-table',\n batchType: 'data',\n data: columns,\n schema: this.schema,\n length: this.length\n };\n\n return batch;\n }\n\n // HELPERS\n\n _reallocateColumns() {\n if (this.length < this.allocated) {\n return;\n }\n\n // @ts-ignore TODO\n this.allocated = this.allocated > 0 ? (this.allocated *= 2) : DEFAULT_ROW_COUNT;\n this.columns = {};\n\n for (const fieldName in this.schema) {\n const field = this.schema[fieldName];\n const ArrayType = field.type || Float32Array;\n const oldColumn = this.columns[field.index];\n\n if (oldColumn && ArrayBuffer.isView(oldColumn)) {\n // Copy the old data to the new array\n const typedArray = new ArrayType(this.allocated);\n typedArray.set(oldColumn);\n this.columns[field.index] = typedArray;\n } else if (oldColumn) {\n // Plain array\n oldColumn.length = this.allocated;\n this.columns[field.index] = oldColumn;\n } else {\n // Create new\n this.columns[field.index] = new ArrayType(this.allocated);\n }\n }\n }\n\n _pruneColumns() {\n for (const [columnName, column] of Object.entries(this.columns)) {\n this.columns[columnName] = column.slice(0, this.length);\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"columnar-table-batch-aggregator.js","names":["DEFAULT_ROW_COUNT","ColumnarTableBatchAggregator","constructor","schema","options","length","allocated","columns","_reallocateColumns","rowCount","addArrayRow","row","i","fieldName","addObjectRow","getBatch","_pruneColumns","Array","isArray","field","name","index","batch","shape","batchType","data","ArrayType","type","Float32Array","oldColumn","ArrayBuffer","isView","typedArray","set","columnName","column","Object","entries","slice"],"sources":["../../../../src/lib/table/batches/columnar-table-batch-aggregator.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Schema} from '../../../types/schema';\nimport type {ColumnarTableBatch, ArrowTableBatch} from '../../../types/category-table';\nimport {TableBatchAggregator} from './table-batch-aggregator';\n\ntype ColumnarTableBatchOptions = {};\n\nconst DEFAULT_ROW_COUNT = 100;\n\nexport class ColumnarTableBatchAggregator implements TableBatchAggregator {\n schema: Schema;\n length: number = 0;\n allocated: number = 0;\n columns: {[columnName: string]: any[]} = {};\n\n constructor(schema: Schema, options: ColumnarTableBatchOptions) {\n this.schema = schema;\n this._reallocateColumns();\n }\n\n rowCount(): number {\n return this.length;\n }\n\n addArrayRow(row: any[]) {\n // If user keeps pushing rows beyond batch size, reallocate\n this._reallocateColumns();\n let i = 0;\n // TODO what if no csv header, columns not populated?\n for (const fieldName in this.columns) {\n this.columns[fieldName][this.length] = row[i++];\n }\n this.length++;\n }\n\n addObjectRow(row: {[columnName: string]: any}): void {\n // If user keeps pushing rows beyond batch size, reallocate\n this._reallocateColumns();\n for (const fieldName in row) {\n this.columns[fieldName][this.length] = row[fieldName];\n }\n this.length++;\n }\n\n getBatch(): ColumnarTableBatch | ArrowTableBatch | null {\n this._pruneColumns();\n const columns = Array.isArray(this.schema) ? this.columns : {};\n\n // schema is an array if there're no headers\n // object if there are headers\n // columns should match schema format\n if (!Array.isArray(this.schema)) {\n for (const fieldName in this.schema) {\n const field = this.schema[fieldName];\n columns[field.name] = this.columns[field.index];\n }\n }\n\n this.columns = {};\n\n const batch: ColumnarTableBatch = {\n shape: 'columnar-table',\n batchType: 'data',\n data: columns,\n schema: this.schema,\n length: this.length\n };\n\n return batch;\n }\n\n // HELPERS\n\n _reallocateColumns() {\n if (this.length < this.allocated) {\n return;\n }\n\n // @ts-ignore TODO\n this.allocated = this.allocated > 0 ? (this.allocated *= 2) : DEFAULT_ROW_COUNT;\n this.columns = {};\n\n for (const fieldName in this.schema) {\n const field = this.schema[fieldName];\n const ArrayType = field.type || Float32Array;\n const oldColumn = this.columns[field.index];\n\n if (oldColumn && ArrayBuffer.isView(oldColumn)) {\n // Copy the old data to the new array\n const typedArray = new ArrayType(this.allocated);\n typedArray.set(oldColumn);\n this.columns[field.index] = typedArray;\n } else if (oldColumn) {\n // Plain array\n oldColumn.length = this.allocated;\n this.columns[field.index] = oldColumn;\n } else {\n // Create new\n this.columns[field.index] = new ArrayType(this.allocated);\n }\n }\n }\n\n _pruneColumns() {\n for (const [columnName, column] of Object.entries(this.columns)) {\n this.columns[columnName] = column.slice(0, this.length);\n }\n }\n}\n"],"mappings":"AASA,MAAMA,iBAAiB,GAAG,GAAG;AAE7B,OAAO,MAAMC,4BAA4B,CAAiC;EAMxEC,WAAWA,CAACC,MAAc,EAAEC,OAAkC,EAAE;IAAA,KALhED,MAAM;IAAA,KACNE,MAAM,GAAW,CAAC;IAAA,KAClBC,SAAS,GAAW,CAAC;IAAA,KACrBC,OAAO,GAAkC,CAAC,CAAC;IAGzC,IAAI,CAACJ,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACK,kBAAkB,CAAC,CAAC;EAC3B;EAEAC,QAAQA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACJ,MAAM;EACpB;EAEAK,WAAWA,CAACC,GAAU,EAAE;IAEtB,IAAI,CAACH,kBAAkB,CAAC,CAAC;IACzB,IAAII,CAAC,GAAG,CAAC;IAET,KAAK,MAAMC,SAAS,IAAI,IAAI,CAACN,OAAO,EAAE;MACpC,IAAI,CAACA,OAAO,CAACM,SAAS,CAAC,CAAC,IAAI,CAACR,MAAM,CAAC,GAAGM,GAAG,CAACC,CAAC,EAAE,CAAC;IACjD;IACA,IAAI,CAACP,MAAM,EAAE;EACf;EAEAS,YAAYA,CAACH,GAAgC,EAA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AAK,MAAMM,SAAS,IAAI,IAAI,CAACV,MAAM,EAAE;MACnC,MAAMgB,KAAK,GAAG,IAAI,CAAChB,MAAM,CAACU,SAAS,CAAC;MACpC,MAAMa,SAAS,GAAGP,KAAK,CAACQ,IAAI,IAAIC,YAAY;MAC5C,MAAMC,SAAS,GAAG,IAAI,CAACtB,OAAO,CAACY,KAAK,CAACE,KAAK,CAAC;MAE3C,IAAIQ,SAAS,IAAIC,WAAW,CAACC,MAAM,CAACF,SAAS,CAAC,EAAE;QAE9C,MAAMG,UAAU,GAAG,IAAIN,SAAS,CAAC,IAAI,CAACpB,SAAS,CAAC;QAChD0B,UAAU,CAACC,GAAG,CAACJ,SAAS,CAAC;QACzB,IAAI,CAACtB,OAAO,CAACY,KAAK,CAACE,KAAK,CAAC,GAAGW,UAAU;MACxC,CAAC,MAAM,IAAIH,SAAS,EAAE;QAEpBA,SAAS,CAACxB,MAAM,GAAG,IAAI,CAACC,SAAS;QACjC,IAAI,CAACC,OAAO,CAACY,KAAK,CAACE,KAAK,CAAC,GAAGQ,SAAS;MACvC,CAAC,MAAM;QAEL,IAAI,CAACtB,OAAO,CAACY,KAAK,CAACE,KAAK,CAAC,GAAG,IAAIK,SAAS,CAAC,IAAI,CAACpB,SAAS,CAAC;MAC3D;IACF;EACF;EAEAU,aAAaA,CAAA,EAAG;IACd,KAAK,MAAM,CAACkB,UAAU,EAAEC,MAAM,CAAC,IAAIC,MAAM,CAACC,OAAO,CAAC,IAAI,CAAC9B,OAAO,CAAC,EAAE;MAC/D,IAAI,CAACA,OAAO,CAAC2B,UAAU,CAAC,GAAGC,MAAM,CAACG,KAAK,CAAC,CAAC,EAAE,IAAI,CAACjC,MAAM,CAAC;IACzD;EACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/row-table-batch-aggregator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"row-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/row-table-batch-aggregator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,+BAA+B,CAAC;AAG9D,OAAO,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAIjF,qBAAa,uBAAwB,YAAW,oBAAoB;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;IAE3B,MAAM,EAAE,MAAM,CAAK;IACnB,UAAU,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,EAAE,GAAG,IAAI,CAAQ;IAC5D,SAAS,EAAE,OAAO,EAAE,EAAE,GAAG,IAAI,CAAQ;IACrC,MAAM,EAAE,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAgB;gBAEpB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IActD,QAAQ,IAAI,MAAM;IAIlB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAmB9C,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAmBrE,QAAQ,IAAI,UAAU,GAAG,IAAI;CAmB9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-table-batch-aggregator.js","names":["convertToArrayRow","convertToObjectRow","DEFAULT_ROW_COUNT","RowTableBatchAggregator","constructor","schema","options","length","objectRows","arrayRows","cursor","_headers","Array","isArray","key","index","name","rowCount","addArrayRow","row","Number","isFinite","shape","rowObject","addObjectRow","rowArray","getBatch","rows","slice","batchType","data"],"sources":["../../../../src/lib/table/batches/row-table-batch-aggregator.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Schema} from '../../../types/schema';\nimport type {TableBatch} from '../../../types/category-table';\n// import type {ArrayRowTableBatch, ObjectRowTableBatch} from '../../category/table';\nimport {convertToArrayRow, convertToObjectRow} from '../simple-table/row-utils';\nimport {TableBatchAggregator, TableBatchOptions} from './table-batch-aggregator';\n\nconst DEFAULT_ROW_COUNT = 100;\n\nexport class RowTableBatchAggregator implements TableBatchAggregator {\n schema: Schema;\n options: TableBatchOptions;\n\n length: number = 0;\n objectRows: {[columnName: string]: unknown}[] | null = null;\n arrayRows: unknown[][] | null = null;\n cursor: number = 0;\n private _headers: string[] = [];\n\n constructor(schema: Schema, options: TableBatchOptions) {\n this.options = options;\n this.schema = schema;\n\n // schema is an array if there're no headers\n // object if there are headers\n if (!Array.isArray(schema)) {\n this._headers = [];\n for (const key in schema) {\n this._headers[schema[key].index] = schema[key].name;\n }\n }\n }\n\n rowCount(): number {\n return this.length;\n }\n\n addArrayRow(row: any[], cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n // eslint-disable-next-line default-case\n switch (this.options.shape) {\n case 'object-row-table':\n const rowObject = convertToObjectRow(row, this._headers);\n this.addObjectRow(rowObject, cursor);\n break;\n case 'array-row-table':\n this.arrayRows = this.arrayRows || new Array(DEFAULT_ROW_COUNT);\n this.arrayRows[this.length] = row;\n this.length++;\n break;\n }\n }\n\n addObjectRow(row: {[columnName: string]: any}, cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n // eslint-disable-next-line default-case\n switch (this.options.shape) {\n case 'array-row-table':\n const rowArray = convertToArrayRow(row, this._headers);\n this.addArrayRow(rowArray, cursor);\n break;\n case 'object-row-table':\n this.objectRows = this.objectRows || new Array(DEFAULT_ROW_COUNT);\n this.objectRows[this.length] = row;\n this.length++;\n break;\n }\n }\n\n getBatch(): TableBatch | null {\n let rows = this.arrayRows || this.objectRows;\n if (!rows) {\n return null;\n }\n\n rows = rows.slice(0, this.length);\n this.arrayRows = null;\n this.objectRows = null;\n\n return {\n shape: this.options.shape,\n batchType: 'data',\n data: rows,\n length: this.length,\n schema: this.schema,\n cursor: this.cursor\n };\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"row-table-batch-aggregator.js","names":["convertToArrayRow","convertToObjectRow","DEFAULT_ROW_COUNT","RowTableBatchAggregator","constructor","schema","options","length","objectRows","arrayRows","cursor","_headers","Array","isArray","key","index","name","rowCount","addArrayRow","row","Number","isFinite","shape","rowObject","addObjectRow","rowArray","getBatch","rows","slice","batchType","data"],"sources":["../../../../src/lib/table/batches/row-table-batch-aggregator.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Schema} from '../../../types/schema';\nimport type {TableBatch} from '../../../types/category-table';\n// import type {ArrayRowTableBatch, ObjectRowTableBatch} from '../../category/table';\nimport {convertToArrayRow, convertToObjectRow} from '../simple-table/row-utils';\nimport {TableBatchAggregator, TableBatchOptions} from './table-batch-aggregator';\n\nconst DEFAULT_ROW_COUNT = 100;\n\nexport class RowTableBatchAggregator implements TableBatchAggregator {\n schema: Schema;\n options: TableBatchOptions;\n\n length: number = 0;\n objectRows: {[columnName: string]: unknown}[] | null = null;\n arrayRows: unknown[][] | null = null;\n cursor: number = 0;\n private _headers: string[] = [];\n\n constructor(schema: Schema, options: TableBatchOptions) {\n this.options = options;\n this.schema = schema;\n\n // schema is an array if there're no headers\n // object if there are headers\n if (!Array.isArray(schema)) {\n this._headers = [];\n for (const key in schema) {\n this._headers[schema[key].index] = schema[key].name;\n }\n }\n }\n\n rowCount(): number {\n return this.length;\n }\n\n addArrayRow(row: any[], cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n // eslint-disable-next-line default-case\n switch (this.options.shape) {\n case 'object-row-table':\n const rowObject = convertToObjectRow(row, this._headers);\n this.addObjectRow(rowObject, cursor);\n break;\n case 'array-row-table':\n this.arrayRows = this.arrayRows || new Array(DEFAULT_ROW_COUNT);\n this.arrayRows[this.length] = row;\n this.length++;\n break;\n }\n }\n\n addObjectRow(row: {[columnName: string]: any}, cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n // eslint-disable-next-line default-case\n switch (this.options.shape) {\n case 'array-row-table':\n const rowArray = convertToArrayRow(row, this._headers);\n this.addArrayRow(rowArray, cursor);\n break;\n case 'object-row-table':\n this.objectRows = this.objectRows || new Array(DEFAULT_ROW_COUNT);\n this.objectRows[this.length] = row;\n this.length++;\n break;\n }\n }\n\n getBatch(): TableBatch | null {\n let rows = this.arrayRows || this.objectRows;\n if (!rows) {\n return null;\n }\n\n rows = rows.slice(0, this.length);\n this.arrayRows = null;\n this.objectRows = null;\n\n return {\n shape: this.options.shape,\n batchType: 'data',\n data: rows,\n length: this.length,\n schema: this.schema,\n cursor: this.cursor\n };\n }\n}\n"],"mappings":"SAMQA,iBAAiB,EAAEC,kBAAkB;AAG7C,MAAMC,iBAAiB,GAAG,GAAG;AAE7B,OAAO,MAAMC,uBAAuB,CAAiC;EAUnEC,WAAWA,CAACC,MAAc,EAAEC,OAA0B,EAAE;IAAA,KATxDD,MAAM;IAAA,KACNC,OAAO;IAAA,KAEPC,MAAM,GAAW,CAAC;IAAA,KAClBC,UAAU,GAA6C,IAAI;IAAA,KAC3DC,SAAS,GAAuB,IAAI;IAAA,KACpCC,MAAM,GAAW,CAAC;IAAA,KACVC,QAAQ,GAAa,EAAE;IAG7B,IAAI,CAACL,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACD,MAAM,GAAGA,MAAM;IAIpB,IAAI,CAACO,KAAK,CAACC,OAAO,CAACR,MAAM,CAAC,EAAE;MAC1B,IAAI,CAACM,QAAQ,GAAG,EAAE;MAClB,KAAK,MAAMG,GAAG,IAAIT,MAAM,EAAE;QACxB,IAAI,CAACM,QAAQ,CAACN,MAAM,CAACS,GAAG,CAAC,CAACC,KAAK,CAA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GAAG;QAClC,IAAI,CAACZ,MAAM,EAAE;QACb;IACJ;EACF;EAEAmB,QAAQA,CAAA,EAAsB;IAC5B,IAAIC,IAAI,GAAG,IAAI,CAAClB,SAAS,IAAI,IAAI,CAACD,UAAU;IAC5C,IAAI,CAACmB,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IAEAA,IAAI,GAAGA,IAAI,CAACC,KAAK,CAAC,CAAC,EAAE,IAAI,CAACrB,MAAM,CAAC;IACjC,IAAI,CAACE,SAAS,GAAG,IAAI;IACrB,IAAI,CAACD,UAAU,GAAG,IAAI;IAEtB,OAAO;MACLc,KAAK,EAAE,IAAI,CAAChB,OAAO,CAACgB,KAAK;MACzBO,SAAS,EAAE,MAAM;MACjBC,IAAI,EAAEH,IAAI;MACVpB,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBF,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBK,MAAM,EAAE,IAAI,CAACA;IACf,CAAC;EACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/table-batch-aggregator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/table-batch-aggregator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,+BAA+B,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,oBAAoB,CAAC;CACxE;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qBAAqB;IACrB,QAAQ,IAAI,MAAM,CAAC;IACnB,kBAAkB;IAClB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC9B,kBAAkB;IAClB,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,GAAG,IAAI,CAAC;IACrD,4BAA4B;IAC5B,QAAQ,IAAI,UAAU,GAAG,IAAI,CAAC;CAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-batch-aggregator.js","names":[],"sources":["../../../../src/lib/table/batches/table-batch-aggregator.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Schema} from '../../../types/schema';\nimport type {TableBatch} from '../../../types/category-table';\n\nexport interface TableBatchOptions {\n batchSize: number | string;\n [key: string]: any;\n}\n\nexport interface TableBatchConstructor {\n new (schema: Schema, options: TableBatchOptions): TableBatchAggregator;\n}\n\n/**\n * TableBatchBuilder delegates batch building to this interface\n */\nexport interface TableBatchAggregator {\n /** Number of rows */\n rowCount(): number;\n /** Add one row */\n addArrayRow(row: any[]): void;\n /** Add one row */\n addObjectRow(row: {[columnName: string]: any}): void;\n /** return a batch object */\n getBatch(): TableBatch | null;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"table-batch-aggregator.js","names":[],"sources":["../../../../src/lib/table/batches/table-batch-aggregator.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Schema} from '../../../types/schema';\nimport type {TableBatch} from '../../../types/category-table';\n\nexport interface TableBatchOptions {\n batchSize: number | string;\n [key: string]: any;\n}\n\nexport interface TableBatchConstructor {\n new (schema: Schema, options: TableBatchOptions): TableBatchAggregator;\n}\n\n/**\n * TableBatchBuilder delegates batch building to this interface\n */\nexport interface TableBatchAggregator {\n /** Number of rows */\n rowCount(): number;\n /** Add one row */\n addArrayRow(row: any[]): void;\n /** Add one row */\n addObjectRow(row: {[columnName: string]: any}): void;\n /** return a batch object */\n getBatch(): TableBatch | null;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-batch-builder.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/table-batch-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-batch-builder.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/table-batch-builder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EAAuB,qBAAqB,EAAC,MAAM,0BAA0B,CAAC;AAM1F,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,WAAW,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,aAAa,CAAC;IAC/F,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAYF,yDAAyD;AACzD,qBAAa,iBAAiB;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;IAE5C,OAAO,CAAC,UAAU,CAAqC;IACvD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,QAAQ,CAAa;IAE7B,MAAM,CAAC,UAAU,CAAC,EAAE,qBAAqB,CAAC;gBAE9B,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB;IAK9D,YAAY,IAAI,OAAO;IAUvB,kDAAkD;IAClD,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,GAAG,IAAI;IActD,+BAA+B;IAC/B,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;IAQhC,+BAA+B;IAC/B,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,GAAG,IAAI;IAQ9D,sDAAsD;IACtD,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI;IAUhD,YAAY,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,UAAU,GAAG,IAAI;IAI1D,aAAa,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,UAAU,GAAG,IAAI;IAM3D,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,GAAG,MAAM;IAI3C,OAAO,CAAC,OAAO;IA2Bf;;OAEG;IACH,OAAO,CAAC,SAAS;IAmBjB,OAAO,CAAC,kBAAkB;CAkB3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-batch-builder.js","names":["BaseTableBatchAggregator","RowTableBatchAggregator","ColumnarTableBatchAggregator","DEFAULT_OPTIONS","shape","batchSize","batchDebounceMs","limit","_limitMB","ERR_MESSAGE","TableBatchBuilder","constructor","schema","options","aggregator","batchCount","bytesUsed","isChunkComplete","lastBatchEmittedMs","Date","now","totalLength","totalBytes","rowBytes","limitReached","_this$options","_this$options2","Boolean","addRow","row","_estimateRowMB","Array","isArray","addArrayRow","addObjectRow","TableBatchType","_getTableBatchType","chunkComplete","chunk","ArrayBuffer","byteLength","length","getFullBatch","_isFull","_getBatch","getFinalBatch","Object","keys","rowCount","normalizedBatch","getBatch","count","assign","ArrowBatch","Error"],"sources":["../../../../src/lib/table/batches/table-batch-builder.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Schema} from '../../../types/schema';\nimport type {TableBatch} from '../../../types/category-table';\nimport type {TableBatchAggregator, TableBatchConstructor} from './table-batch-aggregator';\nimport {BaseTableBatchAggregator} from './base-table-batch-aggregator';\nimport {RowTableBatchAggregator} from './row-table-batch-aggregator';\nimport {ColumnarTableBatchAggregator} from './columnar-table-batch-aggregator';\n\n// TODO define interface instead\ntype TableBatchBuilderOptions = {\n shape: 'row-table' | 'array-row-table' | 'object-row-table' | 'columnar-table' | 'arrow-table';\n batchSize?: number | 'auto';\n batchDebounceMs?: number;\n limit: number;\n _limitMB: number;\n};\n\ntype GetBatchOptions = {\n bytesUsed?: number;\n [key: string]: any;\n};\n\nconst DEFAULT_OPTIONS: Required<TableBatchBuilderOptions> = {\n shape: 'array-row-table',\n batchSize: 'auto',\n batchDebounceMs: 0,\n limit: 0,\n _limitMB: 0\n};\n\nconst ERR_MESSAGE = 'TableBatchBuilder';\n\n/** Incrementally builds batches from a stream of rows */\nexport class TableBatchBuilder {\n schema: Schema;\n options: Required<TableBatchBuilderOptions>;\n\n private aggregator: TableBatchAggregator | null = null;\n private batchCount: number = 0;\n private bytesUsed: number = 0;\n private isChunkComplete: boolean = false;\n private lastBatchEmittedMs: number = Date.now();\n private totalLength: number = 0;\n private totalBytes: number = 0;\n private rowBytes: number = 0;\n\n static ArrowBatch?: TableBatchConstructor;\n\n constructor(schema: Schema, options?: TableBatchBuilderOptions) {\n this.schema = schema;\n this.options = {...DEFAULT_OPTIONS, ...options};\n }\n\n limitReached(): boolean {\n if (Boolean(this.options?.limit) && this.totalLength >= this.options.limit) {\n return true;\n }\n if (Boolean(this.options?._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {\n return true;\n }\n return false;\n }\n\n /** @deprecated Use addArrayRow or addObjectRow */\n addRow(row: any[] | {[columnName: string]: any}): void {\n if (this.limitReached()) {\n return;\n }\n this.totalLength++;\n this.rowBytes = this.rowBytes || this._estimateRowMB(row);\n this.totalBytes += this.rowBytes;\n if (Array.isArray(row)) {\n this.addArrayRow(row);\n } else {\n this.addObjectRow(row);\n }\n }\n\n /** Add one row to the batch */\n protected addArrayRow(row: any[]) {\n if (!this.aggregator) {\n const TableBatchType = this._getTableBatchType();\n this.aggregator = new TableBatchType(this.schema, this.options);\n }\n this.aggregator.addArrayRow(row);\n }\n\n /** Add one row to the batch */\n protected addObjectRow(row: {[columnName: string]: any}): void {\n if (!this.aggregator) {\n const TableBatchType = this._getTableBatchType();\n this.aggregator = new TableBatchType(this.schema, this.options);\n }\n this.aggregator.addObjectRow(row);\n }\n\n /** Mark an incoming raw memory chunk has completed */\n chunkComplete(chunk: ArrayBuffer | string): void {\n if (chunk instanceof ArrayBuffer) {\n this.bytesUsed += chunk.byteLength;\n }\n if (typeof chunk === 'string') {\n this.bytesUsed += chunk.length;\n }\n this.isChunkComplete = true;\n }\n\n getFullBatch(options?: GetBatchOptions): TableBatch | null {\n return this._isFull() ? this._getBatch(options) : null;\n }\n\n getFinalBatch(options?: GetBatchOptions): TableBatch | null {\n return this._getBatch(options);\n }\n\n // INTERNAL\n\n _estimateRowMB(row: any[] | object): number {\n return Array.isArray(row) ? row.length * 8 : Object.keys(row).length * 8;\n }\n\n private _isFull(): boolean {\n // No batch, not ready\n if (!this.aggregator || this.aggregator.rowCount() === 0) {\n return false;\n }\n\n // if batchSize === 'auto' we wait for chunk to complete\n // if batchSize === number, ensure we have enough rows\n if (this.options.batchSize === 'auto') {\n if (!this.isChunkComplete) {\n return false;\n }\n } else if (this.options.batchSize > this.aggregator.rowCount()) {\n return false;\n }\n\n // Debounce batches\n if (this.options.batchDebounceMs > Date.now() - this.lastBatchEmittedMs) {\n return false;\n }\n\n // Emit batch\n this.isChunkComplete = false;\n this.lastBatchEmittedMs = Date.now();\n return true;\n }\n\n /**\n * bytesUsed can be set via chunkComplete or via getBatch*\n */\n private _getBatch(options?: GetBatchOptions): TableBatch | null {\n if (!this.aggregator) {\n return null;\n }\n\n // TODO - this can overly increment bytes used?\n if (options?.bytesUsed) {\n this.bytesUsed = options.bytesUsed;\n }\n const normalizedBatch = this.aggregator.getBatch() as TableBatch;\n normalizedBatch.count = this.batchCount;\n normalizedBatch.bytesUsed = this.bytesUsed;\n Object.assign(normalizedBatch, options);\n\n this.batchCount++;\n this.aggregator = null;\n return normalizedBatch;\n }\n\n private _getTableBatchType(): TableBatchConstructor {\n switch (this.options.shape) {\n case 'row-table':\n return BaseTableBatchAggregator;\n case 'array-row-table':\n case 'object-row-table':\n return RowTableBatchAggregator;\n case 'columnar-table':\n return ColumnarTableBatchAggregator;\n case 'arrow-table':\n if (!TableBatchBuilder.ArrowBatch) {\n throw new Error(ERR_MESSAGE);\n }\n return TableBatchBuilder.ArrowBatch;\n default:\n throw new Error(ERR_MESSAGE);\n }\n }\n}\n"],"mappings":"SAKQA,wBAAwB;AAAA,SACxBC,uBAAuB;AAAA,SACvBC,4BAA4B;AAgBpC,MAAMC,eAAmD,GAAG;EAC1DC,KAAK,EAAE,iBAAiB;EACxBC,SAAS,EAAE,MAAM;EACjBC,eAAe,EAAE,CAAC;EAClBC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAE;AACZ,CAAC;AAED,MAAMC,WAAW,GAAG,mBAAmB;AAGvC,OAAO,MAAMC,iBAAiB,CAAC;EAe7BC,WAAWA,CAACC,MAAc,EAAEC,OAAkC,EAAE;IAAA,KAdhED,MAAM;IAAA,KACNC,OAAO;IAAA,KAECC,UAAU,GAAgC,IAAI;IAAA,KAC9CC,UAAU,GAAW,CAAC;IAAA,KACtBC,SAAS,GAAW,CAAC;IAAA,KACrBC,eAAe,GAAY,KAAK;IAAA,KAChCC,kBAAkB,GAAWC,IAAI,CAACC,GAAG,CAAC,CAAC;IAAA,KACvCC,WAAW,GAAW,CAAC;IAAA,KACvBC,UAAU,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AO,CAACT,KAAK;MACxB,KAAK,WAAW;QACd,OAAOJ,wBAAwB;MACjC,KAAK,iBAAiB;MACtB,KAAK,kBAAkB;QACrB,OAAOC,uBAAuB;MAChC,KAAK,gBAAgB;QACnB,OAAOC,4BAA4B;MACrC,KAAK,aAAa;QAChB,IAAI,CAACQ,iBAAiB,CAAC2C,UAAU,EAAE;UACjC,MAAM,IAAIC,KAAK,CAAC7C,WAAW,CAAC;QAC9B;QACA,OAAOC,iBAAiB,CAAC2C,UAAU;MACrC;QACE,MAAM,IAAIC,KAAK,CAAC7C,WAAW,CAAC;IAChC;EACF;AACF;AA3JaC,iBAAiB,CAarB2C,UAAU"}
|
|
1
|
+
{"version":3,"file":"table-batch-builder.js","names":["BaseTableBatchAggregator","RowTableBatchAggregator","ColumnarTableBatchAggregator","DEFAULT_OPTIONS","shape","batchSize","batchDebounceMs","limit","_limitMB","ERR_MESSAGE","TableBatchBuilder","constructor","schema","options","aggregator","batchCount","bytesUsed","isChunkComplete","lastBatchEmittedMs","Date","now","totalLength","totalBytes","rowBytes","limitReached","_this$options","_this$options2","Boolean","addRow","row","_estimateRowMB","Array","isArray","addArrayRow","addObjectRow","TableBatchType","_getTableBatchType","chunkComplete","chunk","ArrayBuffer","byteLength","length","getFullBatch","_isFull","_getBatch","getFinalBatch","Object","keys","rowCount","normalizedBatch","getBatch","count","assign","ArrowBatch","Error"],"sources":["../../../../src/lib/table/batches/table-batch-builder.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Schema} from '../../../types/schema';\nimport type {TableBatch} from '../../../types/category-table';\nimport type {TableBatchAggregator, TableBatchConstructor} from './table-batch-aggregator';\nimport {BaseTableBatchAggregator} from './base-table-batch-aggregator';\nimport {RowTableBatchAggregator} from './row-table-batch-aggregator';\nimport {ColumnarTableBatchAggregator} from './columnar-table-batch-aggregator';\n\n// TODO define interface instead\ntype TableBatchBuilderOptions = {\n shape: 'row-table' | 'array-row-table' | 'object-row-table' | 'columnar-table' | 'arrow-table';\n batchSize?: number | 'auto';\n batchDebounceMs?: number;\n limit: number;\n _limitMB: number;\n};\n\ntype GetBatchOptions = {\n bytesUsed?: number;\n [key: string]: any;\n};\n\nconst DEFAULT_OPTIONS: Required<TableBatchBuilderOptions> = {\n shape: 'array-row-table',\n batchSize: 'auto',\n batchDebounceMs: 0,\n limit: 0,\n _limitMB: 0\n};\n\nconst ERR_MESSAGE = 'TableBatchBuilder';\n\n/** Incrementally builds batches from a stream of rows */\nexport class TableBatchBuilder {\n schema: Schema;\n options: Required<TableBatchBuilderOptions>;\n\n private aggregator: TableBatchAggregator | null = null;\n private batchCount: number = 0;\n private bytesUsed: number = 0;\n private isChunkComplete: boolean = false;\n private lastBatchEmittedMs: number = Date.now();\n private totalLength: number = 0;\n private totalBytes: number = 0;\n private rowBytes: number = 0;\n\n static ArrowBatch?: TableBatchConstructor;\n\n constructor(schema: Schema, options?: TableBatchBuilderOptions) {\n this.schema = schema;\n this.options = {...DEFAULT_OPTIONS, ...options};\n }\n\n limitReached(): boolean {\n if (Boolean(this.options?.limit) && this.totalLength >= this.options.limit) {\n return true;\n }\n if (Boolean(this.options?._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {\n return true;\n }\n return false;\n }\n\n /** @deprecated Use addArrayRow or addObjectRow */\n addRow(row: any[] | {[columnName: string]: any}): void {\n if (this.limitReached()) {\n return;\n }\n this.totalLength++;\n this.rowBytes = this.rowBytes || this._estimateRowMB(row);\n this.totalBytes += this.rowBytes;\n if (Array.isArray(row)) {\n this.addArrayRow(row);\n } else {\n this.addObjectRow(row);\n }\n }\n\n /** Add one row to the batch */\n protected addArrayRow(row: any[]) {\n if (!this.aggregator) {\n const TableBatchType = this._getTableBatchType();\n this.aggregator = new TableBatchType(this.schema, this.options);\n }\n this.aggregator.addArrayRow(row);\n }\n\n /** Add one row to the batch */\n protected addObjectRow(row: {[columnName: string]: any}): void {\n if (!this.aggregator) {\n const TableBatchType = this._getTableBatchType();\n this.aggregator = new TableBatchType(this.schema, this.options);\n }\n this.aggregator.addObjectRow(row);\n }\n\n /** Mark an incoming raw memory chunk has completed */\n chunkComplete(chunk: ArrayBuffer | string): void {\n if (chunk instanceof ArrayBuffer) {\n this.bytesUsed += chunk.byteLength;\n }\n if (typeof chunk === 'string') {\n this.bytesUsed += chunk.length;\n }\n this.isChunkComplete = true;\n }\n\n getFullBatch(options?: GetBatchOptions): TableBatch | null {\n return this._isFull() ? this._getBatch(options) : null;\n }\n\n getFinalBatch(options?: GetBatchOptions): TableBatch | null {\n return this._getBatch(options);\n }\n\n // INTERNAL\n\n _estimateRowMB(row: any[] | object): number {\n return Array.isArray(row) ? row.length * 8 : Object.keys(row).length * 8;\n }\n\n private _isFull(): boolean {\n // No batch, not ready\n if (!this.aggregator || this.aggregator.rowCount() === 0) {\n return false;\n }\n\n // if batchSize === 'auto' we wait for chunk to complete\n // if batchSize === number, ensure we have enough rows\n if (this.options.batchSize === 'auto') {\n if (!this.isChunkComplete) {\n return false;\n }\n } else if (this.options.batchSize > this.aggregator.rowCount()) {\n return false;\n }\n\n // Debounce batches\n if (this.options.batchDebounceMs > Date.now() - this.lastBatchEmittedMs) {\n return false;\n }\n\n // Emit batch\n this.isChunkComplete = false;\n this.lastBatchEmittedMs = Date.now();\n return true;\n }\n\n /**\n * bytesUsed can be set via chunkComplete or via getBatch*\n */\n private _getBatch(options?: GetBatchOptions): TableBatch | null {\n if (!this.aggregator) {\n return null;\n }\n\n // TODO - this can overly increment bytes used?\n if (options?.bytesUsed) {\n this.bytesUsed = options.bytesUsed;\n }\n const normalizedBatch = this.aggregator.getBatch() as TableBatch;\n normalizedBatch.count = this.batchCount;\n normalizedBatch.bytesUsed = this.bytesUsed;\n Object.assign(normalizedBatch, options);\n\n this.batchCount++;\n this.aggregator = null;\n return normalizedBatch;\n }\n\n private _getTableBatchType(): TableBatchConstructor {\n switch (this.options.shape) {\n case 'row-table':\n return BaseTableBatchAggregator;\n case 'array-row-table':\n case 'object-row-table':\n return RowTableBatchAggregator;\n case 'columnar-table':\n return ColumnarTableBatchAggregator;\n case 'arrow-table':\n if (!TableBatchBuilder.ArrowBatch) {\n throw new Error(ERR_MESSAGE);\n }\n return TableBatchBuilder.ArrowBatch;\n default:\n throw new Error(ERR_MESSAGE);\n }\n }\n}\n"],"mappings":"SAMQA,wBAAwB;AAAA,SACxBC,uBAAuB;AAAA,SACvBC,4BAA4B;AAgBpC,MAAMC,eAAmD,GAAG;EAC1DC,KAAK,EAAE,iBAAiB;EACxBC,SAAS,EAAE,MAAM;EACjBC,eAAe,EAAE,CAAC;EAClBC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAE;AACZ,CAAC;AAED,MAAMC,WAAW,GAAG,mBAAmB;AAGvC,OAAO,MAAMC,iBAAiB,CAAC;EAe7BC,WAAWA,CAACC,MAAc,EAAEC,OAAkC,EAAE;IAAA,KAdhED,MAAM;IAAA,KACNC,OAAO;IAAA,KAECC,UAAU,GAAgC,IAAI;IAAA,KAC9CC,UAAU,GAAW,CAAC;IAAA,KACtBC,SAAS,GAAW,CAAC;IAAA,KACrBC,eAAe,GAAY,KAAK;IAAA,KAChCC,kBAAkB,GAAWC,IAAI,CAACC,GAAG,CAAC,CAAC;IAAA,KACvCC,WAAW,GAAW,CAAC;IAAA,KACvBC,UAAU,GAAW,CAAC;IAAA,KACtBC,QAAQ,GAAW,CAAC;IAK1B,IAAI,CAACX,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,OAAO,GAAG;MAAC,GAAGV,eAAe;MAAE,GAAGU;IAAO,CAAC;EACjD;EAEAW,YAAYA,CAAA,EAAY;IAAA,IAAAC,aAAA,EAAAC,cAAA;IACtB,IAAIC,OAAO,EAAAF,aAAA,GAAC,IAAI,CAACZ,OAAO,cAAAY,aAAA,uBAAZA,aAAA,CAAclB,KAAK,CAAC,IAAI,IAAI,CAACc,WAAW,IAAI,IAAI,CAACR,OAAO,CAACN,KAAK,EAAE;MAC1E,OAAO,IAAI;IACb;I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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/convert-table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/convert-table.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACX,MAAM,+BAA+B,CAAC;AAIvC,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,GAAG,cAAc,CAAC;AACtF,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,GAAG,aAAa,CAAC;AACpF,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,GAAG,aAAa,CAAC;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC;AA0B7E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAMlD;AAED,oDAAoD;AACpD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAyB7D;AAED,8CAA8C;AAC9C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAc7D;AAED,+CAA+C;AAC/C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CAc/D;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-table.js","names":["getTableCell","getTableLength","getTableRowAsArray","getTableRowAsObject","deduceTableSchema","makeColumnFromField","convertTable","table","shape","makeObjectRowTable","makeArrayRowTable","makeColumnarTable","makeArrowTable","Error","_globalThis$__luma","_makeArrowTable","globalThis","__luma","_table$schema","schema","fields","length","columns","field","column","name","rowIndex","data","Array"],"sources":["../../../../src/lib/table/simple-table/convert-table.ts"],"sourcesContent":["// loaders.gl, MIT license\nimport {\n getTableCell,\n getTableLength,\n getTableRowAsArray,\n getTableRowAsObject\n} from './table-accessors';\nimport {\n Table,\n ArrayRowTable,\n ObjectRowTable,\n ColumnarTable,\n ArrowTable\n} from '../../../types/category-table';\nimport {deduceTableSchema} from './table-schema';\nimport {makeColumnFromField} from './table-column';\n\nexport function convertTable(table: Table, shape: 'object-row-table'): ObjectRowTable;\nexport function convertTable(table: Table, shape: 'array-row-table'): ArrayRowTable;\nexport function convertTable(table: Table, shape: 'columnar-table'): ColumnarTable;\nexport function convertTable(table: Table, shape: 'arrow-table'): ArrowTable;\n\n/**\n * Convert a table to a different shape\n * @param table\n * @param shape\n * @returns\n */\nexport function convertTable(\n table: Table,\n shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow-table'\n) {\n switch (shape) {\n case 'object-row-table':\n return makeObjectRowTable(table);\n case 'array-row-table':\n return makeArrayRowTable(table);\n case 'columnar-table':\n return makeColumnarTable(table);\n case 'arrow-table':\n return makeArrowTable(table);\n default:\n throw new Error(shape);\n }\n}\n\n/**\n * Convert a table to apache arrow format\n * @note this depends on the `@loaders.gl/arrow module being imported\n */\nexport function makeArrowTable(table: Table): Table {\n const _makeArrowTable = globalThis.__luma?._makeArrowTable;\n if (!_makeArrowTable) {\n throw new Error('');\n }\n return _makeArrowTable(table);\n}\n\n/** Convert any simple table into columnar format */\nexport function makeColumnarTable(table: Table): ColumnarTable {\n // TODO - should schema really be optional?\n const schema = table.schema || deduceTableSchema(table);\n const fields = table.schema?.fields || [];\n\n if (table.shape === 'columnar-table') {\n return {...table, schema};\n }\n\n const length = getTableLength(table);\n\n const columns: {[column: string]: ArrayLike<unknown>} = {};\n for (const field of fields) {\n const column = makeColumnFromField(field, length);\n columns[field.name] = column;\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n column[rowIndex] = getTableCell(table, rowIndex, field.name);\n }\n }\n\n return {\n shape: 'columnar-table',\n schema,\n data: columns\n };\n}\n\n/** Convert any table into array row format */\nexport function makeArrayRowTable(table: Table): ArrayRowTable {\n if (table.shape === 'array-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<unknown[]>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsArray(table, rowIndex);\n }\n return {\n shape: 'array-row-table',\n schema: table.schema,\n data\n };\n}\n\n/** Convert any table into object row format */\nexport function makeObjectRowTable(table: Table): ObjectRowTable {\n if (table.shape === 'object-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'object-row-table',\n schema: table.schema,\n data\n };\n}\n\n/**\n/**\n *\n * @note - should be part of schema module\nexport function convertColumnarToRowFormatTable(columnarTable: ColumnarTable): ObjectRowTable {\n const tableKeys = ;\n const tableRowsCount = columnarTable[tableKeys[0]].length;\n\n const objectRows: ObjectRowTable['data'] = [];\n\n for (let index = 0; index < tableRowsCount; index++) {\n const objectRow = {};\n for (const fieldName of Object.keys(columnarTable.data)) {\n objectRow[fieldName] = columnarTable[fieldName][index];\n }\n objectRows.push(objectRow);\n }\n\n return {\n shape: 'object-row-table',\n data: objectRows\n };\n}\n */\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-table.js","names":["getTableCell","getTableLength","getTableRowAsArray","getTableRowAsObject","deduceTableSchema","makeColumnFromField","convertTable","table","shape","makeObjectRowTable","makeArrayRowTable","makeColumnarTable","makeArrowTable","Error","_globalThis$__luma","_makeArrowTable","globalThis","__luma","_table$schema","schema","fields","length","columns","field","column","name","rowIndex","data","Array"],"sources":["../../../../src/lib/table/simple-table/convert-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\nimport {\n getTableCell,\n getTableLength,\n getTableRowAsArray,\n getTableRowAsObject\n} from './table-accessors';\nimport {\n Table,\n ArrayRowTable,\n ObjectRowTable,\n ColumnarTable,\n ArrowTable\n} from '../../../types/category-table';\nimport {deduceTableSchema} from './table-schema';\nimport {makeColumnFromField} from './table-column';\n\nexport function convertTable(table: Table, shape: 'object-row-table'): ObjectRowTable;\nexport function convertTable(table: Table, shape: 'array-row-table'): ArrayRowTable;\nexport function convertTable(table: Table, shape: 'columnar-table'): ColumnarTable;\nexport function convertTable(table: Table, shape: 'arrow-table'): ArrowTable;\n\n/**\n * Convert a table to a different shape\n * @param table\n * @param shape\n * @returns\n */\nexport function convertTable(\n table: Table,\n shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow-table'\n) {\n switch (shape) {\n case 'object-row-table':\n return makeObjectRowTable(table);\n case 'array-row-table':\n return makeArrayRowTable(table);\n case 'columnar-table':\n return makeColumnarTable(table);\n case 'arrow-table':\n return makeArrowTable(table);\n default:\n throw new Error(shape);\n }\n}\n\n/**\n * Convert a table to apache arrow format\n * @note this depends on the `@loaders.gl/arrow module being imported\n */\nexport function makeArrowTable(table: Table): Table {\n const _makeArrowTable = globalThis.__luma?._makeArrowTable;\n if (!_makeArrowTable) {\n throw new Error('');\n }\n return _makeArrowTable(table);\n}\n\n/** Convert any simple table into columnar format */\nexport function makeColumnarTable(table: Table): ColumnarTable {\n // TODO - should schema really be optional?\n const schema = table.schema || deduceTableSchema(table);\n const fields = table.schema?.fields || [];\n\n if (table.shape === 'columnar-table') {\n return {...table, schema};\n }\n\n const length = getTableLength(table);\n\n const columns: {[column: string]: ArrayLike<unknown>} = {};\n for (const field of fields) {\n const column = makeColumnFromField(field, length);\n columns[field.name] = column;\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n column[rowIndex] = getTableCell(table, rowIndex, field.name);\n }\n }\n\n return {\n shape: 'columnar-table',\n schema,\n data: columns\n };\n}\n\n/** Convert any table into array row format */\nexport function makeArrayRowTable(table: Table): ArrayRowTable {\n if (table.shape === 'array-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<unknown[]>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsArray(table, rowIndex);\n }\n return {\n shape: 'array-row-table',\n schema: table.schema,\n data\n };\n}\n\n/** Convert any table into object row format */\nexport function makeObjectRowTable(table: Table): ObjectRowTable {\n if (table.shape === 'object-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'object-row-table',\n schema: table.schema,\n data\n };\n}\n\n/**\n/**\n *\n * @note - should be part of schema module\nexport function convertColumnarToRowFormatTable(columnarTable: ColumnarTable): ObjectRowTable {\n const tableKeys = ;\n const tableRowsCount = columnarTable[tableKeys[0]].length;\n\n const objectRows: ObjectRowTable['data'] = [];\n\n for (let index = 0; index < tableRowsCount; index++) {\n const objectRow = {};\n for (const fieldName of Object.keys(columnarTable.data)) {\n objectRow[fieldName] = columnarTable[fieldName][index];\n }\n objectRows.push(objectRow);\n }\n\n return {\n shape: 'object-row-table',\n data: objectRows\n };\n}\n */\n"],"mappings":"SAGEA,YAAY,EACZC,cAAc,EACdC,kBAAkB,EAClBC,mBAAmB;AAAA,SASbC,iBAAiB;AAAA,SACjBC,mBAAmB;AAa3B,OAAO,SAASC,YAAYA,CAC1BC,KAAY,EACZC,KAAgF,EAChF;EACA,QAAQA,KAAK;IACX,KAAK,kBAAkB;MACrB,OAAOC,kBAAkB,CAACF,KAAK,CAAC;IAClC,KAAK,iBAAiB;MACpB,OAAOG,iBAAiB,CAACH,KAAK,CAAC;IACjC,KAAK,gBAAgB;MACnB,OAAOI,iBAAiB,CAACJ,KAAK,CAAC;IACjC,KAAK,aAAa;MAChB,OAAOK,cAAc,CAACL,KAAK,CAAC;IAC9B;MACE,MAAM,IAAIM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IACNQ,IAAI,EAAEL;EACR,CAAC;AACH;AAGA,OAAO,SAASZ,iBAAiBA,CAACH,KAAY,EAAiB;EAC7D,IAAIA,KAAK,CAACC,KAAK,KAAK,iBAAiB,EAAE;IACrC,OAAOD,KAAK;EACd;EACA,MAAMc,MAAM,GAAGpB,cAAc,CAACM,KAAK,CAAC;EACpC,MAAMoB,IAAI,GAAG,IAAIC,KAAK,CAAYP,MAAM,CAAC;EACzC,KAAK,IAAIK,QAAQ,GAAG,CAAC,EAAEA,QAAQ,GAAGL,MAAM,EAAEK,QAAQ,EAAE,EAAE;IACpDC,IAAI,CAACD,QAAQ,CAAC,GAAGxB,kBAAkB,CAACK,KAAK,EAAEmB,QAAQ,CAAC;EACtD;EACA,OAAO;IACLlB,KAAK,EAAE,iBAAiB;IACxBW,MAAM,EAAEZ,KAAK,CAACY,MAAM;IACpBQ;EACF,CAAC;AACH;AAGA,OAAO,SAASlB,kBAAkBA,CAACF,KAAY,EAAkB;EAC/D,IAAIA,KAAK,CAACC,KAAK,KAAK,kBAAkB,EAAE;IACtC,OAAOD,KAAK;EACd;EACA,MAAMc,MAAM,GAAGpB,cAAc,CAACM,KAAK,CAAC;EACpC,MAAMoB,IAAI,GAAG,IAAIC,KAAK,CAA2BP,MAAM,CAAC;EACxD,KAAK,IAAIK,QAAQ,GAAG,CAAC,EAAEA,QAAQ,GAAGL,MAAM,EAAEK,QAAQ,EAAE,EAAE;IACpDC,IAAI,CAACD,QAAQ,CAAC,GAAGvB,mBAAmB,CAACI,KAAK,EAAEmB,QAAQ,CAAC;EACvD;EACA,OAAO;IACLlB,KAAK,EAAE,kBAAkB;IACzBW,MAAM,EAAEZ,KAAK,CAACY,MAAM;IACpBQ;EACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-type.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/data-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-type.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/data-type.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAE,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAElF,sCAAsC;AACtC,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,iBAAiB,GAAE,SAAqB,GACvC,QAAQ,CAcV;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,GAAG;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAC,CAW1F;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAsBrE;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,OAAO,GAAG,SAAS,GAC5B,qBAAqB,GAAG,gBAAgB,CA8B1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-type.js","names":["getDataTypeFromValue","value","defaultNumberType","arguments","length","undefined","Date","Number","getDataTypeFromArray","array","type","getDataTypeFromTypedArray","nullable","constructor","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","getArrayTypeFromDataType","Array"],"sources":["../../../../src/lib/table/simple-table/data-type.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {DataType} from '../../../types/schema';\nimport {TypedArray, TypedArrayConstructor, ArrayType} from '../../../types/types';\n\n/** Deduce column types from values */\nexport function getDataTypeFromValue(\n value: unknown,\n defaultNumberType: 'float32' = 'float32'\n): DataType {\n if (value instanceof Date) {\n return 'date-millisecond';\n }\n if (value instanceof Number) {\n return defaultNumberType;\n }\n if (typeof value === 'string') {\n return 'utf8';\n }\n if (value === null || value === 'undefined') {\n return 'null';\n }\n return 'null';\n}\n\n/**\n * Deduces a simple data type \"descriptor from a typed array instance\n */\nexport function getDataTypeFromArray(array: ArrayType): {type: DataType; nullable: boolean} {\n let type = getDataTypeFromTypedArray(array as TypedArray);\n if (type !== 'null') {\n return {type, nullable: false};\n }\n if (array.length > 0) {\n type = getDataTypeFromValue(array[0]);\n return {type, nullable: true};\n }\n\n return {type: 'null', nullable: true};\n}\n\n/**\n * Deduces a simple data type \"descriptor from a typed array instance\n */\nexport function getDataTypeFromTypedArray(array: TypedArray): DataType {\n switch (array.constructor) {\n case Int8Array:\n return 'int8';\n case Uint8Array:\n case Uint8ClampedArray:\n return 'uint8';\n case Int16Array:\n return 'int16';\n case Uint16Array:\n return 'uint16';\n case Int32Array:\n return 'int32';\n case Uint32Array:\n return 'uint32';\n case Float32Array:\n return 'float32';\n case Float64Array:\n return 'float64';\n default:\n return 'null';\n }\n}\n\nexport function getArrayTypeFromDataType(\n type: DataType,\n nullable: boolean | undefined\n): TypedArrayConstructor | ArrayConstructor {\n if (!nullable) {\n switch (type) {\n case 'int8':\n return Int8Array;\n case 'uint8':\n return Uint8Array;\n case 'int16':\n return Int16Array;\n case 'uint16':\n return Uint16Array;\n case 'int32':\n return Int32Array;\n case 'uint32':\n return Uint32Array;\n case 'float32':\n return Float32Array;\n case 'float64':\n return Float64Array;\n default:\n break;\n }\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\n return Array;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-type.js","names":["getDataTypeFromValue","value","defaultNumberType","arguments","length","undefined","Date","Number","getDataTypeFromArray","array","type","getDataTypeFromTypedArray","nullable","constructor","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","getArrayTypeFromDataType","Array"],"sources":["../../../../src/lib/table/simple-table/data-type.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {DataType} from '../../../types/schema';\nimport {TypedArray, TypedArrayConstructor, ArrayType} from '../../../types/types';\n\n/** Deduce column types from values */\nexport function getDataTypeFromValue(\n value: unknown,\n defaultNumberType: 'float32' = 'float32'\n): DataType {\n if (value instanceof Date) {\n return 'date-millisecond';\n }\n if (value instanceof Number) {\n return defaultNumberType;\n }\n if (typeof value === 'string') {\n return 'utf8';\n }\n if (value === null || value === 'undefined') {\n return 'null';\n }\n return 'null';\n}\n\n/**\n * Deduces a simple data type \"descriptor from a typed array instance\n */\nexport function getDataTypeFromArray(array: ArrayType): {type: DataType; nullable: boolean} {\n let type = getDataTypeFromTypedArray(array as TypedArray);\n if (type !== 'null') {\n return {type, nullable: false};\n }\n if (array.length > 0) {\n type = getDataTypeFromValue(array[0]);\n return {type, nullable: true};\n }\n\n return {type: 'null', nullable: true};\n}\n\n/**\n * Deduces a simple data type \"descriptor from a typed array instance\n */\nexport function getDataTypeFromTypedArray(array: TypedArray): DataType {\n switch (array.constructor) {\n case Int8Array:\n return 'int8';\n case Uint8Array:\n case Uint8ClampedArray:\n return 'uint8';\n case Int16Array:\n return 'int16';\n case Uint16Array:\n return 'uint16';\n case Int32Array:\n return 'int32';\n case Uint32Array:\n return 'uint32';\n case Float32Array:\n return 'float32';\n case Float64Array:\n return 'float64';\n default:\n return 'null';\n }\n}\n\nexport function getArrayTypeFromDataType(\n type: DataType,\n nullable: boolean | undefined\n): TypedArrayConstructor | ArrayConstructor {\n if (!nullable) {\n switch (type) {\n case 'int8':\n return Int8Array;\n case 'uint8':\n return Uint8Array;\n case 'int16':\n return Int16Array;\n case 'uint16':\n return Uint16Array;\n case 'int32':\n return Int32Array;\n case 'uint32':\n return Uint32Array;\n case 'float32':\n return Float32Array;\n case 'float64':\n return Float64Array;\n default:\n break;\n }\n }\n\n // if (typeof BigInt64Array !== 'undefined') {\n // TYPED_ARRAY_TO_TYPE.BigInt64Array = new Int64();\n // TYPED_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UAAU;MACb,OAAO,OAAO;IAChB,KAAKC,WAAW;MACd,OAAO,QAAQ;IACjB,KAAKC,YAAY;MACf,OAAO,SAAS;IAClB,KAAKC,YAAY;MACf,OAAO,SAAS;IAClB;MACE,OAAO,MAAM;EACjB;AACF;AAEA,OAAO,SAASC,wBAAwBA,CACtCb,IAAc,EACdE,QAA6B,EACa;EAC1C,IAAI,CAACA,QAAQ,EAAE;IACb,QAAQF,IAAI;MACV,KAAK,MAAM;QACT,OAAOI,SAAS;MAClB,KAAK,OAAO;QACV,OAAOC,UAAU;MACnB,KAAK,OAAO;QACV,OAAOE,UAAU;MACnB,KAAK,QAAQ;QACX,OAAOC,WAAW;MACpB,KAAK,OAAO;QACV,OAAOC,UAAU;MACnB,KAAK,QAAQ;QACX,OAAOC,WAAW;MACpB,KAAK,SAAS;QACZ,OAAOC,YAAY;MACrB,KAAK,SAAS;QACZ,OAAOC,YAAY;MACrB;QACE;IACJ;EACF;EAOA,OAAOE,KAAK;AACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/make-table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"make-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/make-table.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,aAAa,EAAE,cAAc,EAAE,aAAa,EAAC,MAAM,+BAA+B,CAAC;AAGlG;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,GAAG,aAAa,CAAC;AACpE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,EAAE,GAAG,cAAc,CAAC;AACvF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;CAAC,GAAG,aAAa,CAAC;AA8C/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-table.js","names":["deduceTableSchema","makeTableFromData","data","table","getTableShapeFromData","shape","Error","schema","Array","isArray","length","firstRow"],"sources":["../../../../src/lib/table/simple-table/make-table.ts"],"sourcesContent":["// loaders.gl, MIT license\nimport {Table, ArrayRowTable, ObjectRowTable, ColumnarTable} from '../../../types/category-table';\nimport {deduceTableSchema} from './table-schema';\n\n/**\n * Makes a typed table from data.\n * @throws Row tables must contain at least one row. Columnar tables must contain empty arrays\n */\nexport function makeTableFromData(data: unknown[][]): ArrayRowTable;\nexport function makeTableFromData(data: {[column: string]: unknown}[]): ObjectRowTable;\nexport function makeTableFromData(data: {[column: string]: ArrayLike<unknown>}): ColumnarTable;\nexport function makeTableFromData(data: unknown): Table {\n let table: Table;\n switch (getTableShapeFromData(data)) {\n case 'array-row-table':\n table = {shape: 'array-row-table', data: data as unknown[][]};\n break;\n case 'object-row-table':\n table = {shape: 'object-row-table', data: data as {[key: string]: unknown}[]};\n break;\n case 'columnar-table':\n table = {shape: 'columnar-table', data: data as {[column: string]: ArrayLike<unknown>}};\n break;\n default:\n throw new Error('table');\n }\n const schema = deduceTableSchema(table);\n return {...table, schema};\n}\n\n/** Helper function to get shape of data */\nfunction getTableShapeFromData(data) {\n if (Array.isArray(data)) {\n if (data.length === 0) {\n throw new Error('cannot deduce type of empty table');\n }\n\n // Deduce the table shape from the first row\n const firstRow = data[0];\n\n if (Array.isArray(firstRow)) {\n return 'array-row-table';\n }\n\n if (firstRow && typeof firstRow === 'object') {\n return 'object-row-table';\n }\n }\n\n if (data && typeof data === 'object') {\n return 'columnar-table';\n }\n\n throw new Error('invalid table');\n}\n\n/** Convert any table into object row format *\nexport function makeColumnarTable(table: Table): ColumnarTable {\n if (table.shape === 'columnar-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'columnar-table',\n schema: table.schema,\n data\n };\n}\n\n\n/** Convert any table into array row format *\nexport function makeArrayRowTable(table: TableLike): ArrayRowTable {\n if (table.shape === 'array-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<unknown[]>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsArray(table, rowIndex);\n }\n return {\n shape: 'array-row-table',\n schema: table.schema,\n data\n };\n}\n\n/** Convert any table into object row format *\nexport function makeObjectRowTable(table: Table): ObjectRowTable {\n if (table.shape === 'object-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'object-row-table',\n schema: table.schema,\n data\n };\n}\n*/\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"make-table.js","names":["deduceTableSchema","makeTableFromData","data","table","getTableShapeFromData","shape","Error","schema","Array","isArray","length","firstRow"],"sources":["../../../../src/lib/table/simple-table/make-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\nimport {Table, ArrayRowTable, ObjectRowTable, ColumnarTable} from '../../../types/category-table';\nimport {deduceTableSchema} from './table-schema';\n\n/**\n * Makes a typed table from data.\n * @throws Row tables must contain at least one row. Columnar tables must contain empty arrays\n */\nexport function makeTableFromData(data: unknown[][]): ArrayRowTable;\nexport function makeTableFromData(data: {[column: string]: unknown}[]): ObjectRowTable;\nexport function makeTableFromData(data: {[column: string]: ArrayLike<unknown>}): ColumnarTable;\nexport function makeTableFromData(data: unknown): Table {\n let table: Table;\n switch (getTableShapeFromData(data)) {\n case 'array-row-table':\n table = {shape: 'array-row-table', data: data as unknown[][]};\n break;\n case 'object-row-table':\n table = {shape: 'object-row-table', data: data as {[key: string]: unknown}[]};\n break;\n case 'columnar-table':\n table = {shape: 'columnar-table', data: data as {[column: string]: ArrayLike<unknown>}};\n break;\n default:\n throw new Error('table');\n }\n const schema = deduceTableSchema(table);\n return {...table, schema};\n}\n\n/** Helper function to get shape of data */\nfunction getTableShapeFromData(data) {\n if (Array.isArray(data)) {\n if (data.length === 0) {\n throw new Error('cannot deduce type of empty table');\n }\n\n // Deduce the table shape from the first row\n const firstRow = data[0];\n\n if (Array.isArray(firstRow)) {\n return 'array-row-table';\n }\n\n if (firstRow && typeof firstRow === 'object') {\n return 'object-row-table';\n }\n }\n\n if (data && typeof data === 'object') {\n return 'columnar-table';\n }\n\n throw new Error('invalid table');\n}\n\n/** Convert any table into object row format *\nexport function makeColumnarTable(table: Table): ColumnarTable {\n if (table.shape === 'columnar-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'columnar-table',\n schema: table.schema,\n data\n };\n}\n\n\n/** Convert any table into array row format *\nexport function makeArrayRowTable(table: TableLike): ArrayRowTable {\n if (table.shape === 'array-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<unknown[]>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsArray(table, rowIndex);\n }\n return {\n shape: 'array-row-table',\n schema: table.schema,\n data\n };\n}\n\n/** Convert any table into object row format *\nexport function makeObjectRowTable(table: Table): ObjectRowTable {\n if (table.shape === 'object-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'object-row-table',\n schema: table.schema,\n data\n };\n}\n*/\n"],"mappings":"SAGQA,iBAAiB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lib/table/simple-table/table-accessors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-accessors.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/table-accessors.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,KAAK,EAAE,aAAa,EAAE,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAEnF;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAqBnD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAsBpD;AAED,0DAA0D;AAC1D,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CA0BxF;AAED,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAyB3F;AAED,iCAAiC;AACjC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,iBAAiB,GAAG,kBAAkB,CAcrF;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAM5E;AAED,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAM5E;AAED;;;;GAIG;AAEH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE;IAAC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,GACZ;IAAC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAwDjC;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,OAAO,EAAE,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,EAAE,CA2DX;AAED,8CAA8C;AAC9C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAc7D;AAED,+CAA+C;AAC/C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CAc/D;AAED,+CAA+C;AAC/C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CAc9D;AAID;;;;GAIG;AACH,wBAAiB,eAAe,CAC9B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,GAC5C,QAAQ,CAAC,OAAO,EAAE,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAAC,CAYhD;AAED;;;;GAIG;AACH,wBAAiB,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,GAAE,OAAO,EAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAK/F;AAED;;;;GAIG;AACH,wBAAiB,qBAAqB,CACpC,KAAK,EAAE,KAAK,EACZ,MAAM,GAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAM,GACpC,QAAQ,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAAC,CAKpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-accessors.js","names":["getTableLength","table","shape","data","length","features","arrowTable","numRows","column","Object","values","Error","getTableNumCols","schema","fields","keys","numCols","getTableCell","rowIndex","columnName","_arrowTable$getChildA","columnIndex","getTableColumnIndex","arrowColumnIndex","findIndex","field","name","getChildAt","get","getTableCellAt","_arrowTable$getChildA2","columnName1","getTableColumnName","columnName2","columnName3","getTableRowShape","_table$schema","undefined","_table$schema2","_table$schema2$fields","getTableRowAsObject","target","copy","fromEntries","entries","objectRow","i","row","getTableRowAsArray","Array","from","arrayRow","makeArrayRowTable","makeObjectRowTable","makeColumnarTable","makeRowIterator","makeArrayRowIterator","makeObjectRowIterator","arguments"],"sources":["../../../../src/lib/table/simple-table/table-accessors.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n/* eslint-disable no-else-return */\n\nimport {Table, ArrayRowTable, ObjectRowTable} from '../../../types/category-table';\n\n/**\n * Returns the length of the table (i.e. the number of rows)\n */\nexport function getTableLength(table: Table): number {\n switch (table.shape) {\n case 'array-row-table':\n case 'object-row-table':\n return table.data.length;\n\n case 'geojson-table':\n return table.features.length;\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n return arrowTable.numRows;\n\n case 'columnar-table':\n for (const column of Object.values(table.data)) {\n return column.length || 0;\n }\n return 0;\n default:\n throw new Error('table');\n }\n}\n\n/**\n * Returns the number of columns in the table\n * @throws Fails to deduce number of columns if the table has no schema and is empty\n */\nexport function getTableNumCols(table: Table): number {\n if (table.schema) {\n return table.schema.fields.length;\n }\n if (getTableLength(table) === 0) {\n throw new Error('empty table');\n }\n switch (table.shape) {\n case 'array-row-table':\n return table.data[0].length;\n case 'object-row-table':\n return Object.keys(table.data[0]).length;\n case 'geojson-table':\n return Object.keys(table.features[0]).length;\n case 'columnar-table':\n return Object.keys(table.data).length;\n case 'arrow-table':\n const arrowTable = table.data as any;\n return arrowTable.numCols;\n default:\n throw new Error('table');\n }\n}\n\n/** Get a table cell value at row index and column name */\nexport function getTableCell(table: Table, rowIndex: number, columnName: string): unknown {\n switch (table.shape) {\n case 'array-row-table':\n const columnIndex = getTableColumnIndex(table, columnName);\n return table.data[rowIndex][columnIndex];\n\n case 'object-row-table':\n return table.data[rowIndex][columnName];\n\n case 'geojson-table':\n return table.features[rowIndex][columnName];\n\n case 'columnar-table':\n const column = table.data[columnName];\n return column[rowIndex];\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n const arrowColumnIndex = arrowTable.schema.fields.findIndex(\n (field) => field.name === columnName\n );\n return arrowTable.getChildAt(arrowColumnIndex)?.get(rowIndex);\n\n default:\n throw new Error('todo');\n }\n}\n\n/** Get a table cell value at row index and column name */\nexport function getTableCellAt(table: Table, rowIndex: number, columnIndex: number): unknown {\n switch (table.shape) {\n case 'array-row-table':\n return table.data[rowIndex][columnIndex];\n\n case 'object-row-table':\n const columnName1 = getTableColumnName(table, columnIndex);\n return table.data[rowIndex][columnName1];\n\n case 'geojson-table':\n const columnName2 = getTableColumnName(table, columnIndex);\n return table.features[rowIndex][columnName2];\n\n case 'columnar-table':\n const columnName3 = getTableColumnName(table, columnIndex);\n const column = table.data[columnName3];\n return column[rowIndex];\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n return arrowTable.getChildAt(columnIndex)?.get(rowIndex);\n\n default:\n throw new Error('todo');\n }\n}\n\n/** Deduce the table row shape */\nexport function getTableRowShape(table: Table): 'array-row-table' | 'object-row-table' {\n switch (table.shape) {\n case 'array-row-table':\n case 'object-row-table':\n return table.shape;\n\n case 'geojson-table':\n // TODO - this is not correct, geojson-table is not a row table\n return 'object-row-table';\n\n case 'columnar-table':\n default:\n throw new Error('Not a row table');\n }\n}\n\n/** Get the index of a named table column. Requires the table to have a schema */\nexport function getTableColumnIndex(table: Table, columnName: string): number {\n const columnIndex = table.schema?.fields.findIndex((field) => field.name === columnName);\n if (columnIndex === undefined) {\n throw new Error(columnName);\n }\n return columnIndex;\n}\n\n/** Get the name of a table column by index. Requires the table to have a schema */\nexport function getTableColumnName(table: Table, columnIndex: number): string {\n const columnName = table.schema?.fields[columnIndex]?.name;\n if (!columnName) {\n throw new Error(`${columnIndex}`);\n }\n return columnName;\n}\n\n/**\n * Returns one row of the table in object format.\n * @param target Optional parameter will be used if needed to store the row. Can be reused between calls to improve performance\n * @returns an array representing the row. May be the original array in the row, a new object, or the target parameter\n */\n// eslint-disable-next-line complexity\nexport function getTableRowAsObject(\n table: Table,\n rowIndex: number,\n target?: {[columnName: string]: unknown},\n copy?: 'copy'\n): {[columnName: string]: unknown} {\n switch (table.shape) {\n case 'object-row-table':\n return copy ? Object.fromEntries(Object.entries(table.data[rowIndex])) : table.data[rowIndex];\n\n case 'array-row-table':\n if (table.schema) {\n const objectRow: {[columnName: string]: unknown} = target || {};\n for (let i = 0; i < table.schema.fields.length; i++) {\n objectRow[table.schema.fields[i].name] = table.data[rowIndex][i];\n }\n return objectRow;\n }\n throw new Error('no schema');\n\n case 'geojson-table':\n if (table.schema) {\n const objectRow: {[columnName: string]: unknown} = target || {};\n // TODO - should lift properties to top level\n for (let i = 0; i < table.schema.fields.length; i++) {\n objectRow[table.schema.fields[i].name] = table.features[rowIndex][i];\n }\n return objectRow;\n }\n throw new Error('no schema');\n\n case 'columnar-table':\n if (table.schema) {\n const objectRow: {[columnName: string]: unknown} = target || {};\n for (let i = 0; i < table.schema.fields.length; i++) {\n objectRow[table.schema.fields[i].name] =\n table.data[table.schema.fields[i].name][rowIndex];\n }\n return objectRow;\n } else {\n // eslint-disable-line no-else-return\n const objectRow: {[columnName: string]: unknown} = target || {};\n for (const [name, column] of Object.entries(table.data)) {\n objectRow[name] = column[rowIndex];\n }\n return objectRow;\n }\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n const objectRow: {[columnName: string]: unknown} = target || {};\n const row = arrowTable.get(rowIndex);\n const schema = arrowTable.schema;\n for (let i = 0; i < schema.fields.length; i++) {\n objectRow[schema.fields[i].name] = row?.[schema.fields[i].name];\n }\n return objectRow;\n\n default:\n throw new Error('shape');\n }\n}\n\n/**\n * Returns one row of the table in array format.\n * @param target Optional parameter will be used if needed to store the row. Can be reused between calls to improve performance.\n * @returns an array representing the row. May be the original array in the row, a new object, or the target parameter\n */\n// eslint-disable-next-line complexity\nexport function getTableRowAsArray(\n table: Table,\n rowIndex: number,\n target?: unknown[],\n copy?: 'copy'\n): unknown[] {\n switch (table.shape) {\n case 'array-row-table':\n return copy ? Array.from(table.data[rowIndex]) : table.data[rowIndex];\n\n case 'object-row-table':\n if (table.schema) {\n const arrayRow: unknown[] = target || [];\n for (let i = 0; i < table.schema.fields.length; i++) {\n arrayRow[i] = table.data[rowIndex][table.schema.fields[i].name];\n }\n return arrayRow;\n }\n // Warning: just slap on the values, this risks mismatches between rows\n return Object.values(table.data[rowIndex]);\n\n case 'geojson-table':\n if (table.schema) {\n const arrayRow: unknown[] = target || [];\n // TODO - should lift properties to top level\n for (let i = 0; i < table.schema.fields.length; i++) {\n arrayRow[i] = table.features[rowIndex][table.schema.fields[i].name];\n }\n return arrayRow;\n }\n // Warning: just slap on the values, this risks mismatches between rows\n return Object.values(table.features[rowIndex]);\n\n case 'columnar-table':\n if (table.schema) {\n const arrayRow: unknown[] = target || [];\n for (let i = 0; i < table.schema.fields.length; i++) {\n arrayRow[i] = table.data[table.schema.fields[i].name][rowIndex];\n }\n return arrayRow;\n } else {\n // eslint-disable-line no-else-return\n const arrayRow: unknown[] = target || [];\n let i = 0;\n for (const column of Object.values(table.data)) {\n arrayRow[i] = column[rowIndex];\n i++;\n }\n return arrayRow;\n }\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n const arrayRow: unknown[] = target || [];\n const row = arrowTable.get(rowIndex);\n const schema = arrowTable.schema;\n for (let i = 0; i < schema.fields.length; i++) {\n arrayRow[i] = row?.[schema.fields[i].name];\n }\n return arrayRow;\n\n default:\n throw new Error('shape');\n }\n}\n\n/** Convert any table into array row format */\nexport function makeArrayRowTable(table: Table): ArrayRowTable {\n if (table.shape === 'array-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<unknown[]>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsArray(table, rowIndex);\n }\n return {\n shape: 'array-row-table',\n schema: table.schema,\n data\n };\n}\n\n/** Convert any table into object row format */\nexport function makeObjectRowTable(table: Table): ObjectRowTable {\n if (table.shape === 'object-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'object-row-table',\n schema: table.schema,\n data\n };\n}\n\n/** Convert any table into object row format */\nexport function makeColumnarTable(table: Table): ObjectRowTable {\n if (table.shape === 'object-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'object-row-table',\n schema: table.schema,\n data\n };\n}\n\n// Row Iterators\n\n/**\n * Iterate over table rows\n * @param table\n * @param shape\n */\nexport function* makeRowIterator(\n table: Table,\n shape: 'object-row-table' | 'array-row-table'\n): Iterable<unknown[] | {[key: string]: unknown}> {\n switch (shape) {\n case 'array-row-table':\n yield* makeArrayRowIterator(table);\n break;\n case 'object-row-table':\n yield* makeObjectRowIterator(table);\n break;\n\n default:\n throw new Error(`Unknown row type ${shape}`);\n }\n}\n\n/**\n * Streaming processing: Iterate over table, yielding array rows\n * @param table\n * @param shape\n */\nexport function* makeArrayRowIterator(table: Table, target: unknown[] = []): Iterable<unknown[]> {\n const length = getTableLength(table);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n yield getTableRowAsArray(table, rowIndex, target);\n }\n}\n\n/**\n * Streaming processing: Iterate over table, yielding object rows\n * @param table\n * @param shape\n */\nexport function* makeObjectRowIterator(\n table: Table,\n target: {[key: string]: unknown} = {}\n): Iterable<{[key: string]: unknown}> {\n const length = getTableLength(table);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n yield getTableRowAsObject(table, rowIndex, target);\n }\n}\n"],"mappings":"AASA,OAAO,SAASA,cAAcA,CAACC,KAAY,EAAU;EACnD,QAAQA,KAAK,CAACC,KAAK;IACjB,KAAK,iBAAiB;IACtB,KAAK,kBAAkB;MACrB,OAAOD,KAAK,CAACE,IAAI,CAACC,MAAM;IAE1B,KAAK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C,EACG;EAChD,QAAQA,KAAK;IACX,KAAK,iBAAiB;MACpB,OAAOsD,oBAAoB,CAACvD,KAAK,CAAC;MAClC;IACF,KAAK,kBAAkB;MACrB,OAAOwD,qBAAqB,CAACxD,KAAK,CAAC;MACnC;IAEF;MACE,MAAM,IAAIU,KAAK,CAAE,oBAAmBT,KAAM,EAAC,CAAC;EAChD;AACF;AAOA,OAAO,SAAUsD,oBAAoBA,CAACvD,KAAY;EAAA,IAAEwC,MAAiB,GAAAiB,SAAA,CAAAtD,MAAA,QAAAsD,SAAA,QAAArB,SAAA,GAAAqB,SAAA,MAAG,EAAE;EAAA,oBAAuB;IAC/F,MAAMtD,MAAM,GAAGJ,cAAc,CAACC,KAAK,CAAC;IACpC,KAAK,IAAIiB,QAAQ,GAAG,CAAC,EAAEA,QAAQ,GAAGd,MAAM,EAAEc,QAAQ,EAAE,EAAE;MACpD,MAAM8B,kBAAkB,CAAC/C,KAAK,EAAEiB,QAAQ,EAAEuB,MAAM,CAAC;IACnD;EACF,CAAC;AAAA;AAOD,OAAO,SAAUgB,qBAAqBA,CACpCxD,KAAY;EAAA,IACZwC,MAAgC,GAAAiB,SAAA,CAAAtD,MAAA,QAAAsD,SAAA,QAAArB,SAAA,GAAAqB,SAAA,MAAG,CAAC,CAAC;EAAA,oBACD;IACpC,MAAMtD,MAAM,GAAGJ,cAAc,CAACC,KAAK,CAAC;IACpC,KAAK,IAAIiB,QAAQ,GAAG,CAAC,EAAEA,QAAQ,GAAGd,MAAM,EAAEc,QAAQ,EAAE,EAAE;MACpD,MAAMsB,mBAAmB,CAACvC,KAAK,EAAEiB,QAAQ,EAAEuB,MAAM,CAAC;IACpD;EACF,CAAC;AAAA"}
|
|
1
|
+
{"version":3,"file":"table-accessors.js","names":["getTableLength","table","shape","data","length","features","arrowTable","numRows","column","Object","values","Error","getTableNumCols","schema","fields","keys","numCols","getTableCell","rowIndex","columnName","_arrowTable$getChildA","columnIndex","getTableColumnIndex","arrowColumnIndex","findIndex","field","name","getChildAt","get","getTableCellAt","_arrowTable$getChildA2","columnName1","getTableColumnName","columnName2","columnName3","getTableRowShape","_table$schema","undefined","_table$schema2","_table$schema2$fields","getTableRowAsObject","target","copy","fromEntries","entries","objectRow","i","row","getTableRowAsArray","Array","from","arrayRow","makeArrayRowTable","makeObjectRowTable","makeColumnarTable","makeRowIterator","makeArrayRowIterator","makeObjectRowIterator","arguments"],"sources":["../../../../src/lib/table/simple-table/table-accessors.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-else-return */\n\nimport {Table, ArrayRowTable, ObjectRowTable} from '../../../types/category-table';\n\n/**\n * Returns the length of the table (i.e. the number of rows)\n */\nexport function getTableLength(table: Table): number {\n switch (table.shape) {\n case 'array-row-table':\n case 'object-row-table':\n return table.data.length;\n\n case 'geojson-table':\n return table.features.length;\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n return arrowTable.numRows;\n\n case 'columnar-table':\n for (const column of Object.values(table.data)) {\n return column.length || 0;\n }\n return 0;\n default:\n throw new Error('table');\n }\n}\n\n/**\n * Returns the number of columns in the table\n * @throws Fails to deduce number of columns if the table has no schema and is empty\n */\nexport function getTableNumCols(table: Table): number {\n if (table.schema) {\n return table.schema.fields.length;\n }\n if (getTableLength(table) === 0) {\n throw new Error('empty table');\n }\n switch (table.shape) {\n case 'array-row-table':\n return table.data[0].length;\n case 'object-row-table':\n return Object.keys(table.data[0]).length;\n case 'geojson-table':\n return Object.keys(table.features[0]).length;\n case 'columnar-table':\n return Object.keys(table.data).length;\n case 'arrow-table':\n const arrowTable = table.data as any;\n return arrowTable.numCols;\n default:\n throw new Error('table');\n }\n}\n\n/** Get a table cell value at row index and column name */\nexport function getTableCell(table: Table, rowIndex: number, columnName: string): unknown {\n switch (table.shape) {\n case 'array-row-table':\n const columnIndex = getTableColumnIndex(table, columnName);\n return table.data[rowIndex][columnIndex];\n\n case 'object-row-table':\n return table.data[rowIndex][columnName];\n\n case 'geojson-table':\n return table.features[rowIndex][columnName];\n\n case 'columnar-table':\n const column = table.data[columnName];\n return column[rowIndex];\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n const arrowColumnIndex = arrowTable.schema.fields.findIndex(\n (field) => field.name === columnName\n );\n return arrowTable.getChildAt(arrowColumnIndex)?.get(rowIndex);\n\n default:\n throw new Error('todo');\n }\n}\n\n/** Get a table cell value at row index and column name */\nexport function getTableCellAt(table: Table, rowIndex: number, columnIndex: number): unknown {\n switch (table.shape) {\n case 'array-row-table':\n return table.data[rowIndex][columnIndex];\n\n case 'object-row-table':\n const columnName1 = getTableColumnName(table, columnIndex);\n return table.data[rowIndex][columnName1];\n\n case 'geojson-table':\n const columnName2 = getTableColumnName(table, columnIndex);\n return table.features[rowIndex][columnName2];\n\n case 'columnar-table':\n const columnName3 = getTableColumnName(table, columnIndex);\n const column = table.data[columnName3];\n return column[rowIndex];\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n return arrowTable.getChildAt(columnIndex)?.get(rowIndex);\n\n default:\n throw new Error('todo');\n }\n}\n\n/** Deduce the table row shape */\nexport function getTableRowShape(table: Table): 'array-row-table' | 'object-row-table' {\n switch (table.shape) {\n case 'array-row-table':\n case 'object-row-table':\n return table.shape;\n\n case 'geojson-table':\n // TODO - this is not correct, geojson-table is not a row table\n return 'object-row-table';\n\n case 'columnar-table':\n default:\n throw new Error('Not a row table');\n }\n}\n\n/** Get the index of a named table column. Requires the table to have a schema */\nexport function getTableColumnIndex(table: Table, columnName: string): number {\n const columnIndex = table.schema?.fields.findIndex((field) => field.name === columnName);\n if (columnIndex === undefined) {\n throw new Error(columnName);\n }\n return columnIndex;\n}\n\n/** Get the name of a table column by index. Requires the table to have a schema */\nexport function getTableColumnName(table: Table, columnIndex: number): string {\n const columnName = table.schema?.fields[columnIndex]?.name;\n if (!columnName) {\n throw new Error(`${columnIndex}`);\n }\n return columnName;\n}\n\n/**\n * Returns one row of the table in object format.\n * @param target Optional parameter will be used if needed to store the row. Can be reused between calls to improve performance\n * @returns an array representing the row. May be the original array in the row, a new object, or the target parameter\n */\n// eslint-disable-next-line complexity\nexport function getTableRowAsObject(\n table: Table,\n rowIndex: number,\n target?: {[columnName: string]: unknown},\n copy?: 'copy'\n): {[columnName: string]: unknown} {\n switch (table.shape) {\n case 'object-row-table':\n return copy ? Object.fromEntries(Object.entries(table.data[rowIndex])) : table.data[rowIndex];\n\n case 'array-row-table':\n if (table.schema) {\n const objectRow: {[columnName: string]: unknown} = target || {};\n for (let i = 0; i < table.schema.fields.length; i++) {\n objectRow[table.schema.fields[i].name] = table.data[rowIndex][i];\n }\n return objectRow;\n }\n throw new Error('no schema');\n\n case 'geojson-table':\n if (table.schema) {\n const objectRow: {[columnName: string]: unknown} = target || {};\n // TODO - should lift properties to top level\n for (let i = 0; i < table.schema.fields.length; i++) {\n objectRow[table.schema.fields[i].name] = table.features[rowIndex][i];\n }\n return objectRow;\n }\n throw new Error('no schema');\n\n case 'columnar-table':\n if (table.schema) {\n const objectRow: {[columnName: string]: unknown} = target || {};\n for (let i = 0; i < table.schema.fields.length; i++) {\n objectRow[table.schema.fields[i].name] =\n table.data[table.schema.fields[i].name][rowIndex];\n }\n return objectRow;\n } else {\n // eslint-disable-line no-else-return\n const objectRow: {[columnName: string]: unknown} = target || {};\n for (const [name, column] of Object.entries(table.data)) {\n objectRow[name] = column[rowIndex];\n }\n return objectRow;\n }\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n const objectRow: {[columnName: string]: unknown} = target || {};\n const row = arrowTable.get(rowIndex);\n const schema = arrowTable.schema;\n for (let i = 0; i < schema.fields.length; i++) {\n objectRow[schema.fields[i].name] = row?.[schema.fields[i].name];\n }\n return objectRow;\n\n default:\n throw new Error('shape');\n }\n}\n\n/**\n * Returns one row of the table in array format.\n * @param target Optional parameter will be used if needed to store the row. Can be reused between calls to improve performance.\n * @returns an array representing the row. May be the original array in the row, a new object, or the target parameter\n */\n// eslint-disable-next-line complexity\nexport function getTableRowAsArray(\n table: Table,\n rowIndex: number,\n target?: unknown[],\n copy?: 'copy'\n): unknown[] {\n switch (table.shape) {\n case 'array-row-table':\n return copy ? Array.from(table.data[rowIndex]) : table.data[rowIndex];\n\n case 'object-row-table':\n if (table.schema) {\n const arrayRow: unknown[] = target || [];\n for (let i = 0; i < table.schema.fields.length; i++) {\n arrayRow[i] = table.data[rowIndex][table.schema.fields[i].name];\n }\n return arrayRow;\n }\n // Warning: just slap on the values, this risks mismatches between rows\n return Object.values(table.data[rowIndex]);\n\n case 'geojson-table':\n if (table.schema) {\n const arrayRow: unknown[] = target || [];\n // TODO - should lift properties to top level\n for (let i = 0; i < table.schema.fields.length; i++) {\n arrayRow[i] = table.features[rowIndex][table.schema.fields[i].name];\n }\n return arrayRow;\n }\n // Warning: just slap on the values, this risks mismatches between rows\n return Object.values(table.features[rowIndex]);\n\n case 'columnar-table':\n if (table.schema) {\n const arrayRow: unknown[] = target || [];\n for (let i = 0; i < table.schema.fields.length; i++) {\n arrayRow[i] = table.data[table.schema.fields[i].name][rowIndex];\n }\n return arrayRow;\n } else {\n // eslint-disable-line no-else-return\n const arrayRow: unknown[] = target || [];\n let i = 0;\n for (const column of Object.values(table.data)) {\n arrayRow[i] = column[rowIndex];\n i++;\n }\n return arrayRow;\n }\n\n case 'arrow-table':\n const arrowTable = table.data as any;\n const arrayRow: unknown[] = target || [];\n const row = arrowTable.get(rowIndex);\n const schema = arrowTable.schema;\n for (let i = 0; i < schema.fields.length; i++) {\n arrayRow[i] = row?.[schema.fields[i].name];\n }\n return arrayRow;\n\n default:\n throw new Error('shape');\n }\n}\n\n/** Convert any table into array row format */\nexport function makeArrayRowTable(table: Table): ArrayRowTable {\n if (table.shape === 'array-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<unknown[]>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsArray(table, rowIndex);\n }\n return {\n shape: 'array-row-table',\n schema: table.schema,\n data\n };\n}\n\n/** Convert any table into object row format */\nexport function makeObjectRowTable(table: Table): ObjectRowTable {\n if (table.shape === 'object-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'object-row-table',\n schema: table.schema,\n data\n };\n}\n\n/** Convert any table into object row format */\nexport function makeColumnarTable(table: Table): ObjectRowTable {\n if (table.shape === 'object-row-table') {\n return table;\n }\n const length = getTableLength(table);\n const data = new Array<{[key: string]: unknown}>(length);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n data[rowIndex] = getTableRowAsObject(table, rowIndex);\n }\n return {\n shape: 'object-row-table',\n schema: table.schema,\n data\n };\n}\n\n// Row Iterators\n\n/**\n * Iterate over table rows\n * @param table\n * @param shape\n */\nexport function* makeRowIterator(\n table: Table,\n shape: 'object-row-table' | 'array-row-table'\n): Iterable<unknown[] | {[key: string]: unknown}> {\n switch (shape) {\n case 'array-row-table':\n yield* makeArrayRowIterator(table);\n break;\n case 'object-row-table':\n yield* makeObjectRowIterator(table);\n break;\n\n default:\n throw new Error(`Unknown row type ${shape}`);\n }\n}\n\n/**\n * Streaming processing: Iterate over table, yielding array rows\n * @param table\n * @param shape\n */\nexport function* makeArrayRowIterator(table: Table, target: unknown[] = []): Iterable<unknown[]> {\n const length = getTableLength(table);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n yield getTableRowAsArray(table, rowIndex, target);\n }\n}\n\n/**\n * Streaming processing: Iterate over table, yielding object rows\n * @param table\n * @param shape\n */\nexport function* makeObjectRowIterator(\n table: Table,\n target: {[key: string]: unknown} = {}\n): Iterable<{[key: string]: unknown}> {\n const length = getTableLength(table);\n for (let rowIndex = 0; rowIndex < length; rowIndex++) {\n yield getTableRowAsObject(table, rowIndex, target);\n }\n}\n"],"mappings":"AAUA,OAAO,SAASA,cAAcA,CAACC,KAAY,EAAU;EACnD,QAAQA,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"","sources":["../../../../src/lib/table/simple-table/table-column.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-column.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/simple-table/table-column.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAG5C,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,OAAO;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;CAChB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAG3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-column.js","names":["getArrayTypeFromDataType","makeColumnFromField","field","length","ArrayType","type","nullable"],"sources":["../../../../src/lib/table/simple-table/table-column.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// import type {TypedArray,} from '../../../types/types';\nimport {Field} from '../../../types/schema';\nimport {getArrayTypeFromDataType} from './data-type';\n\nexport interface ArrayType<T = unknown> {\n readonly length: number;\n [n: number]: T;\n}\n\nexport function makeColumnFromField(field: Field, length: number): ArrayType {\n const ArrayType = getArrayTypeFromDataType(field.type, field.nullable);\n return new ArrayType(length);\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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"table-column.js","names":["getArrayTypeFromDataType","makeColumnFromField","field","length","ArrayType","type","nullable"],"sources":["../../../../src/lib/table/simple-table/table-column.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n// import type {TypedArray,} from '../../../types/types';\nimport {Field} from '../../../types/schema';\nimport {getArrayTypeFromDataType} from './data-type';\n\nexport interface ArrayType<T = unknown> {\n readonly length: number;\n [n: number]: T;\n}\n\nexport function makeColumnFromField(field: Field, length: number): ArrayType {\n const ArrayType = getArrayTypeFromDataType(field.type, field.nullable);\n return new ArrayType(length);\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"],"mappings":"SAKQA,wBAAwB;AAOhC,OAAO,SAASC,mBAAmBA,CAACC,KAAY,EAAEC,MAAc,EAAa;EAC3E,MAAMC,SAAS,GAAGJ,wBAAwB,CAACE,KAAK,CAACG,IAAI,EAAEH,KAAK,CAACI,QAAQ,CAAC;EACtE,OAAO,IAAIF,SAAS,CAACD,MAAM,CAAC;AAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/types/batch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/types/batch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAGhC,KAAK,iBAAiB,GAAG,OAAO,CAAC;AAEjC;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,iFAAiF;IACjF,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,cAAc,CAAC;IACnE,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,yDAAyD;IACzD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IAEf,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,qBAAqB;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC"}
|
package/dist/types/batch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.js","names":[],"sources":["../../src/types/batch.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {Schema} from './schema';\n// import type {RecordBatch} from 'apache-arrow';\n\ntype ApacheRecordBatch = unknown;\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?: ApacheRecordBatch;\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
|
+
{"version":3,"file":"batch.js","names":[],"sources":["../../src/types/batch.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {Schema} from './schema';\n// import type {RecordBatch} from 'apache-arrow';\n\ntype ApacheRecordBatch = unknown;\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?: ApacheRecordBatch;\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-mesh.d.ts","sourceRoot":"","sources":["../../src/types/category-mesh.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"category-mesh.d.ts","sourceRoot":"","sources":["../../src/types/category-mesh.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU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MAAM,EAAE,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"file":"category-mesh.js","names":[],"sources":["../../src/types/category-mesh.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-table.d.ts","sourceRoot":"","sources":["../../src/types/category-table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"category-table.d.ts","sourceRoot":"","sources":["../../src/types/category-table.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAK5C,KAAK,gBAAgB,GAAG,OAAO,CAAC;AAChC,KAAK,iBAAiB,GAAG,OAAO,CAAC;AAEjC,sBAAsB;AACtB,MAAM,MAAM,KAAK,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,YAAY,GACZ,aAAa,GACb,UAAU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,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;KAAC,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG;IACpC,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-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
|
+
{"version":3,"file":"category-table.js","names":[],"sources":["../../src/types/category-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-texture.d.ts","sourceRoot":"","sources":["../../src/types/category-texture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"category-texture.d.ts","sourceRoot":"","sources":["../../src/types/category-texture.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,MAAM,CAAC;AAEX,oBAAoB;AACpB,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"file":"category-texture.js","names":[],"sources":["../../src/types/category-texture.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flat-geometries.d.ts","sourceRoot":"","sources":["../../src/types/flat-geometries.ts"],"names":[],"m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AAC7D,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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":""}
|
|
1
|
+
{"version":3,"file":"flat-geometries.js","names":[],"sources":["../../src/types/flat-geometries.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\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":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/types/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/types/schema.ts"],"names":[],"mappings":"AAGA,0BAA0B;AAC1B,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjF,+BAA+B;AAC/B,MAAM,MAAM,QAAQ,GAChB,MAAM,GAEN,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,Q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,SAAS,EAAE,OAAO,CAAA;CAAC,CAAC;AAGjG;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC"}
|
package/dist/types/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":""}
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../src/types/schema.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/schema",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Table format APIs for JSON, CSV, etc...",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@types/geojson": "^7946.0.7"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "9b4211dc0ecd4134a1638ac0a29c5ea9008fd971"
|
|
46
46
|
}
|
package/src/types/batch.ts
CHANGED