@deck.gl-community/experimental 9.1.1 → 9.2.0-beta.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorize-tile.d.ts","sourceRoot":"","sources":["../../../src/data-driven-tile-3d-layer/utils/colorize-tile.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAC,iBAAiB,EAAC,wCAAqC;AAE/D;;;GAGG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"colorize-tile.d.ts","sourceRoot":"","sources":["../../../src/data-driven-tile-3d-layer/utils/colorize-tile.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAC,iBAAiB,EAAC,wCAAqC;AAE/D;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,mBAAmB,iBAAiB,GAAG,IAAI,KAC1C,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,CAqC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-tile.d.ts","sourceRoot":"","sources":["../../../src/data-driven-tile-3d-layer/utils/filter-tile.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAC,kBAAkB,EAAC,wCAAqC;AAOhE;;;;;GAKG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"filter-tile.d.ts","sourceRoot":"","sources":["../../../src/data-driven-tile-3d-layer/utils/filter-tile.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAC,kBAAkB,EAAC,wCAAqC;AAOhE;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,oBAAoB,kBAAkB,GAAG,IAAI,KAC5C,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,CA8B3C,CAAC"}
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/data-driven-tile-3d-layer/data-driven-tile-3d-layer.ts", "../src/data-driven-tile-3d-layer/utils/colorize-tile.ts", "../src/data-driven-tile-3d-layer/utils/filter-tile.ts"],
|
|
4
|
-
"sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {DataDrivenTile3DLayer} from './data-driven-tile-3d-layer/data-driven-tile-3d-layer';\n\nexport {colorizeTile} from './data-driven-tile-3d-layer/utils/colorize-tile';\nexport {filterTile} from './data-driven-tile-3d-layer/utils/filter-tile';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Tile3DLayer, Tile3DLayerProps} from '@deck.gl/geo-layers';\nimport {UpdateParameters, Viewport, DefaultProps} from '@deck.gl/core';\nimport {TILE_TYPE, Tile3D, Tileset3D} from '@loaders.gl/tiles';\nimport {load} from '@loaders.gl/core';\n\nconst defaultProps: DefaultProps<DataDrivenTile3DLayerProps> = {\n colorsByAttribute: null,\n filtersByAttribute: null\n};\n\ntype DataDrivenTile3DLayerProps<DataT = any> = _DataDrivenTile3DLayerProps &\n Tile3DLayerProps<DataT>;\n\ntype _DataDrivenTile3DLayerProps = {\n onTraversalComplete?: (selectedTiles: Tile3D[]) => Tile3D[];\n colorsByAttribute?: ColorsByAttribute | null;\n customizeColors?: (\n tile: Tile3D,\n colorsByAttribute: ColorsByAttribute | null\n ) => Promise<{isColored: boolean; id: string}>;\n filtersByAttribute?: FiltersByAttribute | null;\n filterTile?: (\n tile: Tile3D,\n filtersByAttribute: FiltersByAttribute | null\n ) => Promise<{isFiltered: boolean; id: string}>;\n};\n\nexport type ColorsByAttribute = {\n /** Feature attribute name */\n attributeName: string;\n /** Minimum attribute value */\n minValue: number;\n /** Maximum attribute value */\n maxValue: number;\n /** Minimum color. 3DObject will be colorized with gradient from `minColor to `maxColor` */\n minColor: [number, number, number, number];\n /** Maximum color. 3DObject will be colorized with gradient from `minColor to `maxColor` */\n maxColor: [number, number, number, number];\n /** Colorization mode. `replace` - replace vertex colors with a new colors, `multiply` - multiply vertex colors with new colors */\n mode: string;\n};\n\nexport type FiltersByAttribute = {\n /** Feature attribute name */\n attributeName: string;\n /** Filter value */\n value: number;\n};\n\n// @ts-expect-error call of private method of the base class\nexport class DataDrivenTile3DLayer<\n DataT = any,\n ExtraProps extends Record<string, unknown> = Record<string, unknown>\n> extends Tile3DLayer<DataT, Required<_DataDrivenTile3DLayerProps> & ExtraProps> {\n static layerName = 'DataDrivenTile3DLayer';\n static defaultProps = defaultProps as any;\n\n state: {\n activeViewports: any;\n frameNumber?: number;\n lastUpdatedViewports: {[viewportId: string]: Viewport} | null;\n layerMap: {[layerId: string]: any};\n tileset3d: Tileset3D | null;\n\n colorsByAttribute: ColorsByAttribute | null;\n filtersByAttribute: FiltersByAttribute | null;\n loadingCounter: number;\n } = undefined!;\n\n initializeState() {\n super.initializeState();\n\n this.setState({\n colorsByAttribute: this.props.colorsByAttribute,\n filtersByAttribute: this.props.filtersByAttribute,\n loadingCounter: 0\n });\n }\n\n updateState(params: UpdateParameters<this>): void {\n const {props, oldProps, changeFlags} = params;\n\n if (props.data && props.data !== oldProps.data) {\n this._loadTileset(props.data);\n } else if (props.colorsByAttribute !== oldProps.colorsByAttribute) {\n this.setState({\n colorsByAttribute: props.colorsByAttribute\n });\n this._colorizeTileset();\n } else if (props.filtersByAttribute !== oldProps.filtersByAttribute) {\n this.setState({\n filtersByAttribute: props.filtersByAttribute\n });\n this._filterTileset();\n } else if (changeFlags.viewportChanged) {\n const {activeViewports} = this.state;\n const viewportsNumber = Object.keys(activeViewports).length;\n if (viewportsNumber) {\n if (!this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(activeViewports);\n }\n this.state.lastUpdatedViewports = activeViewports;\n this.state.activeViewports = {};\n }\n } else {\n super.updateState(params);\n }\n }\n\n private override async _loadTileset(tilesetUrl) {\n const {loadOptions = {}} = this.props;\n\n // TODO: deprecate `loader` in v9.0\n let loader: any = this.props.loader || this.props.loaders;\n if (Array.isArray(loader)) {\n loader = loader[0];\n }\n\n const options = {loadOptions: {...loadOptions}};\n if (loader.preload) {\n const preloadOptions = await loader.preload(tilesetUrl, loadOptions);\n\n if (preloadOptions.headers) {\n options.loadOptions.fetch = {\n ...options.loadOptions.fetch,\n headers: preloadOptions.headers\n };\n }\n Object.assign(options, preloadOptions);\n }\n const tilesetJson = await load(tilesetUrl, loader, options.loadOptions);\n\n const tileset3d = new Tileset3D(tilesetJson, {\n onTileLoad: this._onTileLoad.bind(this),\n // @ts-expect-error call of private method of the base class\n onTileUnload: super._onTileUnload.bind(this),\n onTileError: this.props.onTileError,\n // New code ------------------\n onTraversalComplete: this._onTraversalComplete.bind(this),\n // ---------------------------\n ...options\n });\n\n this.setState({\n tileset3d,\n layerMap: {}\n });\n\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.props.onTilesetLoad(tileset3d);\n }\n\n private override _onTileLoad(tileHeader: Tile3D): void {\n const {lastUpdatedViewports} = this.state;\n // New code ------------------\n this._colorizeTiles([tileHeader]);\n this._filterTiles([tileHeader]);\n // ---------------------------\n this.props.onTileLoad(tileHeader);\n // New code ------------------ condition is added\n if (!this.state.colorsByAttribute && !this.state.filtersByAttribute) {\n // ---------------------------\n // @ts-expect-error call of private method of the base class\n super._updateTileset(lastUpdatedViewports);\n this.setNeedsUpdate();\n // New code ------------------\n }\n // ------------------\n }\n\n private _onTraversalComplete(selectedTiles: Tile3D[]): Tile3D[] {\n this._colorizeTiles(selectedTiles);\n this._filterTiles(selectedTiles);\n return this.props.onTraversalComplete\n ? this.props.onTraversalComplete(selectedTiles)\n : selectedTiles;\n }\n\n private _colorizeTiles(tiles: Tile3D[]): void {\n if (this.props.customizeColors && tiles[0]?.type === TILE_TYPE.MESH) {\n const {layerMap, colorsByAttribute} = this.state;\n const promises: Promise<{isColored: boolean; id: string}>[] = [];\n for (const tile of tiles) {\n promises.push(this.props.customizeColors(tile, colorsByAttribute));\n }\n this.setState({\n loadingCounter: this.state.loadingCounter + 1\n });\n Promise.allSettled(promises).then((result) => {\n this.setState({\n loadingCounter: this.state.loadingCounter - 1\n });\n let isTileChanged = false;\n for (const item of result) {\n if (item.status === 'fulfilled' && item.value.isColored) {\n isTileChanged = true;\n delete layerMap[item.value.id];\n }\n }\n if (isTileChanged && !this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.setNeedsUpdate();\n }\n });\n }\n }\n\n private _colorizeTileset(): void {\n const {tileset3d} = this.state;\n\n if (tileset3d) {\n this._colorizeTiles(tileset3d.selectedTiles);\n }\n }\n\n private _filterTiles(tiles: Tile3D[]): void {\n if (this.props.filterTile && tiles[0]?.type === TILE_TYPE.MESH) {\n const {layerMap, filtersByAttribute} = this.state;\n const promises: Promise<{isFiltered: boolean; id: string}>[] = [];\n for (const tile of tiles) {\n promises.push(this.props.filterTile(tile, filtersByAttribute));\n }\n this.setState({\n loadingCounter: this.state.loadingCounter + 1\n });\n Promise.allSettled(promises).then((result) => {\n this.setState({\n loadingCounter: this.state.loadingCounter - 1\n });\n let isTileChanged = false;\n for (const item of result) {\n if (item.status === 'fulfilled' && item.value.isFiltered) {\n isTileChanged = true;\n delete layerMap[item.value.id];\n }\n }\n if (isTileChanged && !this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.setNeedsUpdate();\n }\n });\n }\n }\n\n private _filterTileset(): void {\n const {tileset3d} = this.state;\n\n if (tileset3d) {\n this._filterTiles(tileset3d.selectedTiles);\n }\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {customizeColors} from '@loaders.gl/i3s';\nimport {Tile3D} from '@loaders.gl/tiles';\nimport {ColorsByAttribute} from '../data-driven-tile-3d-layer';\n\n/**\n * Update tile colors with the custom colors assigned to the I3S Loader\n * @returns {Promise<{isColored: boolean; id: string}>} Result of the tile colorization - isColored: true/false and tile id\n */\nexport const colorizeTile = async (\n tile: Tile3D,\n colorsByAttribute: ColorsByAttribute | null\n): Promise<{isColored: boolean; id: string}> => {\n const result = {isColored: false, id: tile.id};\n\n if (tile.content.customColors !== colorsByAttribute) {\n if (tile.content && colorsByAttribute) {\n if (!tile.content.originalColorsAttributes) {\n tile.content.originalColorsAttributes = {\n ...tile.content.attributes.colors,\n value: new Uint8Array(tile.content.attributes.colors.value)\n };\n } else if (colorsByAttribute.mode === 'multiply') {\n tile.content.attributes.colors.value.set(tile.content.originalColorsAttributes.value);\n }\n\n tile.content.customColors = colorsByAttribute;\n\n const newColors = await customizeColors(\n tile.content.attributes.colors,\n tile.content.featureIds,\n tile.header.attributeUrls,\n tile.tileset.tileset.fields,\n tile.tileset.tileset.attributeStorageInfo,\n colorsByAttribute,\n (tile.tileset.loadOptions as any).i3s.token\n );\n // Make sure custom colors is not changed during async customizeColors execution\n if (tile.content.customColors === colorsByAttribute) {\n tile.content.attributes.colors = newColors;\n result.isColored = true;\n }\n } else if (tile.content && tile.content.originalColorsAttributes) {\n tile.content.attributes.colors.value = tile.content.originalColorsAttributes.value;\n tile.content.customColors = null;\n result.isColored = true;\n }\n }\n return result;\n};\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Tile3D} from '@loaders.gl/tiles';\nimport {FiltersByAttribute} from '../data-driven-tile-3d-layer';\nimport {AttributeStorageInfo, I3SAttributeLoader} from '@loaders.gl/i3s';\nimport {load} from '@loaders.gl/core';\nimport {TypedArray} from '@loaders.gl/schema';\n\ntype I3STileAttributes = Record<string, string[] | TypedArray | null>;\n\n/**\n * Filter tile indices by attribute value\n * @param tile - tile to be filtered\n * @param filtersByAttribute - custom filters patameters\n * @returns {Promise<{isFiltered: boolean; id: string}>} Result of the tile filtering - isFiltered: true/false and tile id\n */\nexport const filterTile = async (\n tile: Tile3D,\n filtersByAttribute: FiltersByAttribute | null\n): Promise<{isFiltered: boolean; id: string}> => {\n const result = {isFiltered: false, id: tile.id};\n\n if (tile.content.userData?.customFilters !== filtersByAttribute) {\n if (tile.content && filtersByAttribute) {\n if (tile.content.userData?.originalIndices === undefined) {\n tile.content.userData = {};\n // save original indices for filtring cancellation\n tile.content.userData.originalIndices = tile.content.indices;\n }\n tile.content.indices = tile.content.userData?.originalIndices;\n tile.content.userData.customFilters = filtersByAttribute;\n\n const {indices} = await filterTileIndices(\n tile,\n filtersByAttribute,\n (tile.tileset.loadOptions as any).i3s.token\n );\n // Make sure custom filters is not changed during async filtring execution\n if (indices && tile.content.userData.customFilters === filtersByAttribute) {\n tile.content.indices = indices;\n result.isFiltered = true;\n }\n } else if (tile.content && tile.content.userData?.originalIndices !== undefined) {\n tile.content.indices = tile.content.userData.originalIndices;\n tile.content.userData.customFilters = null;\n result.isFiltered = true;\n }\n }\n return result;\n};\n\n// eslint-disable-next-line max-statements, complexity\nasync function filterTileIndices(\n tile: Tile3D,\n filtersByAttribute: FiltersByAttribute,\n token: string\n): Promise<{success: boolean; indices?: Uint32Array}> {\n if (!filtersByAttribute.attributeName.length) {\n return {success: false};\n }\n\n const filterAttributeField = tile.tileset.tileset.fields.find(\n ({name}) => name === filtersByAttribute?.attributeName\n );\n\n if (\n !filterAttributeField ||\n !['esriFieldTypeDouble', 'esriFieldTypeInteger', 'esriFieldTypeSmallInteger'].includes(\n filterAttributeField.type\n )\n ) {\n return {success: false};\n }\n\n const tileFilterAttributeData = await loadFeatureAttributeData(\n filterAttributeField.name,\n tile.header.attributeUrls,\n tile.tileset.tileset.attributeStorageInfo,\n token\n );\n if (!tileFilterAttributeData) {\n return {success: false};\n }\n\n const objectIdField = tile.tileset.tileset.fields.find(({type}) => type === 'esriFieldTypeOID');\n if (!objectIdField) {\n return {success: false};\n }\n\n const objectIdAttributeData = await loadFeatureAttributeData(\n objectIdField.name,\n tile.header.attributeUrls,\n tile.tileset.tileset.attributeStorageInfo,\n token\n );\n if (!objectIdAttributeData) {\n return {success: false};\n }\n\n const attributeValuesMap = {};\n objectIdAttributeData[objectIdField.name]?.forEach((elem, index) => {\n attributeValuesMap[elem] = tileFilterAttributeData[filterAttributeField.name][index];\n });\n\n if (!tile.content.indices) {\n const triangles: number[] = [];\n for (let i = 0; i < tile.content.featureIds.length; i += 3) {\n if (attributeValuesMap[tile.content.featureIds[i]] === filtersByAttribute.value) {\n triangles.push(i);\n }\n }\n\n const indices = new Uint32Array(3 * triangles.length);\n\n triangles.forEach((vertex, index) => {\n indices[index * 3] = vertex;\n indices[index * 3 + 1] = vertex + 1;\n indices[index * 3 + 2] = vertex + 2;\n });\n return {success: true, indices};\n }\n const triangles: number[] = [];\n for (let i = 0; i < tile.content.indices.length; i += 3) {\n if (\n attributeValuesMap[tile.content.featureIds[tile.content.indices[i]]] ===\n filtersByAttribute.value\n ) {\n triangles.push(i);\n }\n }\n\n const indices = new Uint32Array(3 * triangles.length);\n\n triangles.forEach((vertex, index) => {\n indices[index * 3] = tile.content.indices[vertex];\n indices[index * 3 + 1] = tile.content.indices[vertex + 1];\n indices[index * 3 + 2] = tile.content.indices[vertex + 2];\n });\n return {success: true, indices};\n}\n\nasync function loadFeatureAttributeData(\n attributeName: string,\n attributeUrls: string[],\n attributesStorageInfo: AttributeStorageInfo[],\n token?: string\n): Promise<I3STileAttributes | null> {\n const attributeIndex = attributesStorageInfo.findIndex(({name}) => attributeName === name);\n if (attributeIndex === -1) {\n return null;\n }\n const objectIdAttributeUrl = getUrlWithToken(attributeUrls[attributeIndex], token);\n const attributeType = getAttributeValueType(attributesStorageInfo[attributeIndex]);\n const objectIdAttributeData = await load(objectIdAttributeUrl, I3SAttributeLoader, {\n attributeName,\n attributeType\n });\n\n return objectIdAttributeData;\n}\n\nfunction getUrlWithToken(url: string, token: string | null = null): string {\n return token ? `${url}?token=${token}` : url;\n}\n\nfunction getAttributeValueType(attribute: AttributeStorageInfo) {\n // eslint-disable-next-line no-prototype-builtins\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n // eslint-disable-next-line no-prototype-builtins\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues?.valueType;\n }\n return '';\n}\n"],
|
|
4
|
+
"sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {DataDrivenTile3DLayer} from './data-driven-tile-3d-layer/data-driven-tile-3d-layer';\n\nexport {colorizeTile} from './data-driven-tile-3d-layer/utils/colorize-tile';\nexport {filterTile} from './data-driven-tile-3d-layer/utils/filter-tile';\n\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Tile3DLayer, Tile3DLayerProps} from '@deck.gl/geo-layers';\nimport {UpdateParameters, Viewport, DefaultProps} from '@deck.gl/core';\nimport {TILE_TYPE, Tile3D, Tileset3D} from '@loaders.gl/tiles';\nimport {load} from '@loaders.gl/core';\n\nconst defaultProps: DefaultProps<DataDrivenTile3DLayerProps> = {\n colorsByAttribute: null,\n filtersByAttribute: null\n};\n\ntype DataDrivenTile3DLayerProps<DataT = any> = _DataDrivenTile3DLayerProps &\n Tile3DLayerProps<DataT>;\n\ntype _DataDrivenTile3DLayerProps = {\n onTraversalComplete?: (selectedTiles: Tile3D[]) => Tile3D[];\n colorsByAttribute?: ColorsByAttribute | null;\n customizeColors?: (\n tile: Tile3D,\n colorsByAttribute: ColorsByAttribute | null\n ) => Promise<{isColored: boolean; id: string}>;\n filtersByAttribute?: FiltersByAttribute | null;\n filterTile?: (\n tile: Tile3D,\n filtersByAttribute: FiltersByAttribute | null\n ) => Promise<{isFiltered: boolean; id: string}>;\n};\n\nexport type ColorsByAttribute = {\n /** Feature attribute name */\n attributeName: string;\n /** Minimum attribute value */\n minValue: number;\n /** Maximum attribute value */\n maxValue: number;\n /** Minimum color. 3DObject will be colorized with gradient from `minColor to `maxColor` */\n minColor: [number, number, number, number];\n /** Maximum color. 3DObject will be colorized with gradient from `minColor to `maxColor` */\n maxColor: [number, number, number, number];\n /** Colorization mode. `replace` - replace vertex colors with a new colors, `multiply` - multiply vertex colors with new colors */\n mode: string;\n};\n\nexport type FiltersByAttribute = {\n /** Feature attribute name */\n attributeName: string;\n /** Filter value */\n value: number;\n};\n\n// @ts-expect-error call of private method of the base class\nexport class DataDrivenTile3DLayer<\n DataT = any,\n ExtraProps extends Record<string, unknown> = Record<string, unknown>\n> extends Tile3DLayer<DataT, Required<_DataDrivenTile3DLayerProps> & ExtraProps> {\n static layerName = 'DataDrivenTile3DLayer';\n static defaultProps = defaultProps as any;\n\n state: {\n activeViewports: any;\n frameNumber?: number;\n lastUpdatedViewports: {[viewportId: string]: Viewport} | null;\n layerMap: {[layerId: string]: any};\n tileset3d: Tileset3D | null;\n\n colorsByAttribute: ColorsByAttribute | null;\n filtersByAttribute: FiltersByAttribute | null;\n loadingCounter: number;\n } = undefined!;\n\n initializeState() {\n super.initializeState();\n\n this.setState({\n colorsByAttribute: this.props.colorsByAttribute,\n filtersByAttribute: this.props.filtersByAttribute,\n loadingCounter: 0\n });\n }\n\n updateState(params: UpdateParameters<this>): void {\n const {props, oldProps, changeFlags} = params;\n\n if (props.data && props.data !== oldProps.data) {\n this._loadTileset(props.data);\n } else if (props.colorsByAttribute !== oldProps.colorsByAttribute) {\n this.setState({\n colorsByAttribute: props.colorsByAttribute\n });\n this._colorizeTileset();\n } else if (props.filtersByAttribute !== oldProps.filtersByAttribute) {\n this.setState({\n filtersByAttribute: props.filtersByAttribute\n });\n this._filterTileset();\n } else if (changeFlags.viewportChanged) {\n const {activeViewports} = this.state;\n const viewportsNumber = Object.keys(activeViewports).length;\n if (viewportsNumber) {\n if (!this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(activeViewports);\n }\n this.state.lastUpdatedViewports = activeViewports;\n this.state.activeViewports = {};\n }\n } else {\n super.updateState(params);\n }\n }\n\n private override async _loadTileset(tilesetUrl) {\n const {loadOptions = {}} = this.props;\n\n // TODO: deprecate `loader` in v9.0\n let loader: any = this.props.loader || this.props.loaders;\n if (Array.isArray(loader)) {\n loader = loader[0];\n }\n\n const options = {loadOptions: {...loadOptions}};\n if (loader.preload) {\n const preloadOptions = await loader.preload(tilesetUrl, loadOptions);\n\n if (preloadOptions.headers) {\n options.loadOptions.fetch = {\n ...options.loadOptions.fetch,\n headers: preloadOptions.headers\n };\n }\n Object.assign(options, preloadOptions);\n }\n const tilesetJson = await load(tilesetUrl, loader, options.loadOptions);\n\n const tileset3d = new Tileset3D(tilesetJson, {\n onTileLoad: this._onTileLoad.bind(this),\n // @ts-expect-error call of private method of the base class\n onTileUnload: super._onTileUnload.bind(this),\n onTileError: this.props.onTileError,\n // New code ------------------\n onTraversalComplete: this._onTraversalComplete.bind(this),\n // ---------------------------\n ...options\n });\n\n this.setState({\n tileset3d,\n layerMap: {}\n });\n\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.props.onTilesetLoad(tileset3d);\n }\n\n private override _onTileLoad(tileHeader: Tile3D): void {\n const {lastUpdatedViewports} = this.state;\n // New code ------------------\n this._colorizeTiles([tileHeader]);\n this._filterTiles([tileHeader]);\n // ---------------------------\n this.props.onTileLoad(tileHeader);\n // New code ------------------ condition is added\n if (!this.state.colorsByAttribute && !this.state.filtersByAttribute) {\n // ---------------------------\n // @ts-expect-error call of private method of the base class\n super._updateTileset(lastUpdatedViewports);\n this.setNeedsUpdate();\n // New code ------------------\n }\n // ------------------\n }\n\n private _onTraversalComplete(selectedTiles: Tile3D[]): Tile3D[] {\n this._colorizeTiles(selectedTiles);\n this._filterTiles(selectedTiles);\n return this.props.onTraversalComplete\n ? this.props.onTraversalComplete(selectedTiles)\n : selectedTiles;\n }\n\n private _colorizeTiles(tiles: Tile3D[]): void {\n if (this.props.customizeColors && tiles[0]?.type === TILE_TYPE.MESH) {\n const {layerMap, colorsByAttribute} = this.state;\n const promises: Promise<{isColored: boolean; id: string}>[] = [];\n for (const tile of tiles) {\n promises.push(this.props.customizeColors(tile, colorsByAttribute));\n }\n this.setState({\n loadingCounter: this.state.loadingCounter + 1\n });\n Promise.allSettled(promises).then((result) => {\n this.setState({\n loadingCounter: this.state.loadingCounter - 1\n });\n let isTileChanged = false;\n for (const item of result) {\n if (item.status === 'fulfilled' && item.value.isColored) {\n isTileChanged = true;\n delete layerMap[item.value.id];\n }\n }\n if (isTileChanged && !this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.setNeedsUpdate();\n }\n });\n }\n }\n\n private _colorizeTileset(): void {\n const {tileset3d} = this.state;\n\n if (tileset3d) {\n this._colorizeTiles(tileset3d.selectedTiles);\n }\n }\n\n private _filterTiles(tiles: Tile3D[]): void {\n if (this.props.filterTile && tiles[0]?.type === TILE_TYPE.MESH) {\n const {layerMap, filtersByAttribute} = this.state;\n const promises: Promise<{isFiltered: boolean; id: string}>[] = [];\n for (const tile of tiles) {\n promises.push(this.props.filterTile(tile, filtersByAttribute));\n }\n this.setState({\n loadingCounter: this.state.loadingCounter + 1\n });\n Promise.allSettled(promises).then((result) => {\n this.setState({\n loadingCounter: this.state.loadingCounter - 1\n });\n let isTileChanged = false;\n for (const item of result) {\n if (item.status === 'fulfilled' && item.value.isFiltered) {\n isTileChanged = true;\n delete layerMap[item.value.id];\n }\n }\n if (isTileChanged && !this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.setNeedsUpdate();\n }\n });\n }\n }\n\n private _filterTileset(): void {\n const {tileset3d} = this.state;\n\n if (tileset3d) {\n this._filterTiles(tileset3d.selectedTiles);\n }\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {customizeColors} from '@loaders.gl/i3s';\nimport {Tile3D} from '@loaders.gl/tiles';\nimport {ColorsByAttribute} from '../data-driven-tile-3d-layer';\n\n/**\n * Update tile colors with the custom colors assigned to the I3S Loader\n * @returns {Promise<{isColored: boolean; id: string}>} Result of the tile colorization - isColored: true/false and tile id\n */\nexport const colorizeTile = async (\n tile: Tile3D,\n colorsByAttribute: ColorsByAttribute | null\n): Promise<{isColored: boolean; id: string}> => {\n const result = {isColored: false, id: tile.id};\n\n if (tile.content.customColors !== colorsByAttribute) {\n if (tile.content && colorsByAttribute) {\n if (!tile.content.originalColorsAttributes) {\n tile.content.originalColorsAttributes = {\n ...tile.content.attributes.colors,\n value: new Uint8Array(tile.content.attributes.colors.value)\n };\n } else if (colorsByAttribute.mode === 'multiply') {\n tile.content.attributes.colors.value.set(tile.content.originalColorsAttributes.value);\n }\n\n tile.content.customColors = colorsByAttribute;\n\n const newColors = await customizeColors(\n tile.content.attributes.colors,\n tile.content.featureIds,\n tile.header.attributeUrls,\n tile.tileset.tileset.fields,\n tile.tileset.tileset.attributeStorageInfo,\n colorsByAttribute,\n (tile.tileset.loadOptions as any).i3s.token\n );\n // Make sure custom colors is not changed during async customizeColors execution\n if (tile.content.customColors === colorsByAttribute) {\n tile.content.attributes.colors = newColors;\n result.isColored = true;\n }\n } else if (tile.content && tile.content.originalColorsAttributes) {\n tile.content.attributes.colors.value = tile.content.originalColorsAttributes.value;\n tile.content.customColors = null;\n result.isColored = true;\n }\n }\n return result;\n};\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Tile3D} from '@loaders.gl/tiles';\nimport {FiltersByAttribute} from '../data-driven-tile-3d-layer';\nimport {AttributeStorageInfo, I3SAttributeLoader} from '@loaders.gl/i3s';\nimport {load} from '@loaders.gl/core';\nimport {TypedArray} from '@loaders.gl/schema';\n\ntype I3STileAttributes = Record<string, string[] | TypedArray | null>;\n\n/**\n * Filter tile indices by attribute value\n * @param tile - tile to be filtered\n * @param filtersByAttribute - custom filters patameters\n * @returns {Promise<{isFiltered: boolean; id: string}>} Result of the tile filtering - isFiltered: true/false and tile id\n */\nexport const filterTile = async (\n tile: Tile3D,\n filtersByAttribute: FiltersByAttribute | null\n): Promise<{isFiltered: boolean; id: string}> => {\n const result = {isFiltered: false, id: tile.id};\n\n if (tile.content.userData?.customFilters !== filtersByAttribute) {\n if (tile.content && filtersByAttribute) {\n if (tile.content.userData?.originalIndices === undefined) {\n tile.content.userData = {};\n // save original indices for filtring cancellation\n tile.content.userData.originalIndices = tile.content.indices;\n }\n tile.content.indices = tile.content.userData?.originalIndices;\n tile.content.userData.customFilters = filtersByAttribute;\n\n const {indices} = await filterTileIndices(\n tile,\n filtersByAttribute,\n (tile.tileset.loadOptions as any).i3s.token\n );\n // Make sure custom filters is not changed during async filtring execution\n if (indices && tile.content.userData.customFilters === filtersByAttribute) {\n tile.content.indices = indices;\n result.isFiltered = true;\n }\n } else if (tile.content && tile.content.userData?.originalIndices !== undefined) {\n tile.content.indices = tile.content.userData.originalIndices;\n tile.content.userData.customFilters = null;\n result.isFiltered = true;\n }\n }\n return result;\n};\n\n// eslint-disable-next-line max-statements, complexity\nasync function filterTileIndices(\n tile: Tile3D,\n filtersByAttribute: FiltersByAttribute,\n token: string\n): Promise<{success: boolean; indices?: Uint32Array}> {\n if (!filtersByAttribute.attributeName.length) {\n return {success: false};\n }\n\n const filterAttributeField = tile.tileset.tileset.fields.find(\n ({name}) => name === filtersByAttribute?.attributeName\n );\n\n if (\n !filterAttributeField ||\n !['esriFieldTypeDouble', 'esriFieldTypeInteger', 'esriFieldTypeSmallInteger'].includes(\n filterAttributeField.type\n )\n ) {\n return {success: false};\n }\n\n const tileFilterAttributeData = await loadFeatureAttributeData(\n filterAttributeField.name,\n tile.header.attributeUrls,\n tile.tileset.tileset.attributeStorageInfo,\n token\n );\n if (!tileFilterAttributeData) {\n return {success: false};\n }\n\n const objectIdField = tile.tileset.tileset.fields.find(({type}) => type === 'esriFieldTypeOID');\n if (!objectIdField) {\n return {success: false};\n }\n\n const objectIdAttributeData = await loadFeatureAttributeData(\n objectIdField.name,\n tile.header.attributeUrls,\n tile.tileset.tileset.attributeStorageInfo,\n token\n );\n if (!objectIdAttributeData) {\n return {success: false};\n }\n\n const attributeValuesMap = {};\n objectIdAttributeData[objectIdField.name]?.forEach((elem, index) => {\n attributeValuesMap[elem] = tileFilterAttributeData[filterAttributeField.name][index];\n });\n\n if (!tile.content.indices) {\n const triangles: number[] = [];\n for (let i = 0; i < tile.content.featureIds.length; i += 3) {\n if (attributeValuesMap[tile.content.featureIds[i]] === filtersByAttribute.value) {\n triangles.push(i);\n }\n }\n\n const indices = new Uint32Array(3 * triangles.length);\n\n triangles.forEach((vertex, index) => {\n indices[index * 3] = vertex;\n indices[index * 3 + 1] = vertex + 1;\n indices[index * 3 + 2] = vertex + 2;\n });\n return {success: true, indices};\n }\n const triangles: number[] = [];\n for (let i = 0; i < tile.content.indices.length; i += 3) {\n if (\n attributeValuesMap[tile.content.featureIds[tile.content.indices[i]]] ===\n filtersByAttribute.value\n ) {\n triangles.push(i);\n }\n }\n\n const indices = new Uint32Array(3 * triangles.length);\n\n triangles.forEach((vertex, index) => {\n indices[index * 3] = tile.content.indices[vertex];\n indices[index * 3 + 1] = tile.content.indices[vertex + 1];\n indices[index * 3 + 2] = tile.content.indices[vertex + 2];\n });\n return {success: true, indices};\n}\n\nasync function loadFeatureAttributeData(\n attributeName: string,\n attributeUrls: string[],\n attributesStorageInfo: AttributeStorageInfo[],\n token?: string\n): Promise<I3STileAttributes | null> {\n const attributeIndex = attributesStorageInfo.findIndex(({name}) => attributeName === name);\n if (attributeIndex === -1) {\n return null;\n }\n const objectIdAttributeUrl = getUrlWithToken(attributeUrls[attributeIndex], token);\n const attributeType = getAttributeValueType(attributesStorageInfo[attributeIndex]);\n const objectIdAttributeData = await load(objectIdAttributeUrl, I3SAttributeLoader, {\n attributeName,\n attributeType\n });\n\n return objectIdAttributeData;\n}\n\nfunction getUrlWithToken(url: string, token: string | null = null): string {\n return token ? `${url}?token=${token}` : url;\n}\n\nfunction getAttributeValueType(attribute: AttributeStorageInfo) {\n // eslint-disable-next-line no-prototype-builtins\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n // eslint-disable-next-line no-prototype-builtins\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues?.valueType;\n }\n return '';\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACIA,wBAA4C;AAE5C,mBAA2C;AAC3C,kBAAmB;AAEnB,IAAM,eAAyD;EAC7D,mBAAmB;EACnB,oBAAoB;;AA2ChB,IAAO,wBAAP,cAGI,8BAAsE;EAI9E,QAUI;EAEJ,kBAAe;AACb,UAAM,gBAAe;AAErB,SAAK,SAAS;MACZ,mBAAmB,KAAK,MAAM;MAC9B,oBAAoB,KAAK,MAAM;MAC/B,gBAAgB;KACjB;EACH;EAEA,YAAY,QAA8B;AACxC,UAAM,EAAC,OAAO,UAAU,YAAW,IAAI;AAEvC,QAAI,MAAM,QAAQ,MAAM,SAAS,SAAS,MAAM;AAC9C,WAAK,aAAa,MAAM,IAAI;IAC9B,WAAW,MAAM,sBAAsB,SAAS,mBAAmB;AACjE,WAAK,SAAS;QACZ,mBAAmB,MAAM;OAC1B;AACD,WAAK,iBAAgB;IACvB,WAAW,MAAM,uBAAuB,SAAS,oBAAoB;AACnE,WAAK,SAAS;QACZ,oBAAoB,MAAM;OAC3B;AACD,WAAK,eAAc;IACrB,WAAW,YAAY,iBAAiB;AACtC,YAAM,EAAC,gBAAe,IAAI,KAAK;AAC/B,YAAM,kBAAkB,OAAO,KAAK,eAAe,EAAE;AACrD,UAAI,iBAAiB;AACnB,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IACA;GACD;AAED,SAAO;AACT;AAEA,SAAS,gBAAgB,KAAa,QAAuB,MAAI;AAC/D,SAAO,QAAQ,GAAG,aAAa,UAAU;AAC3C;AAEA,SAAS,sBAAsB,WAA+B;AAvK9D;AAyKE,MAAI,UAAU,eAAe,WAAW,GAAG;AACzC,WAAO;EAET,WAAW,UAAU,eAAe,iBAAiB,GAAG;AACtD,YAAO,eAAU,oBAAV,mBAA2B;EACpC;AACA,SAAO;AACT;",
|
|
6
6
|
"names": ["import_i3s", "import_core", "triangles", "indices"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deck.gl-community/experimental",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0-beta.3",
|
|
4
4
|
"description": "Experimental layers for deck.gl",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -30,19 +30,18 @@
|
|
|
30
30
|
"test-watch": "vitest"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@deck.gl/core": "
|
|
34
|
-
"@deck.gl/
|
|
35
|
-
"@deck.gl/
|
|
36
|
-
"@deck.gl/layers": "
|
|
37
|
-
"@deck.gl/mesh-layers": "^9.1.0",
|
|
38
|
-
"@deck.gl/react": "^9.1.0",
|
|
33
|
+
"@deck.gl/core": "~9.2.1",
|
|
34
|
+
"@deck.gl/geo-layers": "~9.2.1",
|
|
35
|
+
"@deck.gl/layers": "~9.2.1",
|
|
36
|
+
"@deck.gl/mesh-layers": "~9.2.1",
|
|
39
37
|
"@loaders.gl/core": "^4.2.0",
|
|
40
38
|
"@loaders.gl/i3s": "^4.2.0",
|
|
41
39
|
"@loaders.gl/loader-utils": "^4.2.0",
|
|
42
40
|
"@loaders.gl/schema": "^4.2.0",
|
|
43
41
|
"@loaders.gl/tiles": "^4.2.0",
|
|
44
|
-
"@luma.gl/core": "
|
|
45
|
-
"@luma.gl/engine": "
|
|
42
|
+
"@luma.gl/core": "~9.2.0",
|
|
43
|
+
"@luma.gl/engine": "~9.2.0",
|
|
44
|
+
"@luma.gl/shadertools": "~9.2.0"
|
|
46
45
|
},
|
|
47
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "6110b774c8be16f199ecdf67723851a2e34901e5"
|
|
48
47
|
}
|
package/src/index.ts
CHANGED