@loaders.gl/schema
Advanced tools
Comparing version 3.0.0-beta.8 to 3.0.0-beta.9
@@ -8,56 +8,68 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "Schema", { | ||
Object.defineProperty(exports, "TableBatchBuilder", { | ||
enumerable: true, | ||
get: function get() { | ||
return _schema.default; | ||
return _tableBatchBuilder.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "Field", { | ||
Object.defineProperty(exports, "RowTableBatchAggregator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _field.default; | ||
return _rowTableBatchAggregator.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "deduceTableSchema", { | ||
Object.defineProperty(exports, "ColumnarTableBatchAggregator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _deduceTableSchema.deduceTableSchema; | ||
return _columnarTableBatchAggregator.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "getTypeInfo", { | ||
Object.defineProperty(exports, "convertToObjectRow", { | ||
enumerable: true, | ||
get: function get() { | ||
return _getTypeInfo.getTypeInfo; | ||
return _rowUtils.convertToObjectRow; | ||
} | ||
}); | ||
Object.defineProperty(exports, "TableBatchBuilder", { | ||
Object.defineProperty(exports, "convertToArrayRow", { | ||
enumerable: true, | ||
get: function get() { | ||
return _tableBatchBuilder.default; | ||
return _rowUtils.convertToArrayRow; | ||
} | ||
}); | ||
Object.defineProperty(exports, "RowTableBatchAggregator", { | ||
Object.defineProperty(exports, "getMeshSize", { | ||
enumerable: true, | ||
get: function get() { | ||
return _rowTableBatchAggregator.default; | ||
return _meshUtils.getMeshSize; | ||
} | ||
}); | ||
Object.defineProperty(exports, "ColumnarTableBatchAggregator", { | ||
Object.defineProperty(exports, "getMeshBoundingBox", { | ||
enumerable: true, | ||
get: function get() { | ||
return _columnarTableBatchAggregator.default; | ||
return _meshUtils.getMeshBoundingBox; | ||
} | ||
}); | ||
Object.defineProperty(exports, "convertToObjectRow", { | ||
Object.defineProperty(exports, "Schema", { | ||
enumerable: true, | ||
get: function get() { | ||
return _rowUtils.convertToObjectRow; | ||
return _schema.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "convertToArrayRow", { | ||
Object.defineProperty(exports, "Field", { | ||
enumerable: true, | ||
get: function get() { | ||
return _rowUtils.convertToArrayRow; | ||
return _field.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "deduceTableSchema", { | ||
enumerable: true, | ||
get: function get() { | ||
return _deduceTableSchema.deduceTableSchema; | ||
} | ||
}); | ||
Object.defineProperty(exports, "getTypeInfo", { | ||
enumerable: true, | ||
get: function get() { | ||
return _getTypeInfo.getTypeInfo; | ||
} | ||
}); | ||
Object.defineProperty(exports, "DataType", { | ||
@@ -274,2 +286,12 @@ enumerable: true, | ||
var _tableBatchBuilder = _interopRequireDefault(require("./lib/table/table-batch-builder")); | ||
var _rowTableBatchAggregator = _interopRequireDefault(require("./lib/table/row-table-batch-aggregator")); | ||
var _columnarTableBatchAggregator = _interopRequireDefault(require("./lib/table/columnar-table-batch-aggregator")); | ||
var _rowUtils = require("./lib/utils/row-utils"); | ||
var _meshUtils = require("./category/mesh/mesh-utils"); | ||
var _schema = _interopRequireDefault(require("./lib/schema/classes/schema")); | ||
@@ -283,10 +305,2 @@ | ||
var _tableBatchBuilder = _interopRequireDefault(require("./lib/table/table-batch-builder")); | ||
var _rowTableBatchAggregator = _interopRequireDefault(require("./lib/table/row-table-batch-aggregator")); | ||
var _columnarTableBatchAggregator = _interopRequireDefault(require("./lib/table/columnar-table-batch-aggregator")); | ||
var _rowUtils = require("./lib/utils/row-utils"); | ||
var _type = require("./lib/schema/classes/type"); | ||
@@ -293,0 +307,0 @@ |
@@ -78,3 +78,3 @@ "use strict"; | ||
var batch = { | ||
type: this.options.type, | ||
shape: this.options.shape, | ||
batchType: 'data', | ||
@@ -81,0 +81,0 @@ data: rows, |
@@ -77,3 +77,3 @@ "use strict"; | ||
var batch = { | ||
type: 'columnar-table', | ||
shape: 'columnar-table', | ||
batchType: 'data', | ||
@@ -80,0 +80,0 @@ data: columns, |
@@ -54,3 +54,3 @@ "use strict"; | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'object-row-table': | ||
@@ -75,3 +75,3 @@ var rowObject = (0, _rowUtils.convertToObjectRow)(row, this._headers); | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'array-row-table': | ||
@@ -102,3 +102,3 @@ var rowArray = (0, _rowUtils.convertToArrayRow)(row, this._headers); | ||
return { | ||
type: this.options.type, | ||
shape: this.options.shape, | ||
batchType: 'data', | ||
@@ -105,0 +105,0 @@ data: rows, |
@@ -27,3 +27,3 @@ "use strict"; | ||
var DEFAULT_OPTIONS = { | ||
type: 'array-row-table', | ||
shape: 'array-row-table', | ||
batchSize: 'auto', | ||
@@ -180,3 +180,3 @@ batchDebounceMs: 0, | ||
value: function _getTableBatchType() { | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'row-table': | ||
@@ -183,0 +183,0 @@ return _baseTableBatchAggregator.default; |
@@ -0,1 +1,6 @@ | ||
export { default as TableBatchBuilder } from './lib/table/table-batch-builder'; | ||
export { default as RowTableBatchAggregator } from './lib/table/row-table-batch-aggregator'; | ||
export { default as ColumnarTableBatchAggregator } from './lib/table/columnar-table-batch-aggregator'; | ||
export { convertToObjectRow, convertToArrayRow } from './lib/utils/row-utils'; | ||
export { getMeshSize, getMeshBoundingBox } from './category/mesh/mesh-utils'; | ||
export { default as Schema } from './lib/schema/classes/schema'; | ||
@@ -5,6 +10,2 @@ export { default as Field } from './lib/schema/classes/field'; | ||
export { getTypeInfo } from './lib/schema/get-type-info'; | ||
export { default as TableBatchBuilder } from './lib/table/table-batch-builder'; | ||
export { default as RowTableBatchAggregator } from './lib/table/row-table-batch-aggregator'; | ||
export { default as ColumnarTableBatchAggregator } from './lib/table/columnar-table-batch-aggregator'; | ||
export { convertToObjectRow, convertToArrayRow } from './lib/utils/row-utils'; | ||
export { DataType, Null, Binary, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Date, DateDay, DateMillisecond, Time, TimeMillisecond, TimeSecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList } from './lib/schema/classes/type'; | ||
@@ -11,0 +12,0 @@ export { getArrowTypeFromTypedArray } from './lib/utils/type-utils'; |
@@ -63,3 +63,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
const batch = { | ||
type: this.options.type, | ||
shape: this.options.shape, | ||
batchType: 'data', | ||
@@ -66,0 +66,0 @@ data: rows, |
@@ -58,3 +58,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
const batch = { | ||
type: 'columnar-table', | ||
shape: 'columnar-table', | ||
batchType: 'data', | ||
@@ -61,0 +61,0 @@ data: columns, |
@@ -41,3 +41,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'object-row-table': | ||
@@ -61,3 +61,3 @@ const rowObject = convertToObjectRow(row, this._headers); | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'array-row-table': | ||
@@ -87,3 +87,3 @@ const rowArray = convertToArrayRow(row, this._headers); | ||
return { | ||
type: this.options.type, | ||
shape: this.options.shape, | ||
batchType: 'data', | ||
@@ -90,0 +90,0 @@ data: rows, |
@@ -6,3 +6,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
const DEFAULT_OPTIONS = { | ||
type: 'array-row-table', | ||
shape: 'array-row-table', | ||
batchSize: 'auto', | ||
@@ -157,3 +157,3 @@ batchDebounceMs: 0, | ||
_getTableBatchType() { | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'row-table': | ||
@@ -160,0 +160,0 @@ return BaseTableBatchAggregator; |
{ | ||
"name": "@loaders.gl/schema", | ||
"version": "3.0.0-beta.8", | ||
"version": "3.0.0-beta.9", | ||
"description": "Table format APIs for JSON, CSV, etc...", | ||
@@ -30,11 +30,9 @@ "license": "MIT", | ||
], | ||
"scripts": { | ||
"pre-build-disabled": "npm run build-bundle", | ||
"build-bundle": "webpack --display=minimal --config ../../scripts/webpack/bundle.js" | ||
}, | ||
"scripts": {}, | ||
"dependencies": { | ||
"@types/geojson": "^7946.0.7", | ||
"apache-arrow": "^4.0.0", | ||
"d3-dsv": "^1.2.0" | ||
}, | ||
"gitHead": "b5b361c4a7fbf21dabaa4522d07e5917f1f4213a" | ||
"gitHead": "289c77d5a48838c998add4f02836fe5a12602956" | ||
} |
@@ -10,3 +10,3 @@ import type {RecordBatch} from 'apache-arrow'; | ||
export type Batch = { | ||
type: string; | ||
shape: string; | ||
batchType: 'data' | 'metadata' | 'partial-result' | 'final-result'; | ||
@@ -13,0 +13,0 @@ data: any; |
@@ -6,3 +6,3 @@ import type {TypedArray} from './types/types'; | ||
export interface MeshTable extends ColumnarTable { | ||
// type: 'mesh-table'; | ||
// shape: 'mesh-table'; | ||
topology: 'point-list' | 'triangle-list' | 'triangle-strip'; | ||
@@ -14,3 +14,3 @@ indices?: MeshAttribute; | ||
export interface MeshArrowTable extends ArrowTable { | ||
// type: 'mesh-arrow-table'; | ||
// shape: 'mesh-arrow-table'; | ||
topology: 'point-list' | 'triangle-list' | 'triangle-strip'; | ||
@@ -17,0 +17,0 @@ indices?: MeshAttribute; |
@@ -8,3 +8,3 @@ import type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow'; | ||
export interface Table { | ||
type: 'row-table' | 'array-row-table' | 'object-row-table' | 'columnar-table' | 'arrow-table'; | ||
shape: 'row-table' | 'array-row-table' | 'object-row-table' | 'columnar-table' | 'arrow-table'; | ||
schema?: Schema; | ||
@@ -16,3 +16,3 @@ schemaType?: 'explicit' | 'deduced'; | ||
export interface RowTable extends Table { | ||
type: 'row-table' | 'array-row-table' | 'object-row-table'; | ||
shape: 'row-table' | 'array-row-table' | 'object-row-table'; | ||
data: any[]; | ||
@@ -23,3 +23,3 @@ } | ||
export interface ArrayRowTable extends RowTable { | ||
type: 'array-row-table'; | ||
shape: 'array-row-table'; | ||
data: any[][]; | ||
@@ -30,3 +30,3 @@ } | ||
export interface ObjectRowTable extends RowTable { | ||
type: 'object-row-table'; | ||
shape: 'object-row-table'; | ||
data: {[columnName: string]: any}[]; | ||
@@ -37,3 +37,3 @@ } | ||
export interface ColumnarTable extends Table { | ||
type: 'columnar-table'; | ||
shape: 'columnar-table'; | ||
data: {[columnName: string]: AnyArray}; | ||
@@ -44,3 +44,3 @@ } | ||
export interface ArrowTable extends Table { | ||
type: 'arrow-table'; | ||
shape: 'arrow-table'; | ||
data: ApacheArrowTable; | ||
@@ -61,3 +61,3 @@ } | ||
export type RowTableBatch = TableBatch & { | ||
type: 'row-table'; | ||
shape: 'row-table'; | ||
data: any[]; | ||
@@ -68,3 +68,3 @@ }; | ||
export type RowArrayTableBatch = RowTableBatch & { | ||
type: 'array-row-table'; | ||
shape: 'array-row-table'; | ||
data: any[][]; | ||
@@ -75,3 +75,3 @@ }; | ||
export type RowObjectTableBatch = RowTableBatch & { | ||
type: 'object-row-table'; | ||
shape: 'object-row-table'; | ||
data: {[columnName: string]: any}[]; | ||
@@ -82,3 +82,3 @@ }; | ||
export type ColumnarTableBatch = TableBatch & { | ||
type: 'columnar-table'; | ||
shape: 'columnar-table'; | ||
data: {[columnName: string]: AnyArray}; | ||
@@ -89,4 +89,4 @@ }; | ||
export type ArrowTableBatch = TableBatch & { | ||
type: 'arrow-table'; | ||
shape: 'arrow-table'; | ||
data: RecordBatch; | ||
}; |
@@ -0,1 +1,2 @@ | ||
/** Any typed array */ | ||
export type TypedArray = | ||
@@ -12,4 +13,8 @@ | Int8Array | ||
export type BigTypedArray = TypedArray | BigInt64Array | BigUint64Array; | ||
/** Any numeric array: typed array or `number[]` */ | ||
export type NumberArray = number[] | TypedArray; | ||
/** Any array: typed array or js array (`any[]`) */ | ||
export type AnyArray = any[] | TypedArray; |
@@ -1,7 +0,4 @@ | ||
export {default as Schema} from './lib/schema/classes/schema'; | ||
export {default as Field} from './lib/schema/classes/field'; | ||
export {deduceTableSchema} from './lib/schema/deduce-table-schema'; | ||
export {getTypeInfo} from './lib/schema/get-type-info'; | ||
// COMMON CATEGORY | ||
export type {TypedArray, NumberArray, AnyArray} from './category/types/types'; | ||
// COMMON CATEGORY | ||
export type {Batch} from './category/common'; | ||
@@ -16,3 +13,5 @@ | ||
ColumnarTable, | ||
ArrowTable, | ||
ArrowTable | ||
} from './category/table'; | ||
export type { | ||
TableBatch, | ||
@@ -36,3 +35,32 @@ RowArrayTableBatch, | ||
// MESH CATEGORY UTILS | ||
export type {Attributes as _Attributes} from './category/mesh/mesh-utils'; | ||
export {getMeshSize, getMeshBoundingBox} from './category/mesh/mesh-utils'; | ||
// TYPES | ||
// GIS CATEGORY - GEOJSON | ||
export type {GeoJSON, Feature, Geometry, Position, GeoJsonProperties} from './category/gis'; | ||
export type { | ||
Point, | ||
MultiPoint, | ||
LineString, | ||
MultiLineString, | ||
Polygon, | ||
MultiPolygon | ||
} from './category/gis'; | ||
// GIS CATEGORY - BINARY | ||
export type {BinaryGeometryType, BinaryGeometry, BinaryAttribute} from './category/gis'; | ||
export type { | ||
BinaryFeatures, | ||
BinaryPointFeatures, | ||
BinaryLineFeatures, | ||
BinaryPolygonFeatures | ||
} from './category/gis'; | ||
// SCHEMA | ||
export {default as Schema} from './lib/schema/classes/schema'; | ||
export {default as Field} from './lib/schema/classes/field'; | ||
export {deduceTableSchema} from './lib/schema/deduce-table-schema'; | ||
export {getTypeInfo} from './lib/schema/get-type-info'; | ||
export { | ||
@@ -39,0 +67,0 @@ DataType, |
@@ -64,3 +64,3 @@ import type {TableBatch} from '../../category/table'; | ||
const batch: TableBatch = { | ||
type: this.options.type, | ||
shape: this.options.shape, | ||
batchType: 'data', | ||
@@ -67,0 +67,0 @@ data: rows, |
@@ -61,3 +61,3 @@ import type {ColumnarTableBatch, ArrowTableBatch} from '../../category/table'; | ||
const batch: ColumnarTableBatch = { | ||
type: 'columnar-table', | ||
shape: 'columnar-table', | ||
batchType: 'data', | ||
@@ -64,0 +64,0 @@ data: columns, |
@@ -43,3 +43,3 @@ import type {TableBatch} from '../../category/table'; | ||
// eslint-disable-next-line default-case | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'object-row-table': | ||
@@ -63,3 +63,3 @@ const rowObject = convertToObjectRow(row, this._headers); | ||
// eslint-disable-next-line default-case | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'array-row-table': | ||
@@ -88,3 +88,3 @@ const rowArray = convertToArrayRow(row, this._headers); | ||
return { | ||
type: this.options.type, | ||
shape: this.options.shape, | ||
batchType: 'data', | ||
@@ -91,0 +91,0 @@ data: rows, |
@@ -10,3 +10,3 @@ import type {TableBatch} from '../../category/table'; | ||
type TableBatchBuilderOptions = { | ||
type: 'row-table' | 'array-row-table' | 'object-row-table' | 'columnar-table' | 'arrow-table'; | ||
shape: 'row-table' | 'array-row-table' | 'object-row-table' | 'columnar-table' | 'arrow-table'; | ||
batchSize?: number | 'auto'; | ||
@@ -24,3 +24,3 @@ batchDebounceMs?: number; | ||
const DEFAULT_OPTIONS: Required<TableBatchBuilderOptions> = { | ||
type: 'array-row-table', | ||
shape: 'array-row-table', | ||
batchSize: 'auto', | ||
@@ -173,3 +173,3 @@ batchDebounceMs: 0, | ||
private _getTableBatchType(): TableBatchConstructor { | ||
switch (this.options.type) { | ||
switch (this.options.shape) { | ||
case 'row-table': | ||
@@ -176,0 +176,0 @@ return BaseTableBatchAggregator; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
331439
118
5046
0
3
+ Added@types/geojson@^7946.0.7
+ Added@types/geojson@7946.0.14(transitive)