@loaders.gl/schema 4.0.0-alpha.4 → 4.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/category/common.d.ts +19 -0
- package/dist/category/common.d.ts.map +1 -0
- package/dist/category/gis.d.ts +99 -0
- package/dist/category/gis.d.ts.map +1 -0
- package/dist/category/image/image.d.ts +18 -0
- package/dist/category/image/image.d.ts.map +1 -0
- package/dist/category/image/image.js +2 -0
- package/dist/category/image/image.js.map +1 -0
- package/dist/category/mesh/convert-mesh.d.ts +15 -0
- package/dist/category/mesh/convert-mesh.d.ts.map +1 -0
- package/dist/category/mesh/deduce-mesh-schema.d.ts +24 -0
- package/dist/category/mesh/deduce-mesh-schema.d.ts.map +1 -0
- package/dist/category/mesh/deduce-mesh-schema.js +1 -1
- package/dist/category/mesh/deduce-mesh-schema.js.map +1 -1
- package/dist/category/mesh/mesh-to-arrow-table.d.ts +11 -0
- package/dist/category/mesh/mesh-to-arrow-table.d.ts.map +1 -0
- package/dist/category/mesh/mesh-types.d.ts +50 -0
- package/dist/category/mesh/mesh-types.d.ts.map +1 -0
- package/dist/category/mesh/mesh-utils.d.ts +23 -0
- package/dist/category/mesh/mesh-utils.d.ts.map +1 -0
- package/dist/category/table/deduce-table-schema.d.ts +9 -0
- package/dist/category/table/deduce-table-schema.d.ts.map +1 -0
- package/dist/category/table/deduce-table-schema.js.map +1 -1
- package/dist/category/table/table-types.d.ts +76 -0
- package/dist/category/table/table-types.d.ts.map +1 -0
- package/dist/category/texture/texture.d.ts +18 -0
- package/dist/category/texture/texture.d.ts.map +1 -0
- package/dist/category/texture/texture.js +2 -0
- package/dist/category/texture/texture.js.map +1 -0
- package/dist/dist.min.js +16159 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/arrow/arrow-like-type-utils.d.ts +4 -0
- package/dist/lib/arrow/arrow-like-type-utils.d.ts.map +1 -0
- package/dist/lib/arrow/arrow-like-type-utils.js +1 -1
- package/dist/lib/arrow/arrow-like-type-utils.js.map +1 -1
- package/dist/lib/arrow/arrow-type-utils.d.ts +6 -0
- package/dist/lib/arrow/arrow-type-utils.d.ts.map +1 -0
- package/dist/lib/arrow/get-type-info.d.ts +14 -0
- package/dist/lib/arrow/get-type-info.d.ts.map +1 -0
- package/dist/lib/arrow/get-type-info.js +1 -1
- package/dist/lib/arrow/get-type-info.js.map +1 -1
- package/dist/lib/batches/base-table-batch-aggregator.d.ts +19 -0
- package/dist/lib/batches/base-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/base-table-batch-aggregator.js.map +1 -1
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts +23 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.js.map +1 -1
- package/dist/lib/batches/row-table-batch-aggregator.d.ts +22 -0
- package/dist/lib/batches/row-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/row-table-batch-aggregator.js.map +1 -1
- package/dist/lib/batches/table-batch-aggregator.d.ts +25 -0
- package/dist/lib/batches/table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/table-batch-builder.d.ts +53 -0
- package/dist/lib/batches/table-batch-builder.d.ts.map +1 -0
- package/dist/lib/batches/table-batch-builder.js.map +1 -1
- package/dist/lib/schema/impl/enum.d.ts +92 -0
- package/dist/lib/schema/impl/enum.d.ts.map +1 -0
- package/dist/lib/schema/impl/field.d.ts +19 -0
- package/dist/lib/schema/impl/field.d.ts.map +1 -0
- package/dist/lib/schema/impl/schema.d.ts +16 -0
- package/dist/lib/schema/impl/schema.d.ts.map +1 -0
- package/dist/lib/schema/impl/type.d.ts +176 -0
- package/dist/lib/schema/impl/type.d.ts.map +1 -0
- package/dist/lib/schema/schema.d.ts +5 -0
- package/dist/lib/schema/schema.d.ts.map +1 -0
- package/dist/lib/schema/{index.js → schema.js} +1 -1
- package/dist/lib/schema/schema.js.map +1 -0
- package/dist/lib/schema-utils/deduce-column-type.d.ts +3 -0
- package/dist/lib/schema-utils/deduce-column-type.d.ts.map +1 -0
- package/dist/lib/utils/assert.d.ts +2 -0
- package/dist/lib/utils/assert.d.ts.map +1 -0
- package/dist/lib/utils/async-queue.d.ts +18 -0
- package/dist/lib/utils/async-queue.d.ts.map +1 -0
- package/dist/lib/utils/row-utils.d.ts +9 -0
- package/dist/lib/utils/row-utils.d.ts.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/category/gis.ts +69 -1
- package/src/category/image/image.ts +19 -0
- package/src/category/mesh/deduce-mesh-schema.ts +1 -1
- package/src/category/mesh/mesh-types.ts +1 -1
- package/src/category/table/deduce-table-schema.ts +1 -1
- package/src/category/table/table-types.ts +1 -1
- package/src/category/texture/texture.ts +28 -0
- package/src/index.ts +22 -3
- package/src/lib/arrow/arrow-like-type-utils.ts +11 -1
- package/src/lib/arrow/get-type-info.ts +1 -1
- package/src/lib/batches/base-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/columnar-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/row-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/table-batch-aggregator.ts +1 -1
- package/src/lib/batches/table-batch-builder.ts +1 -1
- package/src/lib/schema/{index.ts → schema.ts} +0 -0
- package/dist/lib/schema/index.js.map +0 -1
package/dist/bundle.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,aAAa,KAAqB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RecordBatch } from 'apache-arrow';
|
|
2
|
+
export declare type Field = any;
|
|
3
|
+
export declare type Schema = {
|
|
4
|
+
[key: string]: Field;
|
|
5
|
+
};
|
|
6
|
+
export declare type Batch = {
|
|
7
|
+
batchType: 'data' | 'metadata' | 'partial-result' | 'final-result';
|
|
8
|
+
mimeType?: string;
|
|
9
|
+
shape: string;
|
|
10
|
+
data: any;
|
|
11
|
+
recordBatch?: RecordBatch;
|
|
12
|
+
length: number;
|
|
13
|
+
schema?: Schema;
|
|
14
|
+
bytesUsed?: number;
|
|
15
|
+
count?: number;
|
|
16
|
+
cursor?: number;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/category/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C,oBAAY,KAAK,GAAG,GAAG,CAAC;AAExB,oBAAY,MAAM,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,cAAc,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;IACV,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { TypedArray } from '../types';
|
|
2
|
+
import type { Feature, Geometry, Point, LineString, Polygon } from 'geojson';
|
|
3
|
+
export type { GeoJSON, Feature, Geometry, Position, GeoJsonProperties } from 'geojson';
|
|
4
|
+
export type { Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection } from 'geojson';
|
|
5
|
+
export declare type GeojsonGeometryInfo = {
|
|
6
|
+
coordLength: number;
|
|
7
|
+
pointPositionsCount: number;
|
|
8
|
+
pointFeaturesCount: number;
|
|
9
|
+
linePositionsCount: number;
|
|
10
|
+
linePathsCount: number;
|
|
11
|
+
lineFeaturesCount: number;
|
|
12
|
+
polygonPositionsCount: number;
|
|
13
|
+
polygonObjectsCount: number;
|
|
14
|
+
polygonRingsCount: number;
|
|
15
|
+
polygonFeaturesCount: number;
|
|
16
|
+
};
|
|
17
|
+
export declare type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
18
|
+
declare type RemoveCoordinatesField<Type> = {
|
|
19
|
+
[Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Generic flat geometry data storage type
|
|
23
|
+
*/
|
|
24
|
+
export declare type FlatIndexedGeometry = {
|
|
25
|
+
data: number[];
|
|
26
|
+
indices: number[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices`
|
|
30
|
+
*/
|
|
31
|
+
export declare type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;
|
|
32
|
+
/**
|
|
33
|
+
* GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices`
|
|
34
|
+
*/
|
|
35
|
+
export declare type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;
|
|
36
|
+
/**
|
|
37
|
+
* GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices`
|
|
38
|
+
*/
|
|
39
|
+
export declare type FlatPolygon = RemoveCoordinatesField<Polygon> & {
|
|
40
|
+
data: number[];
|
|
41
|
+
indices: number[][];
|
|
42
|
+
areas: number[][];
|
|
43
|
+
};
|
|
44
|
+
export declare type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;
|
|
45
|
+
declare type FlattenGeometry<Type> = {
|
|
46
|
+
[Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* GeoJSON Feature with Geometry replaced by FlatGeometry
|
|
50
|
+
*/
|
|
51
|
+
export declare type FlatFeature = FlattenGeometry<Feature>;
|
|
52
|
+
export declare type BinaryAttribute = {
|
|
53
|
+
value: TypedArray;
|
|
54
|
+
size: number;
|
|
55
|
+
};
|
|
56
|
+
export declare type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
57
|
+
declare type NumericProps = {
|
|
58
|
+
[key: string]: BinaryAttribute;
|
|
59
|
+
};
|
|
60
|
+
declare type Properties = object[];
|
|
61
|
+
/**
|
|
62
|
+
* Represent a single Geometry, similar to a GeoJSON Geometry
|
|
63
|
+
*/
|
|
64
|
+
export declare type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;
|
|
65
|
+
export declare type BinaryPointGeometry = {
|
|
66
|
+
type: 'Point';
|
|
67
|
+
positions: BinaryAttribute;
|
|
68
|
+
};
|
|
69
|
+
export declare type BinaryLineGeometry = {
|
|
70
|
+
type: 'LineString';
|
|
71
|
+
positions: BinaryAttribute;
|
|
72
|
+
pathIndices: BinaryAttribute;
|
|
73
|
+
};
|
|
74
|
+
export declare type BinaryPolygonGeometry = {
|
|
75
|
+
type: 'Polygon';
|
|
76
|
+
positions: BinaryAttribute;
|
|
77
|
+
polygonIndices: BinaryAttribute;
|
|
78
|
+
primitivePolygonIndices: BinaryAttribute;
|
|
79
|
+
triangles?: BinaryAttribute;
|
|
80
|
+
};
|
|
81
|
+
export declare type BinaryProperties = {
|
|
82
|
+
featureIds: BinaryAttribute;
|
|
83
|
+
globalFeatureIds: BinaryAttribute;
|
|
84
|
+
numericProps: NumericProps;
|
|
85
|
+
properties: Properties;
|
|
86
|
+
fields?: Properties;
|
|
87
|
+
};
|
|
88
|
+
export declare type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;
|
|
89
|
+
export declare type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;
|
|
90
|
+
export declare type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;
|
|
91
|
+
/**
|
|
92
|
+
* Represent a collection of Features, similar to a GeoJSON FeatureCollection
|
|
93
|
+
*/
|
|
94
|
+
export declare type BinaryFeatures = {
|
|
95
|
+
points?: BinaryPointFeatures;
|
|
96
|
+
lines?: BinaryLineFeatures;
|
|
97
|
+
polygons?: BinaryPolygonFeatures;
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=gis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gis.d.ts","sourceRoot":"","sources":["../../src/category/gis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,SAAS,CAAC;AAK3E,YAAY,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAErF,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAGjB,oBAAY,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qB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,CAAC,EAAE,qBAAqB,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* data images
|
|
3
|
+
*/
|
|
4
|
+
export declare type ImageDataType = {
|
|
5
|
+
data: Uint8Array;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
compressed?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Supported Image Types
|
|
12
|
+
*/
|
|
13
|
+
export declare type ImageType = ImageBitmap | typeof Image | ImageDataType;
|
|
14
|
+
/**
|
|
15
|
+
* Image type string used to control or determine the type of images returned from ImageLoader
|
|
16
|
+
*/
|
|
17
|
+
export declare type ImageTypeEnum = 'imagebitmap' | 'image' | 'data';
|
|
18
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/category/image/image.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS,GAAG,WAAW,GAAG,OAAO,KAAK,GAAG,aAAa,CAAC;AAEnE;;GAEG;AACH,oBAAY,aAAa,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"image.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Mesh } from './mesh-types';
|
|
2
|
+
import type { ColumnarTable, ArrowTable } from '../table/table-types';
|
|
3
|
+
declare type TargetShape = 'mesh' | 'columnar-table' | 'arrow-table';
|
|
4
|
+
/**
|
|
5
|
+
* Convert a mesh to a specific shape
|
|
6
|
+
*/
|
|
7
|
+
export declare function convertMesh(mesh: Mesh, shape: TargetShape, options?: any): Mesh | ColumnarTable | ArrowTable;
|
|
8
|
+
/**
|
|
9
|
+
* Convert a loaders.gl Mesh to a Columnar Table
|
|
10
|
+
* @param mesh
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function convertMeshToColumnarTable(mesh: Mesh): ColumnarTable;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=convert-mesh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-mesh.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/convert-mesh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAGpE,aAAK,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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MeshAttribute, MeshAttributes } from './mesh-types';
|
|
2
|
+
import { Schema, Field } from '../../lib/schema/schema';
|
|
3
|
+
/**
|
|
4
|
+
* Create a schema for mesh attributes data
|
|
5
|
+
* @param attributes
|
|
6
|
+
* @param metadata
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function deduceMeshSchema(attributes: MeshAttributes, metadata?: Map<string, string>): Schema;
|
|
10
|
+
/**
|
|
11
|
+
* Create arrow-like schema field for mesh attribute
|
|
12
|
+
* @param attributeName
|
|
13
|
+
* @param attribute
|
|
14
|
+
* @param optionalMetadata
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function deduceMeshField(attributeName: string, attribute: MeshAttribute, optionalMetadata?: Map<string, string>): Field;
|
|
18
|
+
/**
|
|
19
|
+
* Make metadata by mesh attribute properties
|
|
20
|
+
* @param attribute
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare function makeMeshAttributeMetadata(attribute: MeshAttribute): Map<string, string>;
|
|
24
|
+
//# sourceMappingURL=deduce-mesh-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduce-mesh-schema.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/deduce-mesh-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAE,KAAK,EAAgB,MAAM,yBAAyB,CAAC;AAGrE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,cAAc,EAC1B,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAGR;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,aAAa,EACxB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,KAAK,CAUP;AAgBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAYvF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema, Field, FixedSizeList } from '../../lib/schema';
|
|
1
|
+
import { Schema, Field, FixedSizeList } from '../../lib/schema/schema';
|
|
2
2
|
import { getArrowTypeFromTypedArray } from '../../lib/arrow/arrow-like-type-utils';
|
|
3
3
|
export function deduceMeshSchema(attributes, metadata) {
|
|
4
4
|
const fields = deduceMeshFields(attributes);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/category/mesh/deduce-mesh-schema.ts"],"names":["Schema","Field","FixedSizeList","getArrowTypeFromTypedArray","deduceMeshSchema","attributes","metadata","fields","deduceMeshFields","deduceMeshField","attributeName","attribute","optionalMetadata","type","value","makeMeshAttributeMetadata","field","size","push","result","Map","set","byteOffset","toString","byteStride","normalized"],"mappings":"AACA,SAAQA,MAAR,EAAgBC,KAAhB,EAAuBC,aAAvB,QAA2C,
|
|
1
|
+
{"version":3,"sources":["../../../src/category/mesh/deduce-mesh-schema.ts"],"names":["Schema","Field","FixedSizeList","getArrowTypeFromTypedArray","deduceMeshSchema","attributes","metadata","fields","deduceMeshFields","deduceMeshField","attributeName","attribute","optionalMetadata","type","value","makeMeshAttributeMetadata","field","size","push","result","Map","set","byteOffset","toString","byteStride","normalized"],"mappings":"AACA,SAAQA,MAAR,EAAgBC,KAAhB,EAAuBC,aAAvB,QAA2C,yBAA3C;AACA,SAAQC,0BAAR,QAAyC,uCAAzC;AAQA,OAAO,SAASC,gBAAT,CACLC,UADK,EAELC,QAFK,EAGG;AACR,QAAMC,MAAM,GAAGC,gBAAgB,CAACH,UAAD,CAA/B;AACA,SAAO,IAAIL,MAAJ,CAAWO,MAAX,EAAmBD,QAAnB,CAAP;AACD;AASD,OAAO,SAASG,eAAT,CACLC,aADK,EAELC,SAFK,EAGLC,gBAHK,EAIE;AACP,QAAMC,IAAI,GAAGV,0BAA0B,CAACQ,SAAS,CAACG,KAAX,CAAvC;AACA,QAAMR,QAAQ,GAAGM,gBAAgB,GAAGA,gBAAH,GAAsBG,yBAAyB,CAACJ,SAAD,CAAhF;AACA,QAAMK,KAAK,GAAG,IAAIf,KAAJ,CACZS,aADY,EAEZ,IAAIR,aAAJ,CAAkBS,SAAS,CAACM,IAA5B,EAAkC,IAAIhB,KAAJ,CAAU,OAAV,EAAmBY,IAAnB,CAAlC,CAFY,EAGZ,KAHY,EAIZP,QAJY,CAAd;AAMA,SAAOU,KAAP;AACD;;AAOD,SAASR,gBAAT,CAA0BH,UAA1B,EAA+D;AAC7D,QAAME,MAAe,GAAG,EAAxB;;AACA,OAAK,MAAMG,aAAX,IAA4BL,UAA5B,EAAwC;AACtC,UAAMM,SAAwB,GAAGN,UAAU,CAACK,aAAD,CAA3C;AACAH,IAAAA,MAAM,CAACW,IAAP,CAAYT,eAAe,CAACC,aAAD,EAAgBC,SAAhB,CAA3B;AACD;;AACD,SAAOJ,MAAP;AACD;;AAOD,OAAO,SAASQ,yBAAT,CAAmCJ,SAAnC,EAAkF;AACvF,QAAMQ,MAAM,GAAG,IAAIC,GAAJ,EAAf;;AACA,MAAI,gBAAgBT,SAApB,EAA+B;AAC7BQ,IAAAA,MAAM,CAACE,GAAP,CAAW,YAAX,EAAyBV,SAAS,CAACW,UAAV,CAAsBC,QAAtB,CAA+B,EAA/B,CAAzB;AACD;;AACD,MAAI,gBAAgBZ,SAApB,EAA+B;AAC7BQ,IAAAA,MAAM,CAACE,GAAP,CAAW,YAAX,EAAyBV,SAAS,CAACa,UAAV,CAAsBD,QAAtB,CAA+B,EAA/B,CAAzB;AACD;;AACD,MAAI,gBAAgBZ,SAApB,EAA+B;AAC7BQ,IAAAA,MAAM,CAACE,GAAP,CAAW,YAAX,EAAyBV,SAAS,CAACc,UAAV,CAAsBF,QAAtB,EAAzB;AACD;;AACD,SAAOJ,MAAP;AACD","sourcesContent":["import {MeshAttribute, MeshAttributes} from './mesh-types';\nimport {Schema, Field, FixedSizeList} from '../../lib/schema/schema';\nimport {getArrowTypeFromTypedArray} from '../../lib/arrow/arrow-like-type-utils';\n\n/**\n * Create a schema for mesh attributes data\n * @param attributes\n * @param metadata\n * @returns\n */\nexport function deduceMeshSchema(\n attributes: MeshAttributes,\n metadata?: Map<string, string>\n): Schema {\n const fields = deduceMeshFields(attributes);\n return new Schema(fields, metadata);\n}\n\n/**\n * Create arrow-like schema field for mesh attribute\n * @param attributeName\n * @param attribute\n * @param optionalMetadata\n * @returns\n */\nexport function deduceMeshField(\n attributeName: string,\n attribute: MeshAttribute,\n optionalMetadata?: Map<string, string>\n): Field {\n const type = getArrowTypeFromTypedArray(attribute.value);\n const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);\n const field = new Field(\n attributeName,\n new FixedSizeList(attribute.size, new Field('value', type)),\n false,\n metadata\n );\n return field;\n}\n\n/**\n * Create fields array for mesh attributes\n * @param attributes\n * @returns\n */\nfunction deduceMeshFields(attributes: MeshAttributes): Field[] {\n const fields: Field[] = [];\n for (const attributeName in attributes) {\n const attribute: MeshAttribute = attributes[attributeName];\n fields.push(deduceMeshField(attributeName, attribute));\n }\n return fields;\n}\n\n/**\n * Make metadata by mesh attribute properties\n * @param attribute\n * @returns\n */\nexport function makeMeshAttributeMetadata(attribute: MeshAttribute): Map<string, string> {\n const result = new Map();\n if ('byteOffset' in attribute) {\n result.set('byteOffset', attribute.byteOffset!.toString(10));\n }\n if ('byteStride' in attribute) {\n result.set('byteStride', attribute.byteStride!.toString(10));\n }\n if ('normalized' in attribute) {\n result.set('normalized', attribute.normalized!.toString());\n }\n return result;\n}\n"],"file":"deduce-mesh-schema.js"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Table } from 'apache-arrow/Arrow.dom';
|
|
2
|
+
import type { Mesh } from './mesh-types';
|
|
3
|
+
/**
|
|
4
|
+
* * Convert a loaders.gl Mesh to an Apache Arrow Table
|
|
5
|
+
* @param mesh
|
|
6
|
+
* @param metadata
|
|
7
|
+
* @param batchSize
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function convertMeshToArrowTable(mesh: Mesh, batchSize?: number): Table;
|
|
11
|
+
//# sourceMappingURL=mesh-to-arrow-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-to-arrow-table.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/mesh-to-arrow-table.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAON,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAGvC;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAmB7E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Schema } from '../../lib/schema/schema';
|
|
2
|
+
import type { TypedArray } from '../../types';
|
|
3
|
+
import type { ColumnarTable, ArrowTable } from '../table/table-types';
|
|
4
|
+
/** Mesh as columnar table */
|
|
5
|
+
export interface MeshTable extends ColumnarTable {
|
|
6
|
+
topology: 'point-list' | 'triangle-list' | 'triangle-strip';
|
|
7
|
+
indices?: MeshAttribute;
|
|
8
|
+
}
|
|
9
|
+
/** Mesh as arrow table */
|
|
10
|
+
export interface MeshArrowTable extends ArrowTable {
|
|
11
|
+
topology: 'point-list' | 'triangle-list' | 'triangle-strip';
|
|
12
|
+
indices?: MeshAttribute;
|
|
13
|
+
}
|
|
14
|
+
/** Geometry part of a Mesh (compatible with a standard luma.gl "mesh") */
|
|
15
|
+
export declare type MeshGeometry = {
|
|
16
|
+
attributes: {
|
|
17
|
+
[attributeName: string]: MeshAttribute;
|
|
18
|
+
};
|
|
19
|
+
indices?: MeshAttribute;
|
|
20
|
+
topology: 'point-list' | 'triangle-list' | 'triangle-strip';
|
|
21
|
+
mode: number;
|
|
22
|
+
};
|
|
23
|
+
/** Geometry and metadata for a Mesh (compatible with a standard luma.gl "mesh") */
|
|
24
|
+
export declare type Mesh = MeshGeometry & {
|
|
25
|
+
loader?: string;
|
|
26
|
+
loaderData?: {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
};
|
|
29
|
+
header?: {
|
|
30
|
+
vertexCount: number;
|
|
31
|
+
boundingBox?: [number[], number[]];
|
|
32
|
+
};
|
|
33
|
+
schema: Schema;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* luma.gl compatible attribute descriptors
|
|
37
|
+
* Can be mapped to any WebGL framework
|
|
38
|
+
*/
|
|
39
|
+
export declare type MeshAttribute = {
|
|
40
|
+
value: TypedArray;
|
|
41
|
+
size: number;
|
|
42
|
+
byteOffset?: number;
|
|
43
|
+
byteStride?: number;
|
|
44
|
+
normalized?: boolean;
|
|
45
|
+
};
|
|
46
|
+
/** A map of mesh attributes keyed by attribute names */
|
|
47
|
+
export declare type MeshAttributes = {
|
|
48
|
+
[attributeName: string]: MeshAttribute;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=mesh-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-types.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/mesh-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEpE,6BAA6B;AAC7B,MAAM,WAAW,SAAU,SAAQ,aAAa;IAE9C,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,0BAA0B;AAC1B,MAAM,WAAW,cAAe,SAAQ,UAAU;IAEhD,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,0EAA0E;AAC1E,oBAAY,YAAY,GAAG;IACzB,UAAU,EAAE;QAAC,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAA;KAAC,CAAC;IACrD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,mFAAmF;AACnF,oBAAY,IAAI,GAAG,YAAY,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,CAAC;IAClC,MAAM,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;KACpC,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,oBAAY,aAAa,GAAG;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wDAAwD;AACxD,oBAAY,cAAc,GAAG;IAAC,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAA;CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TypedArray } from '../../types';
|
|
2
|
+
import { MeshAttributes } from './mesh-types';
|
|
3
|
+
declare type TypedArrays = {
|
|
4
|
+
[key: string]: TypedArray;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Holds an axis aligned bounding box
|
|
8
|
+
* TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)
|
|
9
|
+
*/
|
|
10
|
+
declare type BoundingBox = [[number, number, number], [number, number, number]];
|
|
11
|
+
/**
|
|
12
|
+
* Get number of vertices in mesh
|
|
13
|
+
* @param attributes
|
|
14
|
+
*/
|
|
15
|
+
export declare function getMeshSize(attributes: TypedArrays): number;
|
|
16
|
+
/**
|
|
17
|
+
* Get the (axis aligned) bounding box of a mesh
|
|
18
|
+
* @param attributes
|
|
19
|
+
* @returns array of two vectors representing the axis aligned bounding box
|
|
20
|
+
*/
|
|
21
|
+
export declare function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=mesh-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-utils.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/mesh-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5C,aAAK,WAAW,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAC,CAAC;AAE/C;;;GAGG;AACH,aAAK,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAExE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,WAAW,GAAG,MAAM,CAU3D;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,GAAG,WAAW,CA4B1E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Schema } from '../../lib/schema/schema';
|
|
2
|
+
/**
|
|
3
|
+
* SCHEMA SUPPORT - AUTODEDUCTION
|
|
4
|
+
* @param {*} table
|
|
5
|
+
* @param {*} schema
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function deduceTableSchema(table: any, schema?: Schema): Schema;
|
|
9
|
+
//# sourceMappingURL=deduce-table-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduce-table-schema.d.ts","sourceRoot":"","sources":["../../../src/category/table/deduce-table-schema.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EAcP,MAAM,yBAAyB,CAAC;AAmBjC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,KAAA,EAAE,MAAM,CAAC,EAAE,MAAM,UAMvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/category/table/deduce-table-schema.ts"],"names":["deduceTableSchema","table","schema","deducedSchema","Array","isArray","deduceSchemaForRowTable","deduceSchemaForColumnarTable","Object","assign","columnarTable","field","column","ArrayBuffer","isView","constructor","length","value","deduceTypeFromValue","rowTable","row","Date","Number","Float32Array","String"],"mappings":"AAyCA,OAAO,SAASA,iBAAT,CAA2BC,KAA3B,EAAkCC,MAAlC,EAAmD;AACxD,QAAMC,aAAa,GAAGC,KAAK,CAACC,OAAN,CAAcJ,KAAd,IAClBK,uBAAuB,CAACL,KAAD,CADL,GAElBM,4BAA4B,CAACN,KAAD,CAFhC;AAIA,SAAOO,MAAM,CAACC,MAAP,CAAcN,aAAd,EAA6BD,MAA7B,CAAP;AACD;;AAED,SAASK,4BAAT,CAAsCG,aAAtC,EAAqD;AACnD,QAAMR,MAAM,GAAG,EAAf;;AACA,OAAK,MAAMS,KAAX,IAAoBD,aAApB,EAAmC;AACjC,UAAME,MAAM,GAAGF,aAAa,CAACC,KAAD,CAA5B;;AAEA,QAAIE,WAAW,CAACC,MAAZ,CAAmBF,MAAnB,CAAJ,EAAgC;AAC9BV,MAAAA,MAAM,CAACS,KAAD,CAAN,GAAgBC,MAAM,CAACG,WAAvB;AAED,KAHD,MAGO,IAAIH,MAAM,CAACI,MAAX,EAAmB;AACxB,YAAMC,KAAK,GAAGL,MAAM,CAAC,CAAD,CAApB;AACAV,MAAAA,MAAM,CAACS,KAAD,CAAN,GAAgBO,mBAAmB,CAACD,KAAD,CAAnC;AAED;;AAEDf,IAAAA,MAAM,CAACS,KAAD,CAAN,GAAgBT,MAAM,CAACS,KAAD,CAAN,IAAiB,IAAjC;AACD;;AACD,SAAOT,MAAP;AACD;;AAED,SAASI,uBAAT,CAAiCa,QAAjC,EAA2C;AACzC,QAAMjB,MAAM,GAAG,EAAf;;AACA,MAAIiB,QAAQ,CAACH,MAAb,EAAqB;AACnB,UAAMI,GAAG,GAAGD,QAAQ,CAAC,CAAD,CAApB;;AAEA,SAAK,MAAMR,KAAX,IAAoBS,GAApB,EAAyB;AACvB,YAAMH,KAAK,GAAGG,GAAG,CAACT,KAAD,CAAjB;AACAT,MAAAA,MAAM,CAACS,KAAD,CAAN,GAAgBO,mBAAmB,CAACD,KAAD,CAAnC;AACD;AACF;;AACD,SAAOf,MAAP;AACD;;AAED,SAASgB,mBAAT,CAA6BD,KAA7B,EAAoC;AAClC,MAAIA,KAAK,YAAYI,IAArB,EAA2B;AACzB,WAAOA,IAAP;AACD,GAFD,MAEO,IAAIJ,KAAK,YAAYK,MAArB,EAA6B;AAClC,WAAOC,YAAP;AACD,GAFM,MAEA,IAAI,OAAON,KAAP,KAAiB,QAArB,EAA+B;AACpC,WAAOO,MAAP;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["// Type deduction\nimport {\n Schema\n // Int,\n // Int8,\n // Int16,\n // Int32,\n // Uint8,\n // Uint16,\n // Uint32,\n // Float32,\n // Float64\n // Bool,\n // Utf8,\n // TimestampMillisecond,\n // Null\n} from '../../lib/schema';\n\n// const TYPED_ARRAY_TO_TYPE = {\n// Int8Array: new Int8(),\n// Int16Array: new Int16(),\n// Int32Array: new Int32(),\n// Uint8Array: new Uint8(),\n// Uint8ClampedArray: new Uint8(),\n// Uint16Array: new Uint16(),\n// Uint32Array: new Uint32(),\n// Float32Array: new Float32(),\n// Float64Array: new Float64()\n// };\n\n// if (typeof BigInt64Array !== 'undefined') {\n// TYPED_ARRAY_TO_TYPE.BigInt64Array = new Int64();\n// TYPED_ARRAY_TO_TYPE.BigUint64Array = new Uint64();\n// }\n\n/**\n * SCHEMA SUPPORT - AUTODEDUCTION\n * @param {*} table\n * @param {*} schema\n * @returns\n */\nexport function deduceTableSchema(table, schema?: Schema) {\n const deducedSchema = Array.isArray(table)\n ? deduceSchemaForRowTable(table)\n : deduceSchemaForColumnarTable(table);\n // Deduced schema will fill in missing info from partial options.schema, if provided\n return Object.assign(deducedSchema, schema);\n}\n\nfunction deduceSchemaForColumnarTable(columnarTable) {\n const schema = {};\n for (const field in columnarTable) {\n const column = columnarTable[field];\n // Check if column is typed, if so we are done\n if (ArrayBuffer.isView(column)) {\n schema[field] = column.constructor;\n // else we need data\n } else if (column.length) {\n const value = column[0];\n schema[field] = deduceTypeFromValue(value);\n // TODO - support nested schemas?\n }\n // else we mark as present but unknow\n schema[field] = schema[field] || null;\n }\n return schema;\n}\n\nfunction deduceSchemaForRowTable(rowTable) {\n const schema = {};\n if (rowTable.length) {\n const row = rowTable[0];\n // TODO - Could look at additional rows if nulls in first row\n for (const field in row) {\n const value = row[field];\n schema[field] = deduceTypeFromValue(value);\n }\n }\n return schema;\n}\n\nfunction deduceTypeFromValue(value) {\n if (value instanceof Date) {\n return Date;\n } else if (value instanceof Number) {\n return Float32Array;\n } else if (typeof value === 'string') {\n return String;\n }\n return null;\n}\n\n/*\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction deduceSchema(rows) {\n const row = rows[0];\n\n const schema = {};\n let i = 0;\n for (const columnName in row) {\n const value = row[columnName];\n switch (typeof value) {\n case 'number':\n case 'boolean':\n // TODO - booleans could be handled differently...\n schema[columnName] = {name: String(columnName), index: i, type: Float32Array};\n break;\n\n case 'object':\n schema[columnName] = {name: String(columnName), index: i, type: Array};\n break;\n\n case 'string':\n default:\n schema[columnName] = {name: String(columnName), index: i, type: Array};\n // We currently only handle numeric rows\n // TODO we could offer a function to map strings to numbers?\n }\n i++;\n }\n return schema;\n}\n*/\n"],"file":"deduce-table-schema.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/category/table/deduce-table-schema.ts"],"names":["deduceTableSchema","table","schema","deducedSchema","Array","isArray","deduceSchemaForRowTable","deduceSchemaForColumnarTable","Object","assign","columnarTable","field","column","ArrayBuffer","isView","constructor","length","value","deduceTypeFromValue","rowTable","row","Date","Number","Float32Array","String"],"mappings":"AAyCA,OAAO,SAASA,iBAAT,CAA2BC,KAA3B,EAAkCC,MAAlC,EAAmD;AACxD,QAAMC,aAAa,GAAGC,KAAK,CAACC,OAAN,CAAcJ,KAAd,IAClBK,uBAAuB,CAACL,KAAD,CADL,GAElBM,4BAA4B,CAACN,KAAD,CAFhC;AAIA,SAAOO,MAAM,CAACC,MAAP,CAAcN,aAAd,EAA6BD,MAA7B,CAAP;AACD;;AAED,SAASK,4BAAT,CAAsCG,aAAtC,EAAqD;AACnD,QAAMR,MAAM,GAAG,EAAf;;AACA,OAAK,MAAMS,KAAX,IAAoBD,aAApB,EAAmC;AACjC,UAAME,MAAM,GAAGF,aAAa,CAACC,KAAD,CAA5B;;AAEA,QAAIE,WAAW,CAACC,MAAZ,CAAmBF,MAAnB,CAAJ,EAAgC;AAC9BV,MAAAA,MAAM,CAACS,KAAD,CAAN,GAAgBC,MAAM,CAACG,WAAvB;AAED,KAHD,MAGO,IAAIH,MAAM,CAACI,MAAX,EAAmB;AACxB,YAAMC,KAAK,GAAGL,MAAM,CAAC,CAAD,CAApB;AACAV,MAAAA,MAAM,CAACS,KAAD,CAAN,GAAgBO,mBAAmB,CAACD,KAAD,CAAnC;AAED;;AAEDf,IAAAA,MAAM,CAACS,KAAD,CAAN,GAAgBT,MAAM,CAACS,KAAD,CAAN,IAAiB,IAAjC;AACD;;AACD,SAAOT,MAAP;AACD;;AAED,SAASI,uBAAT,CAAiCa,QAAjC,EAA2C;AACzC,QAAMjB,MAAM,GAAG,EAAf;;AACA,MAAIiB,QAAQ,CAACH,MAAb,EAAqB;AACnB,UAAMI,GAAG,GAAGD,QAAQ,CAAC,CAAD,CAApB;;AAEA,SAAK,MAAMR,KAAX,IAAoBS,GAApB,EAAyB;AACvB,YAAMH,KAAK,GAAGG,GAAG,CAACT,KAAD,CAAjB;AACAT,MAAAA,MAAM,CAACS,KAAD,CAAN,GAAgBO,mBAAmB,CAACD,KAAD,CAAnC;AACD;AACF;;AACD,SAAOf,MAAP;AACD;;AAED,SAASgB,mBAAT,CAA6BD,KAA7B,EAAoC;AAClC,MAAIA,KAAK,YAAYI,IAArB,EAA2B;AACzB,WAAOA,IAAP;AACD,GAFD,MAEO,IAAIJ,KAAK,YAAYK,MAArB,EAA6B;AAClC,WAAOC,YAAP;AACD,GAFM,MAEA,IAAI,OAAON,KAAP,KAAiB,QAArB,EAA+B;AACpC,WAAOO,MAAP;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["// Type deduction\nimport {\n Schema\n // Int,\n // Int8,\n // Int16,\n // Int32,\n // Uint8,\n // Uint16,\n // Uint32,\n // Float32,\n // Float64\n // Bool,\n // Utf8,\n // TimestampMillisecond,\n // Null\n} from '../../lib/schema/schema';\n\n// const TYPED_ARRAY_TO_TYPE = {\n// Int8Array: new Int8(),\n// Int16Array: new Int16(),\n// Int32Array: new Int32(),\n// Uint8Array: new Uint8(),\n// Uint8ClampedArray: new Uint8(),\n// Uint16Array: new Uint16(),\n// Uint32Array: new Uint32(),\n// Float32Array: new Float32(),\n// Float64Array: new Float64()\n// };\n\n// if (typeof BigInt64Array !== 'undefined') {\n// TYPED_ARRAY_TO_TYPE.BigInt64Array = new Int64();\n// TYPED_ARRAY_TO_TYPE.BigUint64Array = new Uint64();\n// }\n\n/**\n * SCHEMA SUPPORT - AUTODEDUCTION\n * @param {*} table\n * @param {*} schema\n * @returns\n */\nexport function deduceTableSchema(table, schema?: Schema) {\n const deducedSchema = Array.isArray(table)\n ? deduceSchemaForRowTable(table)\n : deduceSchemaForColumnarTable(table);\n // Deduced schema will fill in missing info from partial options.schema, if provided\n return Object.assign(deducedSchema, schema);\n}\n\nfunction deduceSchemaForColumnarTable(columnarTable) {\n const schema = {};\n for (const field in columnarTable) {\n const column = columnarTable[field];\n // Check if column is typed, if so we are done\n if (ArrayBuffer.isView(column)) {\n schema[field] = column.constructor;\n // else we need data\n } else if (column.length) {\n const value = column[0];\n schema[field] = deduceTypeFromValue(value);\n // TODO - support nested schemas?\n }\n // else we mark as present but unknow\n schema[field] = schema[field] || null;\n }\n return schema;\n}\n\nfunction deduceSchemaForRowTable(rowTable) {\n const schema = {};\n if (rowTable.length) {\n const row = rowTable[0];\n // TODO - Could look at additional rows if nulls in first row\n for (const field in row) {\n const value = row[field];\n schema[field] = deduceTypeFromValue(value);\n }\n }\n return schema;\n}\n\nfunction deduceTypeFromValue(value) {\n if (value instanceof Date) {\n return Date;\n } else if (value instanceof Number) {\n return Float32Array;\n } else if (typeof value === 'string') {\n return String;\n }\n return null;\n}\n\n/*\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction deduceSchema(rows) {\n const row = rows[0];\n\n const schema = {};\n let i = 0;\n for (const columnName in row) {\n const value = row[columnName];\n switch (typeof value) {\n case 'number':\n case 'boolean':\n // TODO - booleans could be handled differently...\n schema[columnName] = {name: String(columnName), index: i, type: Float32Array};\n break;\n\n case 'object':\n schema[columnName] = {name: String(columnName), index: i, type: Array};\n break;\n\n case 'string':\n default:\n schema[columnName] = {name: String(columnName), index: i, type: Array};\n // We currently only handle numeric rows\n // TODO we could offer a function to map strings to numbers?\n }\n i++;\n }\n return schema;\n}\n*/\n"],"file":"deduce-table-schema.js"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Schema } from '../../lib/schema/schema';
|
|
2
|
+
import type { Table as ApacheArrowTable, RecordBatch } from 'apache-arrow/Arrow.dom';
|
|
3
|
+
import type { AnyArray } from '../../types';
|
|
4
|
+
import type { Batch } from '../common';
|
|
5
|
+
/** A general table */
|
|
6
|
+
export interface Table {
|
|
7
|
+
shape: 'row-table' | 'array-row-table' | 'object-row-table' | 'columnar-table' | 'arrow-table';
|
|
8
|
+
schema?: Schema;
|
|
9
|
+
schemaType?: 'explicit' | 'deduced';
|
|
10
|
+
}
|
|
11
|
+
/** A table organized as an array of rows */
|
|
12
|
+
export interface RowTable extends Table {
|
|
13
|
+
shape: 'row-table' | 'array-row-table' | 'object-row-table';
|
|
14
|
+
data: any[];
|
|
15
|
+
}
|
|
16
|
+
/** A table organized as an array of rows, each row is an array of values */
|
|
17
|
+
export interface ArrayRowTable extends RowTable {
|
|
18
|
+
shape: 'array-row-table';
|
|
19
|
+
data: any[][];
|
|
20
|
+
}
|
|
21
|
+
/** A table organized as an array of rows, each row is an object mapping columns to values */
|
|
22
|
+
export interface ObjectRowTable extends RowTable {
|
|
23
|
+
shape: 'object-row-table';
|
|
24
|
+
data: {
|
|
25
|
+
[columnName: string]: any;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
/** A table organized as a map of columns, each column is an array of value */
|
|
29
|
+
export interface ColumnarTable extends Table {
|
|
30
|
+
shape: 'columnar-table';
|
|
31
|
+
data: {
|
|
32
|
+
[columnName: string]: AnyArray;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** A table organized as an Apache Arrow table */
|
|
36
|
+
export interface ArrowTable extends Table {
|
|
37
|
+
shape: 'arrow-table';
|
|
38
|
+
data: ApacheArrowTable;
|
|
39
|
+
}
|
|
40
|
+
/** Batch for a general table */
|
|
41
|
+
export declare type TableBatch = Batch & {
|
|
42
|
+
data: any;
|
|
43
|
+
length: number;
|
|
44
|
+
schema?: Schema;
|
|
45
|
+
schemaType?: 'explicit' | 'deduced';
|
|
46
|
+
};
|
|
47
|
+
/** Batch for a table organized as an array of rows */
|
|
48
|
+
export declare type RowTableBatch = TableBatch & {
|
|
49
|
+
shape: 'row-table';
|
|
50
|
+
data: any[];
|
|
51
|
+
};
|
|
52
|
+
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
53
|
+
export declare type RowArrayTableBatch = RowTableBatch & {
|
|
54
|
+
shape: 'array-row-table';
|
|
55
|
+
data: any[][];
|
|
56
|
+
};
|
|
57
|
+
/** Batch for a table organized as an array of rows, each row is an object mapping columns to values */
|
|
58
|
+
export declare type RowObjectTableBatch = RowTableBatch & {
|
|
59
|
+
shape: 'object-row-table';
|
|
60
|
+
data: {
|
|
61
|
+
[columnName: string]: any;
|
|
62
|
+
}[];
|
|
63
|
+
};
|
|
64
|
+
/** Batch for a table organized as a map of columns, each column is an array of value */
|
|
65
|
+
export declare type ColumnarTableBatch = TableBatch & {
|
|
66
|
+
shape: 'columnar-table';
|
|
67
|
+
data: {
|
|
68
|
+
[columnName: string]: AnyArray;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
/** Batch for a table organized as an Apache Arrow table */
|
|
72
|
+
export declare type ArrowTableBatch = TableBatch & {
|
|
73
|
+
shape: 'arrow-table';
|
|
74
|
+
data: RecordBatch;
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=table-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-types.d.ts","sourceRoot":"","sources":["../../../src/category/table/table-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,KAAK,IAAI,gBAAgB,EAAE,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACnF,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAErC,sBAAsB;AACtB,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,WAAW,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,aAAa,CAAC;IAC/F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACrC;AAED,4CAA4C;AAC5C,MAAM,WAAW,QAAS,SAAQ,KAAK;IACrC,KAAK,EAAE,WAAW,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;IAC5D,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED,4EAA4E;AAC5E,MAAM,WAAW,aAAc,SAAQ,QAAQ;IA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,kBAAkB,GAAG,UAAU,GAAG;IAC5C,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAC,CAAC;CACxC,CAAC;AAEF,2DAA2D;AAC3D,oBAAY,eAAe,GAAG,UAAU,GAAG;IACzC,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ImageType } from '../image/image';
|
|
2
|
+
/**
|
|
3
|
+
* These represent the main compressed texture formats
|
|
4
|
+
* Each format typically has a number of more specific subformats
|
|
5
|
+
*/
|
|
6
|
+
export declare type GPUTextureFormat = 'dxt' | 'dxt-srgb' | 'etc1' | 'etc2' | 'pvrtc' | 'atc' | 'astc' | 'rgtc';
|
|
7
|
+
/** One mip level */
|
|
8
|
+
export declare type TextureLevel = {
|
|
9
|
+
compressed: boolean;
|
|
10
|
+
format?: number;
|
|
11
|
+
data: Uint8Array;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
levelSize?: number;
|
|
15
|
+
hasAlpha?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type TextureOrImage = ImageType | (TextureLevel | ImageType);
|
|
18
|
+
//# sourceMappingURL=texture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture.d.ts","sourceRoot":"","sources":["../../../src/category/texture/texture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,oBAAY,gBAAgB,GACxB,KAAK,GACL,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,MAAM,CAAC;AAEX,oBAAoB;AACpB,oBAAY,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,oBAAY,cAAc,GAAG,SAAS,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"texture.js"}
|