@loaders.gl/schema 3.3.0-alpha.1 → 3.3.0-alpha.10
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/category/common.d.ts +3 -3
- package/dist/category/common.d.ts.map +1 -1
- package/dist/category/gis.d.ts +23 -23
- package/dist/category/gis.d.ts.map +1 -1
- package/dist/category/image/image.d.ts +3 -3
- package/dist/category/image/image.d.ts.map +1 -1
- package/dist/category/mesh/convert-mesh.d.ts +1 -1
- package/dist/category/mesh/convert-mesh.d.ts.map +1 -1
- package/dist/category/mesh/mesh-types.d.ts +4 -4
- package/dist/category/mesh/mesh-types.d.ts.map +1 -1
- package/dist/category/mesh/mesh-utils.d.ts +2 -2
- package/dist/category/mesh/mesh-utils.d.ts.map +1 -1
- package/dist/category/table/table-types.d.ts +8 -8
- package/dist/category/table/table-types.d.ts.map +1 -1
- package/dist/category/texture/texture.d.ts +3 -3
- package/dist/category/texture/texture.d.ts.map +1 -1
- package/dist/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/category/common.js.map +1 -1
- package/dist/es5/category/gis.js.map +1 -1
- package/dist/es5/category/image/image.js.map +1 -1
- package/dist/es5/category/mesh/convert-mesh.js +2 -12
- package/dist/es5/category/mesh/convert-mesh.js.map +1 -1
- package/dist/es5/category/mesh/deduce-mesh-schema.js +1 -10
- package/dist/es5/category/mesh/deduce-mesh-schema.js.map +1 -1
- package/dist/es5/category/mesh/mesh-to-arrow-table.js +2 -9
- package/dist/es5/category/mesh/mesh-to-arrow-table.js.map +1 -1
- package/dist/es5/category/mesh/mesh-types.js.map +1 -1
- package/dist/es5/category/mesh/mesh-utils.js +1 -6
- package/dist/es5/category/mesh/mesh-utils.js.map +1 -1
- package/dist/es5/category/table/deduce-table-schema.js +0 -11
- package/dist/es5/category/table/deduce-table-schema.js.map +1 -1
- package/dist/es5/category/table/table-types.js.map +1 -1
- package/dist/es5/category/texture/texture.js.map +1 -1
- package/dist/es5/index.js +100 -112
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/arrow/arrow-like-type-utils.js +0 -10
- package/dist/es5/lib/arrow/arrow-like-type-utils.js.map +1 -1
- package/dist/es5/lib/arrow/arrow-type-utils.js +0 -19
- package/dist/es5/lib/arrow/arrow-type-utils.js.map +1 -1
- package/dist/es5/lib/arrow/get-type-info.js +0 -6
- package/dist/es5/lib/arrow/get-type-info.js.map +1 -1
- package/dist/es5/lib/batches/base-table-batch-aggregator.js +0 -13
- package/dist/es5/lib/batches/base-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js +6 -23
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/batches/row-table-batch-aggregator.js +0 -13
- package/dist/es5/lib/batches/row-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/batches/table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/batches/table-batch-builder.js +21 -37
- package/dist/es5/lib/batches/table-batch-builder.js.map +1 -1
- package/dist/es5/lib/schema/impl/enum.js +0 -1
- package/dist/es5/lib/schema/impl/enum.js.map +1 -1
- package/dist/es5/lib/schema/impl/field.js +0 -7
- package/dist/es5/lib/schema/impl/field.js.map +1 -1
- package/dist/es5/lib/schema/impl/schema.js +6 -35
- package/dist/es5/lib/schema/impl/schema.js.map +1 -1
- package/dist/es5/lib/schema/impl/type.js +74 -248
- package/dist/es5/lib/schema/impl/type.js.map +1 -1
- package/dist/es5/lib/schema/schema.js +70 -74
- package/dist/es5/lib/schema/schema.js.map +1 -1
- package/dist/es5/lib/schema-utils/deduce-column-type.js +0 -3
- package/dist/es5/lib/schema-utils/deduce-column-type.js.map +1 -1
- package/dist/es5/lib/utils/assert.js +0 -1
- package/dist/es5/lib/utils/assert.js.map +1 -1
- package/dist/es5/lib/utils/async-queue.js +10 -50
- package/dist/es5/lib/utils/async-queue.js.map +1 -1
- package/dist/es5/lib/utils/row-utils.js +1 -10
- package/dist/es5/lib/utils/row-utils.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/category/common.js.map +1 -1
- package/dist/esm/category/gis.js.map +1 -1
- package/dist/esm/category/image/image.js.map +1 -1
- package/dist/esm/category/mesh/convert-mesh.js +1 -5
- package/dist/esm/category/mesh/convert-mesh.js.map +1 -1
- package/dist/esm/category/mesh/deduce-mesh-schema.js +2 -6
- package/dist/esm/category/mesh/deduce-mesh-schema.js.map +1 -1
- package/dist/esm/category/mesh/mesh-to-arrow-table.js +1 -3
- package/dist/esm/category/mesh/mesh-to-arrow-table.js.map +1 -1
- package/dist/esm/category/mesh/mesh-types.js.map +1 -1
- package/dist/esm/category/mesh/mesh-utils.js +3 -5
- package/dist/esm/category/mesh/mesh-utils.js.map +1 -1
- package/dist/esm/category/table/deduce-table-schema.js +2 -11
- package/dist/esm/category/table/deduce-table-schema.js.map +1 -1
- package/dist/esm/category/table/table-types.js.map +1 -1
- package/dist/esm/category/texture/texture.js.map +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/arrow/arrow-like-type-utils.js +0 -8
- package/dist/esm/lib/arrow/arrow-like-type-utils.js.map +1 -1
- package/dist/esm/lib/arrow/arrow-type-utils.js +0 -16
- package/dist/esm/lib/arrow/arrow-type-utils.js.map +1 -1
- package/dist/esm/lib/arrow/get-type-info.js +0 -3
- package/dist/esm/lib/arrow/get-type-info.js.map +1 -1
- package/dist/esm/lib/batches/base-table-batch-aggregator.js +0 -16
- package/dist/esm/lib/batches/base-table-batch-aggregator.js.map +1 -1
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js +0 -20
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js.map +1 -1
- package/dist/esm/lib/batches/row-table-batch-aggregator.js +0 -17
- package/dist/esm/lib/batches/row-table-batch-aggregator.js.map +1 -1
- package/dist/esm/lib/batches/table-batch-aggregator.js.map +1 -1
- package/dist/esm/lib/batches/table-batch-builder.js +4 -35
- package/dist/esm/lib/batches/table-batch-builder.js.map +1 -1
- package/dist/esm/lib/schema/impl/enum.js +2 -1
- package/dist/esm/lib/schema/impl/enum.js.map +1 -1
- package/dist/esm/lib/schema/impl/field.js +3 -10
- package/dist/esm/lib/schema/impl/field.js.map +1 -1
- package/dist/esm/lib/schema/impl/schema.js +9 -20
- package/dist/esm/lib/schema/impl/schema.js.map +1 -1
- package/dist/esm/lib/schema/impl/type.js +19 -113
- package/dist/esm/lib/schema/impl/type.js.map +1 -1
- package/dist/esm/lib/schema/schema.js +3 -1
- package/dist/esm/lib/schema/schema.js.map +1 -1
- package/dist/esm/lib/schema-utils/deduce-column-type.js +2 -2
- package/dist/esm/lib/schema-utils/deduce-column-type.js.map +1 -1
- package/dist/esm/lib/utils/assert.js +1 -0
- package/dist/esm/lib/utils/assert.js.map +1 -1
- package/dist/esm/lib/utils/async-queue.js +3 -25
- package/dist/esm/lib/utils/async-queue.js.map +1 -1
- package/dist/esm/lib/utils/row-utils.js +2 -8
- package/dist/esm/lib/utils/row-utils.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts +1 -1
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts.map +1 -1
- package/dist/lib/batches/table-batch-builder.d.ts +2 -2
- package/dist/lib/batches/table-batch-builder.d.ts.map +1 -1
- package/dist/lib/schema/impl/schema.d.ts +1 -1
- package/dist/lib/schema/impl/schema.d.ts.map +1 -1
- package/dist/lib/schema/impl/type.d.ts +4 -4
- package/dist/lib/schema/impl/type.d.ts.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { RecordBatch } from 'apache-arrow';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type Field = any;
|
|
3
|
+
export type Schema = {
|
|
4
4
|
[key: string]: Field;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type Batch = {
|
|
7
7
|
batchType: 'data' | 'metadata' | 'partial-result' | 'final-result';
|
|
8
8
|
mimeType?: string;
|
|
9
9
|
shape: string;
|
|
@@ -1 +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,
|
|
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,MAAM,MAAM,KAAK,GAAG,GAAG,CAAC;AAExB,MAAM,MAAM,MAAM,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,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"}
|
package/dist/category/gis.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { TypedArray } from '../types';
|
|
|
2
2
|
import type { Feature, Geometry, Point, LineString, Polygon } from 'geojson';
|
|
3
3
|
export type { GeoJSON, Feature, FeatureCollection, Geometry, Position, GeoJsonProperties } from 'geojson';
|
|
4
4
|
export type { Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection } from 'geojson';
|
|
5
|
-
export
|
|
5
|
+
export type GeojsonGeometryInfo = {
|
|
6
6
|
coordLength: number;
|
|
7
7
|
pointPositionsCount: number;
|
|
8
8
|
pointFeaturesCount: number;
|
|
@@ -14,84 +14,84 @@ export declare type GeojsonGeometryInfo = {
|
|
|
14
14
|
polygonRingsCount: number;
|
|
15
15
|
polygonFeaturesCount: number;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
|
|
17
|
+
export type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
18
|
+
type RemoveCoordinatesField<Type> = {
|
|
19
19
|
[Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Generic flat geometry data storage type
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type FlatIndexedGeometry = {
|
|
25
25
|
data: number[];
|
|
26
26
|
indices: number[];
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices`
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
31
|
+
export type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;
|
|
32
32
|
/**
|
|
33
33
|
* GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices`
|
|
34
34
|
*/
|
|
35
|
-
export
|
|
35
|
+
export type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;
|
|
36
36
|
/**
|
|
37
37
|
* GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices`
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type FlatPolygon = RemoveCoordinatesField<Polygon> & {
|
|
40
40
|
data: number[];
|
|
41
41
|
indices: number[][];
|
|
42
42
|
areas: number[][];
|
|
43
43
|
};
|
|
44
|
-
export
|
|
45
|
-
|
|
44
|
+
export type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;
|
|
45
|
+
type FlattenGeometry<Type> = {
|
|
46
46
|
[Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* GeoJSON Feature with Geometry replaced by FlatGeometry
|
|
50
50
|
*/
|
|
51
|
-
export
|
|
52
|
-
export
|
|
51
|
+
export type FlatFeature = FlattenGeometry<Feature>;
|
|
52
|
+
export type BinaryAttribute = {
|
|
53
53
|
value: TypedArray;
|
|
54
54
|
size: number;
|
|
55
55
|
};
|
|
56
|
-
export
|
|
57
|
-
|
|
56
|
+
export type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
57
|
+
type NumericProps = {
|
|
58
58
|
[key: string]: BinaryAttribute;
|
|
59
59
|
};
|
|
60
|
-
|
|
60
|
+
type Properties = object[];
|
|
61
61
|
/**
|
|
62
62
|
* Represent a single Geometry, similar to a GeoJSON Geometry
|
|
63
63
|
*/
|
|
64
|
-
export
|
|
65
|
-
export
|
|
64
|
+
export type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;
|
|
65
|
+
export type BinaryPointGeometry = {
|
|
66
66
|
type: 'Point';
|
|
67
67
|
positions: BinaryAttribute;
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type BinaryLineGeometry = {
|
|
70
70
|
type: 'LineString';
|
|
71
71
|
positions: BinaryAttribute;
|
|
72
72
|
pathIndices: BinaryAttribute;
|
|
73
73
|
};
|
|
74
|
-
export
|
|
74
|
+
export type BinaryPolygonGeometry = {
|
|
75
75
|
type: 'Polygon';
|
|
76
76
|
positions: BinaryAttribute;
|
|
77
77
|
polygonIndices: BinaryAttribute;
|
|
78
78
|
primitivePolygonIndices: BinaryAttribute;
|
|
79
79
|
triangles?: BinaryAttribute;
|
|
80
80
|
};
|
|
81
|
-
export
|
|
81
|
+
export type BinaryProperties = {
|
|
82
82
|
featureIds: BinaryAttribute;
|
|
83
83
|
globalFeatureIds: BinaryAttribute;
|
|
84
84
|
numericProps: NumericProps;
|
|
85
85
|
properties: Properties;
|
|
86
86
|
fields?: Properties;
|
|
87
87
|
};
|
|
88
|
-
export
|
|
89
|
-
export
|
|
90
|
-
export
|
|
88
|
+
export type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;
|
|
89
|
+
export type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;
|
|
90
|
+
export type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;
|
|
91
91
|
/**
|
|
92
92
|
* Represent a collection of Features, similar to a GeoJSON FeatureCollection
|
|
93
93
|
*/
|
|
94
|
-
export
|
|
94
|
+
export type BinaryFeatures = {
|
|
95
95
|
points?: BinaryPointFeatures;
|
|
96
96
|
lines?: BinaryLineFeatures;
|
|
97
97
|
polygons?: BinaryPolygonFeatures;
|
|
@@ -1 +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,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAGjB,
|
|
1
|
+
{"version":3,"file":"gis.d.ts","sourceRoot":"","sources":["../../src/category/gis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;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E,eAAe,CAAC;IAC3B,cAAc,EAAE,eAAe,CAAC;IAChC,uBAAuB,EAAE,eAAe,CAAC;IACzC,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,gBAAgB,EAAE,eAAe,CAAC;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AACzE,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;AACvE,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,gBAAgB,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* data images
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type ImageDataType = {
|
|
5
5
|
data: Uint8Array;
|
|
6
6
|
width: number;
|
|
7
7
|
height: number;
|
|
@@ -10,9 +10,9 @@ export declare type ImageDataType = {
|
|
|
10
10
|
/**
|
|
11
11
|
* Supported Image Types
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type ImageType = ImageBitmap | typeof Image | ImageDataType;
|
|
14
14
|
/**
|
|
15
15
|
* Image type string used to control or determine the type of images returned from ImageLoader
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type ImageTypeEnum = 'imagebitmap' | 'image' | 'data';
|
|
18
18
|
//# sourceMappingURL=image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/category/image/image.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/category/image/image.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,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,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,OAAO,KAAK,GAAG,aAAa,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Mesh } from './mesh-types';
|
|
2
2
|
import type { ColumnarTable, ArrowTable } from '../table/table-types';
|
|
3
|
-
|
|
3
|
+
type TargetShape = 'mesh' | 'columnar-table' | 'arrow-table';
|
|
4
4
|
/**
|
|
5
5
|
* Convert a mesh to a specific shape
|
|
6
6
|
*/
|
|
@@ -1 +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,
|
|
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,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"}
|
|
@@ -12,7 +12,7 @@ export interface MeshArrowTable extends ArrowTable {
|
|
|
12
12
|
indices?: MeshAttribute;
|
|
13
13
|
}
|
|
14
14
|
/** Geometry part of a Mesh (compatible with a standard luma.gl "mesh") */
|
|
15
|
-
export
|
|
15
|
+
export type MeshGeometry = {
|
|
16
16
|
attributes: {
|
|
17
17
|
[attributeName: string]: MeshAttribute;
|
|
18
18
|
};
|
|
@@ -21,7 +21,7 @@ export declare type MeshGeometry = {
|
|
|
21
21
|
mode: number;
|
|
22
22
|
};
|
|
23
23
|
/** Geometry and metadata for a Mesh (compatible with a standard luma.gl "mesh") */
|
|
24
|
-
export
|
|
24
|
+
export type Mesh = MeshGeometry & {
|
|
25
25
|
loader?: string;
|
|
26
26
|
loaderData?: {
|
|
27
27
|
[key: string]: any;
|
|
@@ -36,7 +36,7 @@ export declare type Mesh = MeshGeometry & {
|
|
|
36
36
|
* luma.gl compatible attribute descriptors
|
|
37
37
|
* Can be mapped to any WebGL framework
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type MeshAttribute = {
|
|
40
40
|
value: TypedArray;
|
|
41
41
|
size: number;
|
|
42
42
|
byteOffset?: number;
|
|
@@ -44,7 +44,7 @@ export declare type MeshAttribute = {
|
|
|
44
44
|
normalized?: boolean;
|
|
45
45
|
};
|
|
46
46
|
/** A map of mesh attributes keyed by attribute names */
|
|
47
|
-
export
|
|
47
|
+
export type MeshAttributes = {
|
|
48
48
|
[attributeName: string]: MeshAttribute;
|
|
49
49
|
};
|
|
50
50
|
//# sourceMappingURL=mesh-types.d.ts.map
|
|
@@ -1 +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,
|
|
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,MAAM,MAAM,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,MAAM,MAAM,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,MAAM,MAAM,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,MAAM,MAAM,cAAc,GAAG;IAAC,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAA;CAAC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TypedArray } from '../../types';
|
|
2
2
|
import { MeshAttributes } from './mesh-types';
|
|
3
|
-
|
|
3
|
+
type TypedArrays = {
|
|
4
4
|
[key: string]: TypedArray;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* Holds an axis aligned bounding box
|
|
8
8
|
* TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
type BoundingBox = [[number, number, number], [number, number, number]];
|
|
11
11
|
/**
|
|
12
12
|
* Get number of vertices in mesh
|
|
13
13
|
* @param attributes
|
|
@@ -1 +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,
|
|
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,KAAK,WAAW,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAC,CAAC;AAE/C;;;GAGG;AACH,KAAK,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"}
|
|
@@ -44,7 +44,7 @@ export interface ArrowTable extends Table {
|
|
|
44
44
|
data: ApacheArrowTable;
|
|
45
45
|
}
|
|
46
46
|
/** A collection of tables */
|
|
47
|
-
export
|
|
47
|
+
export type Tables<TableType extends Table = Table> = {
|
|
48
48
|
shape: 'tables';
|
|
49
49
|
tables: {
|
|
50
50
|
name: string;
|
|
@@ -52,43 +52,43 @@ export declare type Tables<TableType extends Table = Table> = {
|
|
|
52
52
|
}[];
|
|
53
53
|
};
|
|
54
54
|
/** Batch for a general table */
|
|
55
|
-
export
|
|
55
|
+
export type TableBatch = Batch & {
|
|
56
56
|
data: any;
|
|
57
57
|
length: number;
|
|
58
58
|
schema?: Schema;
|
|
59
59
|
schemaType?: 'explicit' | 'deduced';
|
|
60
60
|
};
|
|
61
61
|
/** Batch for a table organized as an array of rows */
|
|
62
|
-
export
|
|
62
|
+
export type RowTableBatch = TableBatch & {
|
|
63
63
|
shape: 'row-table';
|
|
64
64
|
data: any[];
|
|
65
65
|
};
|
|
66
66
|
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
67
|
-
export
|
|
67
|
+
export type RowArrayTableBatch = RowTableBatch & {
|
|
68
68
|
shape: 'array-row-table';
|
|
69
69
|
data: any[][];
|
|
70
70
|
};
|
|
71
71
|
/** Batch for a table organized as an array of rows, each row is an object mapping columns to values */
|
|
72
|
-
export
|
|
72
|
+
export type RowObjectTableBatch = RowTableBatch & {
|
|
73
73
|
shape: 'object-row-table';
|
|
74
74
|
data: {
|
|
75
75
|
[columnName: string]: any;
|
|
76
76
|
}[];
|
|
77
77
|
};
|
|
78
78
|
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
79
|
-
export
|
|
79
|
+
export type GeoJSONRowTableBatch = RowTableBatch & {
|
|
80
80
|
shape: 'geojson-row-table';
|
|
81
81
|
data: Feature[];
|
|
82
82
|
};
|
|
83
83
|
/** Batch for a table organized as a map of columns, each column is an array of value */
|
|
84
|
-
export
|
|
84
|
+
export type ColumnarTableBatch = TableBatch & {
|
|
85
85
|
shape: 'columnar-table';
|
|
86
86
|
data: {
|
|
87
87
|
[columnName: string]: AnyArray;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
/** Batch for a table organized as an Apache Arrow table */
|
|
91
|
-
export
|
|
91
|
+
export type ArrowTableBatch = TableBatch & {
|
|
92
92
|
shape: 'arrow-table';
|
|
93
93
|
data: RecordBatch;
|
|
94
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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C;IACzB,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;CACf,CAAC;AAEF,uGAAuG;AACvG,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,KAAK,EAAE,kBAAkB,CAAC;IAC1B,IAAI,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,EAAE,CAAC;CACrC,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD,KAAK,EAAE,mBAAmB,CAAC;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB,CAAC;AAEF,wFAAwF;AACxF,MAAM,MAAM,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,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG;IACzC,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC"}
|
|
@@ -3,9 +3,9 @@ import type { ImageType } from '../image/image';
|
|
|
3
3
|
* These represent the main compressed texture formats
|
|
4
4
|
* Each format typically has a number of more specific subformats
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type GPUTextureFormat = 'dxt' | 'dxt-srgb' | 'etc1' | 'etc2' | 'pvrtc' | 'atc' | 'astc' | 'rgtc';
|
|
7
7
|
/** One mip level */
|
|
8
|
-
export
|
|
8
|
+
export type TextureLevel = {
|
|
9
9
|
compressed: boolean;
|
|
10
10
|
format?: number;
|
|
11
11
|
data: Uint8Array;
|
|
@@ -14,5 +14,5 @@ export declare type TextureLevel = {
|
|
|
14
14
|
levelSize?: number;
|
|
15
15
|
hasAlpha?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type TextureOrImage = ImageType | (TextureLevel | ImageType);
|
|
18
18
|
//# sourceMappingURL=texture.d.ts.map
|
|
@@ -1 +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,
|
|
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,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"}
|
package/dist/es5/bundle.js
CHANGED
package/dist/es5/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":";;AACA,IAAMA,aAAa,GAAGC,OAAO,CAAC,SAAS,CAAC;AACxCC,UAAU,CAACC,OAAO,GAAGD,UAAU,CAACC,OAAO,IAAI,CAAC,CAAC;AAC7CC,MAAM,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACL,UAAU,CAACC,OAAO,EAAEH,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"common.js","names":[],"sources":["../../../src/category/common.ts"],"sourcesContent":["import type {RecordBatch} from 'apache-arrow';\n\nexport type Field = any;\n\nexport type Schema = {\n [key: string]: Field;\n};\n\nexport type Batch = {\n batchType: 'data' | 'metadata' | 'partial-result' | 'final-result';\n mimeType?: string;\n shape: string;\n data: any;\n recordBatch?: RecordBatch;\n length: number;\n schema?: Schema;\n bytesUsed?: number;\n count?: number;\n cursor?: number;\n [key: string]: any;\n};\n\n/*\nexport type Batch = {\n bytesUsed?: number;\n count?: number;\n cursor?: number;\n [key: string]: any;\n}\n*/\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"gis.js","names":[],"sources":["../../../src/category/gis.ts"],"sourcesContent":["// GIS\nimport type {TypedArray} from '../types';\nimport type {Feature, Geometry, Point, LineString, Polygon} from 'geojson';\n\n// GEOJSON FORMAT GEOMETRY\n\n// eslint-disable-next-line import/no-unresolved\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties\n} from 'geojson';\n// eslint-disable-next-line import/no-unresolved\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from 'geojson';\n\n// Aggregate information for converting GeoJSON into other formats\nexport type GeojsonGeometryInfo = {\n coordLength: number;\n pointPositionsCount: number;\n pointFeaturesCount: number;\n linePositionsCount: number;\n linePathsCount: number;\n lineFeaturesCount: number;\n polygonPositionsCount: number;\n polygonObjectsCount: number;\n polygonRingsCount: number;\n polygonFeaturesCount: number;\n};\n\n// FLAT GEOJSON FORMAT GEOMETRY\nexport type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';\ntype RemoveCoordinatesField<Type> = {\n [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];\n};\n\n/**\n * Generic flat geometry data storage type\n */\nexport type FlatIndexedGeometry = {\n data: number[];\n indices: number[];\n};\n\n/**\n * GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices`\n */\nexport type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;\n\n/**\n * GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices`\n */\nexport type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;\n\n/**\n * GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices`\n */\nexport type FlatPolygon = RemoveCoordinatesField<Polygon> & {\n data: number[];\n indices: number[][];\n areas: number[][];\n};\n\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/**\n * GeoJSON Feature with Geometry replaced by FlatGeometry\n */\nexport type FlatFeature = FlattenGeometry<Feature>;\n\n// BINARY FORMAT GEOMETRY\n\nexport type BinaryAttribute = {value: TypedArray; size: number};\nexport type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype NumericProps = {[key: string]: BinaryAttribute};\ntype Properties = object[];\n\n/**\n * Represent a single Geometry, similar to a GeoJSON Geometry\n */\nexport type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;\n\nexport type BinaryPointGeometry = {\n type: 'Point';\n positions: BinaryAttribute;\n};\n\nexport type BinaryLineGeometry = {\n type: 'LineString';\n positions: BinaryAttribute;\n pathIndices: BinaryAttribute;\n};\n\nexport type BinaryPolygonGeometry = {\n type: 'Polygon';\n positions: BinaryAttribute;\n polygonIndices: BinaryAttribute;\n primitivePolygonIndices: BinaryAttribute;\n triangles?: BinaryAttribute;\n};\n\nexport type BinaryProperties = {\n featureIds: BinaryAttribute;\n globalFeatureIds: BinaryAttribute;\n numericProps: NumericProps;\n properties: Properties;\n fields?: Properties;\n};\n\nexport type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;\nexport type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;\nexport type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;\n\n/**\n * Represent a collection of Features, similar to a GeoJSON FeatureCollection\n */\nexport type BinaryFeatures = {\n points?: BinaryPointFeatures;\n lines?: BinaryLineFeatures;\n polygons?: BinaryPolygonFeatures;\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"image.js","names":[],"sources":["../../../../src/category/image/image.ts"],"sourcesContent":["/**\n * data images\n */\nexport type ImageDataType = {\n data: Uint8Array;\n width: number;\n height: number;\n compressed?: boolean;\n};\n\n/**\n * Supported Image Types\n */\nexport type ImageType = ImageBitmap | typeof Image | ImageDataType;\n\n/**\n * Image type string used to control or determine the type of images returned from ImageLoader\n */\nexport type ImageTypeEnum = 'imagebitmap' | 'image' | 'data';\n"],"mappings":""}
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.convertMesh = convertMesh;
|
|
9
8
|
exports.convertMeshToColumnarTable = convertMeshToColumnarTable;
|
|
10
|
-
|
|
11
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
-
|
|
13
10
|
var _meshToArrowTable = require("./mesh-to-arrow-table");
|
|
14
|
-
|
|
15
11
|
function convertMesh(mesh, shape, options) {
|
|
16
12
|
switch (shape || 'mesh') {
|
|
17
13
|
case 'mesh':
|
|
18
14
|
return mesh;
|
|
19
|
-
|
|
20
15
|
case 'columnar-table':
|
|
21
16
|
return convertMeshToColumnarTable(mesh);
|
|
22
|
-
|
|
23
17
|
case 'arrow-table':
|
|
24
18
|
return {
|
|
25
19
|
shape: 'arrow-table',
|
|
26
20
|
data: (0, _meshToArrowTable.convertMeshToArrowTable)(mesh)
|
|
27
21
|
};
|
|
28
|
-
|
|
29
22
|
default:
|
|
30
23
|
throw new Error("Unsupported shape ".concat(options === null || options === void 0 ? void 0 : options.shape));
|
|
31
24
|
}
|
|
@@ -33,15 +26,12 @@ function convertMesh(mesh, shape, options) {
|
|
|
33
26
|
|
|
34
27
|
function convertMeshToColumnarTable(mesh) {
|
|
35
28
|
var columns = {};
|
|
36
|
-
|
|
37
29
|
for (var _i = 0, _Object$entries = Object.entries(mesh.attributes); _i < _Object$entries.length; _i++) {
|
|
38
30
|
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
columnName = _Object$entries$_i[0],
|
|
32
|
+
attribute = _Object$entries$_i[1];
|
|
42
33
|
columns[columnName] = attribute.value;
|
|
43
34
|
}
|
|
44
|
-
|
|
45
35
|
return {
|
|
46
36
|
shape: 'columnar-table',
|
|
47
37
|
schema: mesh.schema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"convert-mesh.js","names":["convertMesh","mesh","shape","options","convertMeshToColumnarTable","data","convertMeshToArrowTable","Error","columns","Object","entries","attributes","columnName","attribute","value","schema"],"sources":["../../../../src/category/mesh/convert-mesh.ts"],"sourcesContent":["import type {Mesh} from './mesh-types';\nimport type {ColumnarTable, ArrowTable} from '../table/table-types';\nimport {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":";;;;;;;;;AAEA;AAOO,SAASA,WAAW,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;IACzC,KAAK,aAAa;MAChB,OAAO;QACLC,KAAK,EAAE,aAAa;QACpBG,IAAI,EAAE,IAAAC,yCAAuB,EAACL,IAAI;MACpC,CAAC;IACH;MACE,MAAM,IAAIM,KAAK,6BAAsBJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAED,KAAK,EAAG;EAAC;AAE7D;;AAOO,SAASE,0BAA0B,CAACH,IAAU,EAAiB;EACpE,IAAMO,OAAO,GAAG,CAAC,CAAC;EAElB,mCAAsCC,MAAM,CAACC,OAAO,CAACT,IAAI,CAACU,UAAU,CAAC,qCAAE;IAAlE;MAAOC,UAAU;MAAEC,SAAS;IAC/BL,OAAO,CAACI,UAAU,CAAC,GAAGC,SAAS,CAACC,KAAK;EACvC;EAEA,OAAO;IACLZ,KAAK,EAAE,gBAAgB;IACvBa,MAAM,EAAEd,IAAI,CAACc,MAAM;IACnBV,IAAI,EAAEG;EACR,CAAC;AACH"}
|
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.deduceMeshSchema = deduceMeshSchema;
|
|
7
6
|
exports.deduceMeshField = deduceMeshField;
|
|
7
|
+
exports.deduceMeshSchema = deduceMeshSchema;
|
|
8
8
|
exports.makeMeshAttributeMetadata = makeMeshAttributeMetadata;
|
|
9
|
-
|
|
10
9
|
var _schema = require("../../lib/schema/schema");
|
|
11
|
-
|
|
12
10
|
var _arrowLikeTypeUtils = require("../../lib/arrow/arrow-like-type-utils");
|
|
13
|
-
|
|
14
11
|
function deduceMeshSchema(attributes, metadata) {
|
|
15
12
|
var fields = deduceMeshFields(attributes);
|
|
16
13
|
return new _schema.Schema(fields, metadata);
|
|
@@ -25,30 +22,24 @@ function deduceMeshField(attributeName, attribute, optionalMetadata) {
|
|
|
25
22
|
|
|
26
23
|
function deduceMeshFields(attributes) {
|
|
27
24
|
var fields = [];
|
|
28
|
-
|
|
29
25
|
for (var attributeName in attributes) {
|
|
30
26
|
var attribute = attributes[attributeName];
|
|
31
27
|
fields.push(deduceMeshField(attributeName, attribute));
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
return fields;
|
|
35
30
|
}
|
|
36
31
|
|
|
37
32
|
function makeMeshAttributeMetadata(attribute) {
|
|
38
33
|
var result = new Map();
|
|
39
|
-
|
|
40
34
|
if ('byteOffset' in attribute) {
|
|
41
35
|
result.set('byteOffset', attribute.byteOffset.toString(10));
|
|
42
36
|
}
|
|
43
|
-
|
|
44
37
|
if ('byteStride' in attribute) {
|
|
45
38
|
result.set('byteStride', attribute.byteStride.toString(10));
|
|
46
39
|
}
|
|
47
|
-
|
|
48
40
|
if ('normalized' in attribute) {
|
|
49
41
|
result.set('normalized', attribute.normalized.toString());
|
|
50
42
|
}
|
|
51
|
-
|
|
52
43
|
return result;
|
|
53
44
|
}
|
|
54
45
|
//# sourceMappingURL=deduce-mesh-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"deduce-mesh-schema.js","names":["deduceMeshSchema","attributes","metadata","fields","deduceMeshFields","Schema","deduceMeshField","attributeName","attribute","optionalMetadata","type","getArrowTypeFromTypedArray","value","makeMeshAttributeMetadata","field","Field","FixedSizeList","size","push","result","Map","set","byteOffset","toString","byteStride","normalized"],"sources":["../../../../src/category/mesh/deduce-mesh-schema.ts"],"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"],"mappings":";;;;;;;;AACA;AACA;AAQO,SAASA,gBAAgB,CAC9BC,UAA0B,EAC1BC,QAA8B,EACtB;EACR,IAAMC,MAAM,GAAGC,gBAAgB,CAACH,UAAU,CAAC;EAC3C,OAAO,IAAII,cAAM,CAACF,MAAM,EAAED,QAAQ,CAAC;AACrC;;AASO,SAASI,eAAe,CAC7BC,aAAqB,EACrBC,SAAwB,EACxBC,gBAAsC,EAC/B;EACP,IAAMC,IAAI,GAAG,IAAAC,8CAA0B,EAACH,SAAS,CAACI,KAAK,CAAC;EACxD,IAAMV,QAAQ,GAAGO,gBAAgB,GAAGA,gBAAgB,GAAGI,yBAAyB,CAACL,SAAS,CAAC;EAC3F,IAAMM,KAAK,GAAG,IAAIC,aAAK,CACrBR,aAAa,EACb,IAAIS,qBAAa,CAACR,SAAS,CAACS,IAAI,EAAE,IAAIF,aAAK,CAAC,OAAO,EAAEL,IAAI,CAAC,CAAC,EAC3D,KAAK,EACLR,QAAQ,CACT;EACD,OAAOY,KAAK;AACd;;AAOA,SAASV,gBAAgB,CAACH,UAA0B,EAAW;EAC7D,IAAME,MAAe,GAAG,EAAE;EAC1B,KAAK,IAAMI,aAAa,IAAIN,UAAU,EAAE;IACtC,IAAMO,SAAwB,GAAGP,UAAU,CAACM,aAAa,CAAC;IAC1DJ,MAAM,CAACe,IAAI,CAACZ,eAAe,CAACC,aAAa,EAAEC,SAAS,CAAC,CAAC;EACxD;EACA,OAAOL,MAAM;AACf;;AAOO,SAASU,yBAAyB,CAACL,SAAwB,EAAuB;EACvF,IAAMW,MAAM,GAAG,IAAIC,GAAG,EAAE;EACxB,IAAI,YAAY,IAAIZ,SAAS,EAAE;IAC7BW,MAAM,CAACE,GAAG,CAAC,YAAY,EAAEb,SAAS,CAACc,UAAU,CAAEC,QAAQ,CAAC,EAAE,CAAC,CAAC;EAC9D;EACA,IAAI,YAAY,IAAIf,SAAS,EAAE;IAC7BW,MAAM,CAACE,GAAG,CAAC,YAAY,EAAEb,SAAS,CAACgB,UAAU,CAAED,QAAQ,CAAC,EAAE,CAAC,CAAC;EAC9D;EACA,IAAI,YAAY,IAAIf,SAAS,EAAE;IAC7BW,MAAM,CAACE,GAAG,CAAC,YAAY,EAAEb,SAAS,CAACiB,UAAU,CAAEF,QAAQ,EAAE,CAAC;EAC5D;EACA,OAAOJ,MAAM;AACf"}
|
|
@@ -4,24 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.convertMeshToArrowTable = convertMeshToArrowTable;
|
|
7
|
-
|
|
8
7
|
var _Arrow = require("apache-arrow/Arrow.dom");
|
|
9
|
-
|
|
10
8
|
var _arrowTypeUtils = require("../../lib/arrow/arrow-type-utils");
|
|
11
|
-
|
|
12
9
|
var _deduceMeshSchema = require("./deduce-mesh-schema");
|
|
13
|
-
|
|
14
10
|
function convertMeshToArrowTable(mesh, batchSize) {
|
|
15
11
|
var _mesh$schema;
|
|
16
|
-
|
|
17
12
|
var vectors = [];
|
|
18
13
|
var fields = [];
|
|
19
|
-
|
|
20
14
|
for (var attributeKey in mesh.attributes) {
|
|
21
15
|
var attribute = mesh.attributes[attributeKey];
|
|
22
16
|
var value = attribute.value,
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
_attribute$size = attribute.size,
|
|
18
|
+
size = _attribute$size === void 0 ? 1 : _attribute$size;
|
|
25
19
|
var type = (0, _arrowTypeUtils.getArrowType)(value);
|
|
26
20
|
var vector = (0, _arrowTypeUtils.getArrowVector)(value);
|
|
27
21
|
var listType = new _Arrow.FixedSizeList(size, new _Arrow.Field('value', type));
|
|
@@ -31,7 +25,6 @@ function convertMeshToArrowTable(mesh, batchSize) {
|
|
|
31
25
|
vectors.push(listVector);
|
|
32
26
|
fields.push(field);
|
|
33
27
|
}
|
|
34
|
-
|
|
35
28
|
var schema = new _Arrow.Schema(fields, (mesh === null || mesh === void 0 ? void 0 : (_mesh$schema = mesh.schema) === null || _mesh$schema === void 0 ? void 0 : _mesh$schema.metadata) || new Map());
|
|
36
29
|
var recordBatch = new _Arrow.RecordBatch(schema, vectors[0].length, vectors);
|
|
37
30
|
var table = new _Arrow.Table(schema, recordBatch);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"mesh-to-arrow-table.js","names":["convertMeshToArrowTable","mesh","batchSize","vectors","fields","attributeKey","attributes","attribute","value","size","type","getArrowType","vector","getArrowVector","listType","FixedSizeList","Field","field","makeMeshAttributeMetadata","data","Data","length","undefined","listVector","FixedSizeListVector","push","schema","Schema","metadata","Map","recordBatch","RecordBatch","table","Table"],"sources":["../../../../src/category/mesh/mesh-to-arrow-table.ts"],"sourcesContent":["import {\n Table,\n Schema,\n RecordBatch,\n FixedSizeList,\n Field,\n Data,\n FixedSizeListVector\n} from 'apache-arrow/Arrow.dom';\nimport {AbstractVector} from 'apache-arrow/vector';\nimport {getArrowType, getArrowVector} from '../../lib/arrow/arrow-type-utils';\nimport type {Mesh} from './mesh-types';\nimport {makeMeshAttributeMetadata} from './deduce-mesh-schema';\n\n/**\n * * Convert a loaders.gl Mesh to an Apache Arrow Table\n * @param mesh\n * @param metadata\n * @param batchSize\n * @returns\n */\nexport function convertMeshToArrowTable(mesh: Mesh, batchSize?: number): Table {\n const vectors: AbstractVector[] = [];\n const fields: Field[] = [];\n for (const attributeKey in mesh.attributes) {\n const attribute = mesh.attributes[attributeKey];\n const {value, size = 1} = attribute;\n const type = getArrowType(value);\n const vector = getArrowVector(value);\n const listType = new FixedSizeList(size, new Field('value', type));\n const field = new Field(attributeKey, listType, false, makeMeshAttributeMetadata(attribute));\n const data = new Data(listType, 0, value.length / size, 0, undefined, [vector]);\n const listVector = new FixedSizeListVector(data);\n vectors.push(listVector);\n fields.push(field);\n }\n const schema = new Schema(fields, mesh?.schema?.metadata || new Map<string, string>());\n const recordBatch = new RecordBatch(schema, vectors[0].length, vectors);\n const table = new Table(schema, recordBatch);\n return table;\n}\n"],"mappings":";;;;;;AAAA;AAUA;AAEA;AASO,SAASA,uBAAuB,CAACC,IAAU,EAAEC,SAAkB,EAAS;EAAA;EAC7E,IAAMC,OAAyB,GAAG,EAAE;EACpC,IAAMC,MAAe,GAAG,EAAE;EAC1B,KAAK,IAAMC,YAAY,IAAIJ,IAAI,CAACK,UAAU,EAAE;IAC1C,IAAMC,SAAS,GAAGN,IAAI,CAACK,UAAU,CAACD,YAAY,CAAC;IAC/C,IAAOG,KAAK,GAAcD,SAAS,CAA5BC,KAAK;MAAA,kBAAcD,SAAS,CAArBE,IAAI;MAAJA,IAAI,gCAAG,CAAC;IACtB,IAAMC,IAAI,GAAG,IAAAC,4BAAY,EAACH,KAAK,CAAC;IAChC,IAAMI,MAAM,GAAG,IAAAC,8BAAc,EAACL,KAAK,CAAC;IACpC,IAAMM,QAAQ,GAAG,IAAIC,oBAAa,CAACN,IAAI,EAAE,IAAIO,YAAK,CAAC,OAAO,EAAEN,IAAI,CAAC,CAAC;IAClE,IAAMO,KAAK,GAAG,IAAID,YAAK,CAACX,YAAY,EAAES,QAAQ,EAAE,KAAK,EAAE,IAAAI,2CAAyB,EAACX,SAAS,CAAC,CAAC;IAC5F,IAAMY,IAAI,GAAG,IAAIC,WAAI,CAACN,QAAQ,EAAE,CAAC,EAAEN,KAAK,CAACa,MAAM,GAAGZ,IAAI,EAAE,CAAC,EAAEa,SAAS,EAAE,CAACV,MAAM,CAAC,CAAC;IAC/E,IAAMW,UAAU,GAAG,IAAIC,0BAAmB,CAACL,IAAI,CAAC;IAChDhB,OAAO,CAACsB,IAAI,CAACF,UAAU,CAAC;IACxBnB,MAAM,CAACqB,IAAI,CAACR,KAAK,CAAC;EACpB;EACA,IAAMS,MAAM,GAAG,IAAIC,aAAM,CAACvB,MAAM,EAAE,CAAAH,IAAI,aAAJA,IAAI,uCAAJA,IAAI,CAAEyB,MAAM,iDAAZ,aAAcE,QAAQ,KAAI,IAAIC,GAAG,EAAkB,CAAC;EACtF,IAAMC,WAAW,GAAG,IAAIC,kBAAW,CAACL,MAAM,EAAEvB,OAAO,CAAC,CAAC,CAAC,CAACkB,MAAM,EAAElB,OAAO,CAAC;EACvE,IAAM6B,KAAK,GAAG,IAAIC,YAAK,CAACP,MAAM,EAAEI,WAAW,CAAC;EAC5C,OAAOE,KAAK;AACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"mesh-types.js","names":[],"sources":["../../../../src/category/mesh/mesh-types.ts"],"sourcesContent":["import type {Schema} from '../../lib/schema/schema';\nimport type {TypedArray} from '../../types';\nimport type {ColumnarTable, ArrowTable} from '../table/table-types';\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 = {[attributeName: string]: MeshAttribute};\n"],"mappings":""}
|