@arcgis/core 4.33.0-next.20250512 → 4.33.0-next.20250514
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/arcade/functions/centroid.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/geometry/operators.js +1 -1
- package/arcade/geometry/operatorsWorker.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/assets/components/assets/combobox/t9n/messages.en.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.json +1 -1
- package/assets/components/assets/icon/calendarHeatChart16.json +1 -0
- package/assets/components/assets/icon/calendarHeatChart24.json +1 -0
- package/assets/components/assets/icon/calendarHeatChart32.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart16.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart24.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart32.json +1 -0
- package/assets/components/assets/icon/progressBarChart16.json +1 -0
- package/assets/components/assets/icon/progressBarChart24.json +1 -0
- package/assets/components/assets/icon/progressBarChart32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined16F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined24F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined32F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0766ecb677d667e5fb83.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{4deeeceb784e4390441d.js → 0a4cece5e96fb7e8a57b.js} +1 -1
- package/assets/esri/core/workers/chunks/12e99071f6582f6caeaf.js +1 -0
- package/assets/esri/core/workers/chunks/191a45a594ecaf7f1abb.js +1 -0
- package/assets/esri/core/workers/chunks/1991f0d0f0a12175f849.js +1 -0
- package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{07695960aa0344dbfbf3.js → 28d9e2ffc3059a55311e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5e746e10239a3bfe237.js → 30f3014c0ac6e2bc14bf.js} +1 -1
- package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/4899cdc8bb5085c356f9.js +1 -0
- package/assets/esri/core/workers/chunks/498886c321a2501658bc.js +1 -0
- package/assets/esri/core/workers/chunks/56569d0c2cf5c5167651.js +1 -0
- package/assets/esri/core/workers/chunks/{ba3193ea145960a50e87.js → 5c8d52b72a3bea4202ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{fbcd94f60f92257a7303.js → 6394ab6f629aa90292e6.js} +2 -2
- package/assets/esri/core/workers/chunks/{fbcd94f60f92257a7303.js.LICENSE.txt → 6394ab6f629aa90292e6.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{8b74b609de4f70e1a75c.js → 64af433e88d4dd21a2ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{2b01e3bce78541620a86.js → 6cbe8205a4e0f62da519.js} +1 -1
- package/assets/esri/core/workers/chunks/6e64ce0958c3432004b6.js +346 -0
- package/assets/esri/core/workers/chunks/6e8c6c9112ecb867b7be.js +1 -0
- package/assets/esri/core/workers/chunks/{a8430e1e2142f1ce9b92.js → 82c395d8649096609a8a.js} +1 -1
- package/assets/esri/core/workers/chunks/{a73c6b4bc5baf440f85a.js → 88b7265270feede80e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/8c21cc9af4ce9652cc5c.js +1 -0
- package/assets/esri/core/workers/chunks/{243dc74ec62891ba1ef7.js → 8e82acd1f730571680f4.js} +1 -1
- package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/a09b5700c92bb76c3234.js +1 -0
- package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +1 -0
- package/assets/esri/core/workers/chunks/{079434fe765c53d304f2.js → b1e275607d9754079f60.js} +1 -1
- package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{3c45603af279ad7fed8c.js → b8b5dfd2d73a8410fba2.js} +1 -1
- package/assets/esri/core/workers/chunks/c604fefedccfd4db9953.js +1 -0
- package/assets/esri/core/workers/chunks/{0aca29f7156b2b412f2e.js → d1f7bfb8daf11ecada9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{b816b608f31954128246.js → d21d9e8b8c8a2e0485d5.js} +1 -1
- package/assets/esri/core/workers/chunks/da3c62a851a4332f6dda.js +1 -0
- package/assets/esri/core/workers/chunks/{a8b42d8c0b76c234c09f.js → e0247252c6a0f3340e33.js} +81 -82
- package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/e5608e5232e983531f72.js +1 -0
- package/assets/esri/core/workers/chunks/f8fb0c7eaf73709bd855.js +1 -0
- package/assets/esri/core/workers/chunks/fd24dd602a3fed88d90e.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +17 -10
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +4 -0
- package/assets/esri/themes/base/widgets/_SelectionList.scss +7 -3
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorDefinitions.js +5 -0
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/ShadowCastAccumulate.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +5 -5
- package/chunks/Theme.js +1 -1
- package/chunks/Tick.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/core/Accessor.js +1 -1
- package/core/accessorSupport/Lifecycle.js +5 -0
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/decorators/subclass.js +1 -1
- package/core/accessorSupport/tracking/Flags.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorSimplifyOGC.js +1 -1
- package/geometry/operators/simplifyOGCOperator.js +1 -1
- package/interfaces.d.ts +368 -2450
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/knowledgeGraph/supportUtils.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +3 -4
- package/smartMapping/statistics/uniqueValues.js +1 -1
- package/smartMapping/support/adapters/support/layerUtils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/versionManagement/versionAdapters/FeatureLayerVersionAdapter.js +1 -1
- package/versionManagement/versionAdapters/NetworkVersionAdapter.js +1 -1
- package/versionManagement/versionAdapters/SubTypeGroupLayerVersionAdapter.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/FocusAreasView.js +5 -0
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWasm.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/FeatureProcessingContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/TileLocks.js +5 -0
- package/views/3d/layers/graphics/pipeline/featureData/FeatureData.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureData/FeatureDataSubset.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SQueryResultGeometry.js +1 -1
- package/views/3d/layers/i3s/meshUtils.js +5 -0
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/TileTexture.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -27
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +29 -0
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/layers/BuildingComponentSublayerView.js +1 -1
- package/views/layers/BuildingSceneLayerView.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/support/TextureCompressionWorkerHandle.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/009dbddfc6499e2cee4f.js +0 -1
- package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +0 -1
- package/assets/esri/core/workers/chunks/26ebb7816dd8c8cd4f3b.js +0 -1
- package/assets/esri/core/workers/chunks/2abce00d812c7f6b542d.js +0 -1
- package/assets/esri/core/workers/chunks/47cd99ab3ed11a931084.js +0 -1
- package/assets/esri/core/workers/chunks/51d9eaeeb781fd1d1162.js +0 -1
- package/assets/esri/core/workers/chunks/5228fc7fcdf57f44781e.js +0 -1
- package/assets/esri/core/workers/chunks/83d6a1b3db7d364d156b.js +0 -1
- package/assets/esri/core/workers/chunks/83e13baab4b90a88d967.js +0 -1
- package/assets/esri/core/workers/chunks/92cbe9af8a6c061bfb57.js +0 -346
- package/assets/esri/core/workers/chunks/93cc26e5636040fdc0b8.js +0 -1
- package/assets/esri/core/workers/chunks/c17c269cc30e7e1d0bfb.js +0 -1
- package/assets/esri/core/workers/chunks/c3f144ca69995dca34a9.js +0 -1
- package/assets/esri/core/workers/chunks/d551f70560a2b1ef5696.js +0 -1
- package/core/accessorSupport/interfaces.js +0 -5
- package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +0 -5
- package/views/FocusAreasView.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{rad2deg as o}from"../core/mathUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{on as n,sync as m}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{persistable as f}from"../core/accessorSupport/decorators/persistable.js";import{d,f as h,t as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{rad2deg as o}from"../core/mathUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{on as n,sync as m}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{persistable as f}from"../core/accessorSupport/decorators/persistable.js";import{d,f as h,t as u,c as y,A as x,z as g,a as v}from"../chunks/vec32.js";import{fromValues as j,create as S}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as b}from"../geometry/ellipsoidUtils.js";import _ from"../geometry/Extent.js";import A from"../geometry/SpatialReference.js";import{projectBuffer as w}from"../geometry/projection/projectBuffer.js";import L from"./Layer.js";import{APIKeyMixin as M}from"./mixins/APIKeyMixin.js";import{ArcGISService as E}from"./mixins/ArcGISService.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as U}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as N,url as O}from"./support/commonProperties.js";import z from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as D,elevationModeRequiredMessage as P,featureExpressionUnsupportedMessage as V}from"../support/elevationInfoUtils.js";import{f as k}from"../chunks/persistableUrlUtils.js";let X=class extends(E(T(R(U(s(I(M(L)))))))){readModifications(e,t,i){this._modificationsSource={url:k(e,i),context:i}}initialize(){this.addHandles(n((()=>this.modifications),"after-changes",(()=>this.modifications=this.modifications),m))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new A({wkid:4326,vcsWkid:115700}),this.fullExtent=new _(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this.rootTilesetJSON=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}_verifyArray(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(const i of e)if("number"!=typeof i)return!1;return!0}_initFullExtent(){const e=this.rootTilesetJSON?.root?.boundingVolume;if(!e)return;if(e.box){const t=e?.box;if(t[3]>7972671&&t[7]>7972671&&t[11]>7945940)return}const t=this.rootTilesetJSON?.root?.transform,i=S();if(e.region&&this._verifyArray(e.region,6)){const t=e.region,i=o(t[0]),r=o(t[1]),s=t[4],a=o(t[2]),n=o(t[3]),m=t[5];this.fullExtent=new _({xmin:i,ymin:r,zmin:s,xmax:a,ymax:n,zmax:m,spatialReference:this.spatialReference})}else if(e.sphere&&this._verifyArray(e.sphere,4)){const r=e.sphere,o=j(r[0],r[1],r[2]),s=r[3]/Math.sqrt(3),a=S();d(a,o,j(s,s,s));const n=S();if(h(n,o,j(s,s,s)),t&&this._verifyArray(t,16)){const e=t;u(i,a,e),y(a,i),u(i,n,e),y(n,i)}w(a,b,0,a,A.WGS84,0),w(n,b,0,n,A.WGS84,0);const m=S(),l=S();x(m,a,n),g(l,a,n),this.fullExtent=new _({xmin:m[0],ymin:m[1],zmin:m[2],xmax:l[0],ymax:l[1],zmax:l[2],spatialReference:this.spatialReference})}else if(e.box&&this._verifyArray(e.box,12)){const i=e.box,r=j(i[0],i[1],i[2]),o=j(i[3],i[4],i[5]),s=j(i[6],i[7],i[8]),a=j(i[9],i[10],i[11]),n=[];for(let e=0;e<8;++e)n.push(S());if(h(n[0],r,o),h(n[0],n[0],s),h(n[0],n[0],a),v(n[1],r,o),h(n[1],n[1],s),h(n[1],n[1],a),h(n[2],r,o),v(n[2],n[2],s),h(n[2],n[2],a),v(n[3],r,o),v(n[3],n[3],s),h(n[3],n[3],a),h(n[4],r,o),h(n[4],n[4],s),v(n[4],n[4],a),v(n[5],r,o),h(n[5],n[5],s),v(n[5],n[5],a),h(n[6],r,o),v(n[6],n[6],s),v(n[6],n[6],a),v(n[7],r,o),v(n[7],n[7],s),v(n[7],n[7],a),t&&this._verifyArray(t,16)){const e=t;for(let t=0;t<8;++t)u(n[t],n[t],e)}const m=j(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=j(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<8;++e)w(n[e],b,0,n[e],A.WGS84,0),x(l,l,n[e]),g(m,m,n[e]);this.fullExtent=new _({xmin:l[0],ymin:l[1],zmin:l[2],xmax:m[0],ymax:m[1],zmax:m[2],spatialReference:this.spatialReference})}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){a(o)}if(null!=this._modificationsSource){const t=await z.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then((e=>{this.rootTilesetJSON=e.data,this._initFullExtent()}),(e=>{a(e)}));await e}}beforeSave(){if(null!=this._modificationsSource)return this.load().then((()=>{}),(()=>{}))}async fetchAttributionData(){return this.load().then((()=>({})))}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";D(r.getLogger(this),P(t,"absolute-height",e)),D(r.getLogger(this),V(t,e))}};e([l({type:["IntegratedMesh3DTilesLayer"]})],X.prototype,"operationalLayerType",void 0),e([l({type:z}),f({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],X.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],X.prototype,"readModifications",null),e([l({type:A})],X.prototype,"spatialReference",void 0),e([l({type:_})],X.prototype,"fullExtent",void 0),e([l(N)],X.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],X.prototype,"listMode",void 0),e([l(O)],X.prototype,"url",void 0),e([l({readOnly:!0})],X.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],X.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],X.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],X.prototype,"maxScale",void 0),X=e([c("esri.layers.IntegratedMesh3DTilesLayer")],X);const G=X;export{G as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{fetchAndConvertSerializedKnowledgeIdMap as i,serializeInclusionDefinitionToIdCollectionsMapPbf as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import s from"../core/Error.js";import o from"../core/Logger.js";import{getOrCreateMapValue as r}from"../core/MapUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as p}from"../core/promiseUtils.js";import{watch as d,sync as l}from"../core/reactiveUtils.js";import{isAbsolute as h,join as y}from"../core/urlUtils.js";import{generateUUID as c}from"../core/uuid.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{writer as g}from"../core/accessorSupport/decorators/writer.js";import{OriginId as w,idToName as M,nameToId as b}from"../core/accessorSupport/PropertyOrigin.js";import T from"./Layer.js";import{KnowledgeGraphLayerDataManager as D}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import S from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as _}from"./knowledgeGraph/layerUtils.js";import{ArcGISService as L}from"./mixins/ArcGISService.js";import{BlendLayer as v}from"./mixins/BlendLayer.js";import{CustomParametersMixin as k}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{RefreshableLayer as C}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as G}from"./mixins/ScaleRangeLayer.js";import{url as N}from"./support/commonProperties.js";import{fetchKnowledgeGraph as E}from"../rest/knowledgeGraphService.js";import{f as I,t as x}from"../chunks/persistableUrlUtils.js";let R=class extends(v(G(C(L(j(A(n(k(T))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(a.ofType(S)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(S)),this.type="knowledge-graph",this.url=null,this.addHandles(d((()=>this.layers.concat(this.tables)),((e,i)=>this._handleSublayersChange(e,i)),l))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(i){p(i)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await _(this)}async _fetchMetadata(){if(!this.url)throw new s("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await E(this.url);this.knowledgeGraph=e,this._forEachGraphType((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}))}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===w.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new D({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await i(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach((i=>{const t=this._graphTypeLookup.get(i.graphTypeName);t&&!e.namedTypeDefinitions.has(t.name)&&e.namedTypeDefinitions.set(t.name,{useAllData:!0})})),this.setAtOrigin("inclusionModeDefinition",e,M(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:i}=e;if(i?.size>0)i.forEach(((e,t)=>{const a=this._graphTypeLookup.get(t);if(!a)return o.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't in the data model and will be removed`),void i.delete(t);"relationship"!==a.type&&"entity"!==a.type&&(o.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't properly modeled and will be removed`),i.delete(t))}));else if(!e.generateAllSublayers)throw new s("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],i=[];const{inclusionModeDefinition:t}=this,a=t?.namedTypeDefinitions;!t||t.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],i=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach(((t,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":i.push(s);break;case"entity":e.push(s)}})),this.memberEntityTypes=e,this.memberRelationshipTypes=i}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach((i=>{e(i)}))}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const i=[],t=[];for(const a of e){if(!this._graphTypeLookup.has(a.typeName))continue;this.dataManager.sublayerCaches.has(a.typeName)||(this.dataManager.sublayerCaches.set(a.typeName,new Map),i.push(a.typeName));r(this.sublayerIdsCache,a.typeName,(()=>new Set)).add(a.id),t.push(a)}this.dataManager.addToLayer(t);for(const a of i){const e=this._graphTypeLookup.get(a);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a))}await _(this,i),this._refreshNamedTypes()}_createSublayers(e,i,t){e.forEach((e=>{const a=this._createSublayer(e);t(a)&&i.push(a),this._updateSublayerCaches(e)}))}_addSublayer(e){const i=this._createSublayer(e);return i.geometryType?this.layers.push(i):this.tables.push(i),i}_createSublayer(e){return new S({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,i){i.forEach((i=>{i.parentCompositeLayer=this;const t=e.find((e=>e.type===i.graphType&&e.name===i.graphTypeName));t&&(i.objectType=t,this._updateSublayerCaches(t))}))}_updateSublayerCaches({name:e}){if(!e)return;const i=this.dataManager.sublayerCaches;i.has(e)||i.set(e,new Map)}_saveUrlAsNewResource(e,i,t,a){e[i]="<pending>",t.pendingOperations.push(O(this.inclusionModeDefinition).then((s=>{const o=K(a);e[i]=o.itemRelativeUrl,t.toAdd.push({resource:o,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})})))}_displaysAllRecords(e){for(const[,{useAllData:i}]of e.namedTypeDefinitions)if(!i)return!1;return!0}_handleSublayersChange(e,i){i&&(i.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=w.PORTAL_ITEM&&e<w.USER}readDefinitionSetMap(e,i,t){return I(e,t)}writeDefinitionSetMap(e,i,t,a){const s=a?.portalItem,o=a?.resources,r=b(a?.origin);if(!s||!o||null==r)return void(e&&(i[t]=x(e,a)));const{inclusionModeDefinition:n}=this;if(!n||this._displaysAllRecords(n))return void(this.definitionSetMap=null);const p=this.originIdOf("inclusionModeDefinition");if(p===w.USER||this._namedTypesModified||r<p)this._saveUrlAsNewResource(i,t,o,s);else if(r===p&&e){const r=x(e,a);h(r)?this._saveUrlAsNewResource(i,t,o,s):i[t]=r}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.originIdOf("layers")===w.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===w.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,i)=>{const t=r(this.sublayerIdsCache,i,(()=>new Set));e.members?.forEach((e=>{t.add(e.id)}))}))}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const i=this._graphTypeLookup.get(e);if(!i)throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),r(this.sublayerIdsCache,e,(()=>new Set));const t=this._addSublayer(i);return"entity"===i.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await _(this,[e]),this._refreshNamedTypes(),t}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);i?.useAllData?o.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!i||i.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else o.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||o.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&o.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())r(this.sublayerIdsCache,e,(()=>new Set)),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const i=[];for(const t of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id)&&i.push(t);this.dataManager.removeFromLayer(i);for(const t of i)this.sublayerIdsCache.get(t.typeName)?.delete(t.id);return this._refreshNamedTypes(),i}};e([m()],R.prototype,"dataManager",void 0),e([m({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],R.prototype,"definitionSetMap",void 0),e([u("definitionSetMap")],R.prototype,"readDefinitionSetMap",null),e([g("definitionSetMap")],R.prototype,"writeDefinitionSetMap",null),e([m()],R.prototype,"inclusionModeDefinition",null),e([m()],R.prototype,"knowledgeGraph",void 0),e([m({type:a.ofType(S),json:{write:{ignoreOrigin:!0}}})],R.prototype,"layers",void 0),e([m()],R.prototype,"memberEntityTypes",void 0),e([m()],R.prototype,"memberRelationshipTypes",void 0),e([m({type:["KnowledgeGraphLayer"]})],R.prototype,"operationalLayerType",void 0),e([m()],R.prototype,"sublayerIdsCache",void 0),e([m({type:a.ofType(S),json:{write:{ignoreOrigin:!0}}})],R.prototype,"tables",void 0),e([m({json:{read:!1}})],R.prototype,"type",void 0),e([m(N)],R.prototype,"url",void 0),R=e([f("esri.layers.KnowledgeGraphLayer")],R);const U=R;async function O(e){const i=await t(e);return new Blob([i],{type:"application/x-protobuf"})}function K(e){const i=`definitionSetMap-${c()}.dat`,t=y("knowledgeGraphLayer",i);return e.resourceFromPath(t)}export{U as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{fetchAndConvertSerializedKnowledgeIdMap as i,serializeInclusionDefinitionToIdCollectionsMapPbf as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import s from"../core/Error.js";import o from"../core/Logger.js";import{getOrCreateMapValue as r}from"../core/MapUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as p}from"../core/promiseUtils.js";import{watch as d,sync as l}from"../core/reactiveUtils.js";import{isAbsolute as h,join as y}from"../core/urlUtils.js";import{generateUUID as c}from"../core/uuid.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{writer as g}from"../core/accessorSupport/decorators/writer.js";import{OriginId as w,idToName as M,nameToId as b}from"../core/accessorSupport/PropertyOrigin.js";import T from"./Layer.js";import{KnowledgeGraphLayerDataManager as D}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import S from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as _}from"./knowledgeGraph/layerUtils.js";import{ArcGISService as L}from"./mixins/ArcGISService.js";import{BlendLayer as v}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as k}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{RefreshableLayer as C}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as G}from"./mixins/ScaleRangeLayer.js";import{url as N}from"./support/commonProperties.js";import{fetchKnowledgeGraph as E}from"../rest/knowledgeGraphService.js";import{f as I,t as x}from"../chunks/persistableUrlUtils.js";let R=class extends(v(G(C(L(k(A(n(j(T))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(a.ofType(S)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(S)),this.type="knowledge-graph",this.url=null,this.addHandles(d((()=>this.layers.concat(this.tables)),((e,i)=>this._handleSublayersChange(e,i)),l))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(i){p(i)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await _(this)}async _fetchMetadata(){if(!this.url)throw new s("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await E(this.url);this.knowledgeGraph=e,this._forEachGraphType((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}))}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===w.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new D({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await i(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach((i=>{const t=this._graphTypeLookup.get(i.graphTypeName);t&&!e.namedTypeDefinitions.has(t.name)&&e.namedTypeDefinitions.set(t.name,{useAllData:!0})})),this.setAtOrigin("inclusionModeDefinition",e,M(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:i}=e;if(i?.size>0)i.forEach(((e,t)=>{const a=this._graphTypeLookup.get(t);if(!a)return o.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't in the data model and will be removed`),void i.delete(t);"relationship"!==a.type&&"entity"!==a.type&&(o.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't properly modeled and will be removed`),i.delete(t))}));else if(!e.generateAllSublayers)throw new s("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],i=[];const{inclusionModeDefinition:t}=this,a=t?.namedTypeDefinitions;!t||t.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],i=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach(((t,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":i.push(s);break;case"entity":e.push(s)}})),this.memberEntityTypes=e,this.memberRelationshipTypes=i}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach((i=>{e(i)}))}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const i=new Set,t=[];for(const a of e){if(!this._graphTypeLookup.has(a.typeName))continue;!1===this.layers.concat(this.tables).some((e=>e.objectType.name===a.typeName))&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),i.add(a.typeName));r(this.sublayerIdsCache,a.typeName,(()=>new Set)).add(a.id),t.push(a)}this.dataManager.addToLayer(t);for(const a of i){const e=this._graphTypeLookup.get(a);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a))}await _(this,Array.from(i)),this._refreshNamedTypes()}_createSublayers(e,i,t){e.forEach((e=>{const a=this._createSublayer(e);t(a)&&i.push(a),this._updateSublayerCaches(e)}))}_addSublayer(e){const i=this._createSublayer(e);return i.geometryType?this.layers.push(i):this.tables.push(i),i}_createSublayer(e){return new S({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,i){i.forEach((i=>{i.parentCompositeLayer=this;const t=e.find((e=>e.type===i.graphType&&e.name===i.graphTypeName));t&&(i.objectType=t,this._updateSublayerCaches(t))}))}_updateSublayerCaches({name:e}){if(!e)return;const i=this.dataManager.sublayerCaches;i.has(e)||i.set(e,new Map)}_saveUrlAsNewResource(e,i,t,a){e[i]="<pending>",t.pendingOperations.push(O(this.inclusionModeDefinition).then((s=>{const o=K(a);e[i]=o.itemRelativeUrl,t.toAdd.push({resource:o,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})})))}_displaysAllRecords(e){for(const[,{useAllData:i}]of e.namedTypeDefinitions)if(!i)return!1;return!0}_handleSublayersChange(e,i){i&&(i.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=w.PORTAL_ITEM&&e<w.USER}readDefinitionSetMap(e,i,t){return I(e,t)}writeDefinitionSetMap(e,i,t,a){const s=a?.portalItem,o=a?.resources,r=b(a?.origin);if(!s||!o||null==r)return void(e&&(i[t]=x(e,a)));const{inclusionModeDefinition:n}=this;if(!n||this._displaysAllRecords(n))return void(this.definitionSetMap=null);const p=this.originIdOf("inclusionModeDefinition");if(p===w.USER||this._namedTypesModified||r<p)this._saveUrlAsNewResource(i,t,o,s);else if(r===p&&e){const r=x(e,a);h(r)?this._saveUrlAsNewResource(i,t,o,s):i[t]=r}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.originIdOf("layers")===w.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===w.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,i)=>{const t=r(this.sublayerIdsCache,i,(()=>new Set));e.members?.forEach((e=>{t.add(e.id)}))}))}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const i=this._graphTypeLookup.get(e);if(!i)throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),r(this.sublayerIdsCache,e,(()=>new Set));const t=this._addSublayer(i);return"entity"===i.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await _(this,[e]),this._refreshNamedTypes(),t}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);i?.useAllData?o.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!i||i.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else o.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||o.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&o.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())r(this.sublayerIdsCache,e,(()=>new Set)),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const i=[];for(const t of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id)&&i.push(t);this.dataManager.removeFromLayer(i);for(const t of i)this.sublayerIdsCache.get(t.typeName)?.delete(t.id);return this._refreshNamedTypes(),i}};e([m()],R.prototype,"dataManager",void 0),e([m({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],R.prototype,"definitionSetMap",void 0),e([u("definitionSetMap")],R.prototype,"readDefinitionSetMap",null),e([g("definitionSetMap")],R.prototype,"writeDefinitionSetMap",null),e([m()],R.prototype,"inclusionModeDefinition",null),e([m()],R.prototype,"knowledgeGraph",void 0),e([m({type:a.ofType(S),json:{write:{ignoreOrigin:!0}}})],R.prototype,"layers",void 0),e([m()],R.prototype,"memberEntityTypes",void 0),e([m()],R.prototype,"memberRelationshipTypes",void 0),e([m({type:["KnowledgeGraphLayer"]})],R.prototype,"operationalLayerType",void 0),e([m()],R.prototype,"sublayerIdsCache",void 0),e([m({type:a.ofType(S),json:{write:{ignoreOrigin:!0}}})],R.prototype,"tables",void 0),e([m({json:{read:!1}})],R.prototype,"type",void 0),e([m(N)],R.prototype,"url",void 0),R=e([f("esri.layers.KnowledgeGraphLayer")],R);const U=R;async function O(e){const i=await t(e);return new Blob([i],{type:"application/x-protobuf"})}function K(e){const i=`definitionSetMap-${c()}.dat`,t=y("knowledgeGraphLayer",i);return e.resourceFromPath(t)}export{U as default};
|
package/layers/LinkChartLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{serializationUtilsModuleWrapper as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import i from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as r,isAbortError as l,createAbortError as h}from"../core/promiseUtils.js";import{watch as d,sync as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as y,idToName as g}from"../core/accessorSupport/PropertyOrigin.js";import m from"../geometry/Extent.js";import f from"../geometry/Point.js";import L from"../geometry/Polyline.js";import w from"./Layer.js";import{convertFromGeometry as b}from"./graphics/featureConversionUtils.js";import{systemOidFieldName as M,systemOriginIdFieldName as k,systemDestinationIdFieldName as C,systemLayoutGeometryFieldName as T,systemAggregationCountFieldName as N}from"./knowledgeGraph/constants.js";import{IdealEdgeLengthTypeOptions as D}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as v}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import x from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as I}from"./knowledgeGraph/layerUtils.js";import E from"./knowledgeGraph/SessionMemoryStorage.js";import{convertLayoutTypeToWebSupportedFormat as S,getRelationshipEndNodeIds as _}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as A}from"./mixins/BlendLayer.js";import{OperationalLayer as R}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{url as G}from"./support/commonProperties.js";import{LCChronologicalLayout as z,LCSimpleLayout as P,LCSmartTreeLayout as F,LCRadialTreeLayout as O,LCHierarchicalLayout as U,LCCommunityLayout as B,LCForceDirectedLayout as Q,NodeFlag as W,load as $,CallStatus as H,LinkType as K}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as V}from"../rest/knowledgeGraphService.js";let q=class extends(R(A(j(s(w))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(a.ofType(x)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(x)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new i("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(d((()=>this.layers.concat(this.tables)),((e,t)=>this._handleSublayersChange(e,t)),p))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],o=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new i("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,s)=>{const r=this._graphTypeLookup.get(s);if(!r)return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===r.type?t.has(s)||(t.add(s),o.push(r)):"entity"===r.type?t.has(s)||(t.add(s),a.push(r)):(n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))})):(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new v({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=o,this.dataManager=s}load(e){const a=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await I(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1})),await this._initializeDiagram(),this.layers.forEach((a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise((e=>{a.on("layerview-create",(()=>{e(null)}))})))})),this.tables.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t)};return this.addResolvingPromise(new Promise((i=>{V(this.url).then((async n=>{n.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),n.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}));const s=this.linkChart?.linkChartProperties;if(s?.originIdOf("entitiesUrl")===y.LINK_CHART&&(this.membershipModified=!1,this._originalInclusionList=await t.fetchAndConvertSerializedLinkChart({entitiesUrl:s?.entitiesUrl,relationshipsUrl:s?.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(n.dataModel),this.initializationLinkChartConfig={layoutSettings:s?.layoutSettings??void 0,layoutMode:S(s.layoutType)}),this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache){const e=E.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);if(a){o(this.dataManager.sublayerCaches,t,(()=>new Map)).set(i.id,a)}}await a()}else{const t="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{r(e),await a()})))}i(null)}))}))),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):n.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await _(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new i("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new i("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),o(this.sublayerIdsCache,e,(()=>new Set));const a=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),a.geometryType?this.layers.push(a):this.tables.push(a),await I(this,[e]),this._refreshNamedTypes(),a}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const r of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id))&&n.push(r);if(t){const e=new Set,t=[];for(const a of n)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const r of n)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);const o=a?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:o}),n.length>0&&(this.membershipModified=!0);const s=[];return this.layers.forEach((e=>{s.push(e.refreshCachedQueryEngine())})),await Promise.all(s),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id))),await this._handleNewRecords(a,t),i.length>0&&(this.membershipModified=!0),r(t?.signal)}catch(i){throw l(i)&&a.length>0&&await this.removeRecords(a,{overrideMembershipCheck:!0}),i}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===y.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===y.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{const a=o(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:b(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}}))}))}async calculateLinkChartLayout(e="organic-standard",t){const a=[],s=[],l=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{a.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{s.push({typeName:t,feature:e})}))})),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const d=new Map,p=new Map,c=new Map,u=new Map,y=new Uint8Array(a.length),g=new Float64Array(a.length),w=new Float64Array(a.length),D=new Float64Array(a.length),v=new Float64Array(a.length),x=new Uint32Array(s.length),I=new Uint32Array(s.length),E=new Float64Array(s.length),S=new Float64Array(s.length),_=[],A="organic-standard";let R=!1;const j=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let G,V="organic-standard",q=0,J=0;const X=z.apply;switch(V="geographic-organic-standard"===e?A:e,V){case"organic-standard":G=Q.apply;break;case"organic-community":G=B.apply;break;case"hierarchical-bottom-to-top":G=U.apply;break;case"radial-root-centric":G=O.apply;break;case"tree-left-to-right":G=F.apply;break;default:G=P.apply}let Y=!1;a.forEach((({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[M])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?y[q]=W.IsGeographic:y[q]=W.None;const n=t.lockedNodeLocations.get(i.attributes[M]);g[q]=n.x,w[q]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){y[q]=W.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":g[q]=t?.x,w[q]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(g[q]=e.x,w[q]=e.y):y[q]=W.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(g[q]=e.x,w[q]=e.y):y[q]=W.IsMovable;break;default:y[q]=W.IsMovable}(null==g[q]||null==w[q]||Number.isNaN(g[q])||Number.isNaN(w[q]))&&(y[q]=W.IsMovable,g[q]=0,w[q]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!Y&&t?.lockedNodeLocations?.has(i.attributes[M])&&(Y=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;D[q]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?i.attributes[s]:null;v[q]=r?new Date(r).getTime():NaN,g[q]=0,w[q]=0,y[q]=W.IsMovable}else y[q]=W.IsMovable,g[q]=0,w[q]=0;u.set(i.attributes[M],q),_[q]={feature:i,typeName:a},q++})),Y&&n.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let Z=!1;const ee=new Map;s.forEach((a=>{const i=a.feature.attributes[k],n=a.feature.attributes[C],o=u.get(i),s=u.get(n),r=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?r?.startField:null,d=h?a.feature.attributes[h]:null,p=r?.endField,c=p?a.feature.attributes[p]:null;if(void 0!==o&&void 0!==s){let t=i+"-"+n;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+c);const r=ee.get(t),h=r?.has(a.typeName);h||(x[J]=o,I[J]=s,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(E[J]=d?new Date(d).getTime():NaN,S[J]=c?new Date(c).getTime():NaN),void 0===r?ee.set(t,new Map([[a.typeName,J]])):r.set(a.typeName,J),J++),l.push(a)}else Z=!0,this.relationshipLinkChartDiagramLookup.set(i,null)})),Z&&n.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const te=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),ae=this._convertValidatedOrganicSettingsToCalculationSettings(te);await $();let ie=H.Error,ne=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:ie,links:ne,graphics:a}=X((()=>t?.signal?.aborted??!1),y,g,w,D,v,x.subarray(0,J),I.subarray(0,J),E.subarray(0,J),S.subarray(0,J),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),ie===H.Success&&(this.chronologicalAuxiliaryGraphics=a)}else({status:ie,links:ne}=G((()=>t?.signal?.aborted??!1),y,g,w,x.subarray(0,J),I.subarray(0,J),ae.computationBudgetTime,ae.idealEdgeLengthMultiplier,ae.repulsionRadiusMultiplier));if(r(t?.signal),ie===H.Error)throw new i("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(ie===H.Canceled)throw h();for(let i=0;i<_.length;i++){if(w[i]>84.9999?w[i]=84.9999:w[i]<-84.9999&&(w[i]=-84.9999),g[i]>179.9999?g[i]=179.9999:g[i]<-179.9999&&(g[i]=-179.9999),_[i].feature.attributes[T]=new f(g[i],w[i]),d.has(_[i].typeName)){const e=d.get(_[i].typeName);e?.set(_[i].feature.attributes[M],_[i].feature)}else{const e=new Map;e.set(_[i].feature.attributes[M],_[i].feature),d.set(_[i].typeName,e)}c.set(_[i].feature.attributes[M],_[i].feature);const e=b(_[i].feature.attributes[T]);this.entityLinkChartDiagramLookup.set(_[i].feature.attributes[M],_[i].feature.attributes[T]?e:null);const t=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,_[i].typeName,(()=>({useAllData:!1,members:new Map})));o(t.members,_[i].feature.attributes[M],(()=>({id:_[i].feature.attributes[M],linkChartLocation:void 0}))).linkChartLocation=_[i].feature.attributes[T];const{x:a,y:n}=_[i].feature.attributes[T];if(R)j.xmin=Math.min(j.xmin,a),j.xmax=Math.max(j.xmax,a),j.ymin=Math.min(j.ymin,n),j.ymax=Math.max(j.ymax,n);else{const e=1e-7;j.xmin=a-e,j.xmax=a+e,j.ymin=n-e,j.ymax=n+e,R=!0}}if(this.linkChartExtent.xmin=j.xmin,this.linkChartExtent.xmax=j.xmax,this.linkChartExtent.ymin=j.ymin,this.linkChartExtent.ymax=j.ymax,!ne)throw new i("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const oe=new Map,se=new Map,re=new Map,le=new Set;for(let i=0;i<l.length;i++){const a=[],s=l[i],r=s.feature.attributes[k],h=s.feature.attributes[C];let d=r+"-"+h;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(s.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?s.feature.attributes[a]:null,n=e?.endField;d+="-"+i+"-"+(n?s.feature.attributes[n]:null)}const y=ee.get(d).get(s.typeName),g=0===y?0:ne?.vertexEndIndex[y-1];if(!le.has(y)){if(le.add(y),ne.types[y]===K.Recursive){const e=[ne.vertices[2*g],ne.vertices[2*g+1]],t=[ne.vertices[2*(g+1)],ne.vertices[2*(g+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],o=[i[0]+n[1],i[1]-n[0]],s=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(o),a.push(t),a.push(s),a.push(e)}else{if(ne.types[y]!==K.Regular){n.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<ne.vertexEndIndex[y];e++)a.push([ne.vertices[2*e],ne.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=_[u.get(r)]?.feature.attributes[T],t=_[u.get(h)]?.feature.attributes[T];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);oe.has(d)?oe.get(d).push(a):oe.set(d,[a])}const m=oe.get(d);se.has(d)||(se.set(d,new Map),re.set(d,new Map));const f=se.get(d),w=re.get(d);f.has(s.typeName)||(f.set(s.typeName,m.shift()),w.set(s.typeName,0));const N=f.get(s.typeName);w.set(s.typeName,w.get(s.typeName)+1);const D=new L({paths:[N]});if(s.feature.attributes[T]=D,p.has(s.typeName)){const e=p.get(s.typeName);e?.set(s.feature.attributes[M],s.feature)}else{const e=new Map;e.set(s.feature.attributes[M],s.feature),p.set(s.typeName,e)}c.set(s.feature.attributes[M],s.feature);const v=b(s.feature.attributes[T]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[M],s.feature.attributes[T]?v:null);const x=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,s.typeName,(()=>({useAllData:!1,members:new Map})));o(x.members,s.feature.attributes[M],(()=>({id:s.feature.attributes[M],linkChartLocation:void 0}))).linkChartLocation=v}for(const i of l)i.feature.attributes[N]=re.get(i.feature.attributes[k]+"-"+i.feature.attributes[C])?.get(i.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:d,links:p,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new f({x:i.x,y:i.y})))}));return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),r(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),r(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach((e=>{a.set(e.objectType.name,e.timeInfo)})),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=[],i=[];for(const s of e){if(!this._graphTypeLookup.has(s.typeName))continue;this.dataManager.sublayerCaches.has(s.typeName)||(this.dataManager.sublayerCaches.set(s.typeName,new Map),a.push(s.typeName));o(this.sublayerIdsCache,s.typeName,(()=>new Set)).add(s.id),i.push(s)}this.dataManager.addToLayer(i);for(const o of a){const e=this._graphTypeLookup.get(o);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(o):this.dataManager.relationshipTypeNames.add(o),t.geometryType?this.layers.push(t):this.tables.push(t)}}await I(this,a,t),await this.dataManager.refreshCacheContent(e.map((e=>e.id)),void 0,void 0,void 0,t);const n={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[o,s]of this.entityLinkChartDiagramLookup.entries())s&&n.lockedNodeLocations.set(o,new f(s.coords[0],s.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,n)}_createSublayers(e,t,a){e.forEach((e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)}))}_updateSublayers(e,t){t.forEach((t=>{t.parentCompositeLayer=this;const a=e.find((e=>e.type===t.graphType&&e.name===t.graphTypeName));a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))}))}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=y.PORTAL_ITEM&&e<y.USER}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e?.members?.forEach((e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=b(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[k]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[C]);if(t&&a){const i=b(new L({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[M],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[M],null)}))}))):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig||{}}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=1,o=e=>a(e)&&e>=1,s=e=>Object.values(D).includes(e),r=e=>a(e)&&e>=0,l={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return l;const{computationBudgetTime:h,autoRepulsionRadius:d,repulsionRadiusMultiplier:p,absoluteIdealEdgeLength:c,multiplicativeIdealEdgeLength:u,idealEdgeLengthType:y}=t;return o(h)?l.computationBudgetTime=h:h&&n.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),l.autoRepulsionRadius=d,!d&&i(p)?l.repulsionRadiusMultiplier=p:d||(l.autoRepulsionRadius=!0,n.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&(s(y)?l.idealEdgeLengthType=y:void 0!==y&&n.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===y&&r(c)?l.absoluteIdealEdgeLength=c:"absolute-value"===y&&void 0!==c?n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===y&&r(u)?l.multiplicativeIdealEdgeLength=u:"multiplier"===y&&void 0!==u&&n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),l}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===D.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===D.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new x({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map((e=>e.name)).concat((e.relationshipTypes??[]).map((e=>e.name)))),i=new Set((e.entityTypes??[]).map((e=>e.name))),o=new Set((e.relationshipTypes??[]).map((e=>e.name)));if(this.layers){for(const a of this.layers)!a.graphType&&t.has(a.graphTypeName)&&(a.graphType=i.has(a.graphTypeName)?"entity":"relationship");const e=this.layers.filter((e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):o.has(e.graphTypeName))));this.setAtOrigin("layers",e,g(this.originIdOf("layers")))}else this.layers=new a;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map((e=>e.graphTypeName))??[],a=this.layers.map((e=>e.graphTypeName)).concat(t);for(const n of a)e.has(n)||this._originalInclusionList.namedTypeDefinitions.set(n,{useAllData:!1,members:new Map});const i=[];for(const o of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(o)||(n.getLogger(this).warn(`A named type, ${o}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(o));for(const n of i)this._originalInclusionList.namedTypeDefinitions.delete(n)}}};e([c(G)],q.prototype,"url",void 0),e([c()],q.prototype,"dataPreloadedInLocalCache",void 0),e([c()],q.prototype,"initializationLinkChartConfig",void 0),e([c()],q.prototype,"membershipModified",void 0),e([c()],q.prototype,"dataManager",void 0),e([c()],q.prototype,"initializationInclusionModeDefinition",null),e([c()],q.prototype,"knowledgeGraph",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],q.prototype,"layers",void 0),e([c({readOnly:!0})],q.prototype,"linkChart",null),e([c()],q.prototype,"entityLinkChartDiagramLookup",void 0),e([c()],q.prototype,"relationshipLinkChartDiagramLookup",void 0),e([c()],q.prototype,"linkChartExtent",void 0),e([c()],q.prototype,"memberEntityTypes",void 0),e([c()],q.prototype,"memberRelationshipTypes",void 0),e([c({type:["LinkChartLayer"]})],q.prototype,"operationalLayerType",void 0),e([c()],q.prototype,"sublayerIdsCache",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],q.prototype,"tables",void 0),e([c({json:{read:!1}})],q.prototype,"type",void 0),e([c({json:{read:!1}})],q.prototype,"chronologicalAuxiliaryGraphics",void 0),q=e([u("esri.layers.LinkChartLayer")],q);const J=q;export{J as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{serializationUtilsModuleWrapper as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import i from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as r,isAbortError as l,createAbortError as h}from"../core/promiseUtils.js";import{watch as d,sync as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as y,idToName as g}from"../core/accessorSupport/PropertyOrigin.js";import m from"../geometry/Extent.js";import f from"../geometry/Point.js";import L from"../geometry/Polyline.js";import w from"./Layer.js";import{convertFromGeometry as b}from"./graphics/featureConversionUtils.js";import{systemOidFieldName as M,systemOriginIdFieldName as k,systemDestinationIdFieldName as C,systemLayoutGeometryFieldName as T,systemAggregationCountFieldName as N}from"./knowledgeGraph/constants.js";import{IdealEdgeLengthTypeOptions as D}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as v}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import x from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as I}from"./knowledgeGraph/layerUtils.js";import E from"./knowledgeGraph/SessionMemoryStorage.js";import{convertLayoutTypeToWebSupportedFormat as S,getRelationshipEndNodeIds as _}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as A}from"./mixins/BlendLayer.js";import{OperationalLayer as R}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{url as G}from"./support/commonProperties.js";import{LCChronologicalLayout as z,LCSimpleLayout as P,LCSmartTreeLayout as F,LCRadialTreeLayout as O,LCHierarchicalLayout as U,LCCommunityLayout as B,LCForceDirectedLayout as Q,NodeFlag as W,load as $,CallStatus as H,LinkType as K}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as V}from"../rest/knowledgeGraphService.js";let q=class extends(R(A(j(s(w))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(a.ofType(x)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(x)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new i("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(d((()=>this.layers.concat(this.tables)),((e,t)=>this._handleSublayersChange(e,t)),p))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],o=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new i("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,s)=>{const r=this._graphTypeLookup.get(s);if(!r)return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===r.type?t.has(s)||(t.add(s),o.push(r)):"entity"===r.type?t.has(s)||(t.add(s),a.push(r)):(n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))})):(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new v({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=o,this.dataManager=s}load(e){const a=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await I(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1})),await this._initializeDiagram(),this.layers.forEach((a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise((e=>{a.on("layerview-create",(()=>{e(null)}))})))})),this.tables.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t)};return this.addResolvingPromise(new Promise((i=>{V(this.url).then((async n=>{n.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),n.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}));const s=this.linkChart?.linkChartProperties;if(s?.originIdOf("entitiesUrl")===y.LINK_CHART&&(this.membershipModified=!1,this._originalInclusionList=await t.fetchAndConvertSerializedLinkChart({entitiesUrl:s?.entitiesUrl,relationshipsUrl:s?.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(n.dataModel),this.initializationLinkChartConfig={layoutSettings:s?.layoutSettings??void 0,layoutMode:S(s.layoutType)}),this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache){const e=E.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);if(a){o(this.dataManager.sublayerCaches,t,(()=>new Map)).set(i.id,a)}}await a()}else{const t="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{r(e),await a()})))}i(null)}))}))),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):n.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await _(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new i("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new i("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),o(this.sublayerIdsCache,e,(()=>new Set));const a=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),a.geometryType?this.layers.push(a):this.tables.push(a),await I(this,[e]),this._refreshNamedTypes(),a}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const r of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id))&&n.push(r);if(t){const e=new Set,t=[];for(const a of n)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const r of n)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);const o=a?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:o}),n.length>0&&(this.membershipModified=!0);const s=[];return this.layers.forEach((e=>{s.push(e.refreshCachedQueryEngine())})),await Promise.all(s),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id))),await this._handleNewRecords(a,t),i.length>0&&(this.membershipModified=!0),r(t?.signal)}catch(i){throw l(i)&&a.length>0&&await this.removeRecords(a,{overrideMembershipCheck:!0}),i}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===y.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===y.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{const a=o(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:b(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}}))}))}async calculateLinkChartLayout(e="organic-standard",t){const a=[],s=[],l=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{a.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{s.push({typeName:t,feature:e})}))})),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const d=new Map,p=new Map,c=new Map,u=new Map,y=new Uint8Array(a.length),g=new Float64Array(a.length),w=new Float64Array(a.length),D=new Float64Array(a.length),v=new Float64Array(a.length),x=new Uint32Array(s.length),I=new Uint32Array(s.length),E=new Float64Array(s.length),S=new Float64Array(s.length),_=[],A="organic-standard";let R=!1;const j=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let G,V="organic-standard",q=0,J=0;const X=z.apply;switch(V="geographic-organic-standard"===e?A:e,V){case"organic-standard":G=Q.apply;break;case"organic-community":G=B.apply;break;case"hierarchical-bottom-to-top":G=U.apply;break;case"radial-root-centric":G=O.apply;break;case"tree-left-to-right":G=F.apply;break;default:G=P.apply}let Y=!1;a.forEach((({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[M])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?y[q]=W.IsGeographic:y[q]=W.None;const n=t.lockedNodeLocations.get(i.attributes[M]);g[q]=n.x,w[q]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){y[q]=W.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":g[q]=t?.x,w[q]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(g[q]=e.x,w[q]=e.y):y[q]=W.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(g[q]=e.x,w[q]=e.y):y[q]=W.IsMovable;break;default:y[q]=W.IsMovable}(null==g[q]||null==w[q]||Number.isNaN(g[q])||Number.isNaN(w[q]))&&(y[q]=W.IsMovable,g[q]=0,w[q]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!Y&&t?.lockedNodeLocations?.has(i.attributes[M])&&(Y=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;D[q]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?i.attributes[s]:null;v[q]=r?new Date(r).getTime():NaN,g[q]=0,w[q]=0,y[q]=W.IsMovable}else y[q]=W.IsMovable,g[q]=0,w[q]=0;u.set(i.attributes[M],q),_[q]={feature:i,typeName:a},q++})),Y&&n.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let Z=!1;const ee=new Map;s.forEach((a=>{const i=a.feature.attributes[k],n=a.feature.attributes[C],o=u.get(i),s=u.get(n),r=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?r?.startField:null,d=h?a.feature.attributes[h]:null,p=r?.endField,c=p?a.feature.attributes[p]:null;if(void 0!==o&&void 0!==s){let t=i+"-"+n;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+c);const r=ee.get(t),h=r?.has(a.typeName);h||(x[J]=o,I[J]=s,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(E[J]=d?new Date(d).getTime():NaN,S[J]=c?new Date(c).getTime():NaN),void 0===r?ee.set(t,new Map([[a.typeName,J]])):r.set(a.typeName,J),J++),l.push(a)}else Z=!0,this.relationshipLinkChartDiagramLookup.set(i,null)})),Z&&n.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const te=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),ae=this._convertValidatedOrganicSettingsToCalculationSettings(te);await $();let ie=H.Error,ne=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:ie,links:ne,graphics:a}=X((()=>t?.signal?.aborted??!1),y,g,w,D,v,x.subarray(0,J),I.subarray(0,J),E.subarray(0,J),S.subarray(0,J),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),ie===H.Success&&(this.chronologicalAuxiliaryGraphics=a)}else({status:ie,links:ne}=G((()=>t?.signal?.aborted??!1),y,g,w,x.subarray(0,J),I.subarray(0,J),ae.computationBudgetTime,ae.idealEdgeLengthMultiplier,ae.repulsionRadiusMultiplier));if(r(t?.signal),ie===H.Error)throw new i("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(ie===H.Canceled)throw h();for(let i=0;i<_.length;i++){if(w[i]>84.9999?w[i]=84.9999:w[i]<-84.9999&&(w[i]=-84.9999),g[i]>179.9999?g[i]=179.9999:g[i]<-179.9999&&(g[i]=-179.9999),_[i].feature.attributes[T]=new f(g[i],w[i]),d.has(_[i].typeName)){const e=d.get(_[i].typeName);e?.set(_[i].feature.attributes[M],_[i].feature)}else{const e=new Map;e.set(_[i].feature.attributes[M],_[i].feature),d.set(_[i].typeName,e)}c.set(_[i].feature.attributes[M],_[i].feature);const e=b(_[i].feature.attributes[T]);this.entityLinkChartDiagramLookup.set(_[i].feature.attributes[M],_[i].feature.attributes[T]?e:null);const t=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,_[i].typeName,(()=>({useAllData:!1,members:new Map})));o(t.members,_[i].feature.attributes[M],(()=>({id:_[i].feature.attributes[M],linkChartLocation:void 0}))).linkChartLocation=_[i].feature.attributes[T];const{x:a,y:n}=_[i].feature.attributes[T];if(R)j.xmin=Math.min(j.xmin,a),j.xmax=Math.max(j.xmax,a),j.ymin=Math.min(j.ymin,n),j.ymax=Math.max(j.ymax,n);else{const e=1e-7;j.xmin=a-e,j.xmax=a+e,j.ymin=n-e,j.ymax=n+e,R=!0}}if(this.linkChartExtent.xmin=j.xmin,this.linkChartExtent.xmax=j.xmax,this.linkChartExtent.ymin=j.ymin,this.linkChartExtent.ymax=j.ymax,!ne)throw new i("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const oe=new Map,se=new Map,re=new Map,le=new Set;for(let i=0;i<l.length;i++){const a=[],s=l[i],r=s.feature.attributes[k],h=s.feature.attributes[C];let d=r+"-"+h;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(s.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?s.feature.attributes[a]:null,n=e?.endField;d+="-"+i+"-"+(n?s.feature.attributes[n]:null)}const y=ee.get(d).get(s.typeName),g=0===y?0:ne?.vertexEndIndex[y-1];if(!le.has(y)){if(le.add(y),ne.types[y]===K.Recursive){const e=[ne.vertices[2*g],ne.vertices[2*g+1]],t=[ne.vertices[2*(g+1)],ne.vertices[2*(g+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],o=[i[0]+n[1],i[1]-n[0]],s=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(o),a.push(t),a.push(s),a.push(e)}else{if(ne.types[y]!==K.Regular){n.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<ne.vertexEndIndex[y];e++)a.push([ne.vertices[2*e],ne.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=_[u.get(r)]?.feature.attributes[T],t=_[u.get(h)]?.feature.attributes[T];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);oe.has(d)?oe.get(d).push(a):oe.set(d,[a])}const m=oe.get(d);se.has(d)||(se.set(d,new Map),re.set(d,new Map));const f=se.get(d),w=re.get(d);f.has(s.typeName)||(f.set(s.typeName,m.shift()),w.set(s.typeName,0));const N=f.get(s.typeName);w.set(s.typeName,w.get(s.typeName)+1);const D=new L({paths:[N]});if(s.feature.attributes[T]=D,p.has(s.typeName)){const e=p.get(s.typeName);e?.set(s.feature.attributes[M],s.feature)}else{const e=new Map;e.set(s.feature.attributes[M],s.feature),p.set(s.typeName,e)}c.set(s.feature.attributes[M],s.feature);const v=b(s.feature.attributes[T]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[M],s.feature.attributes[T]?v:null);const x=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,s.typeName,(()=>({useAllData:!1,members:new Map})));o(x.members,s.feature.attributes[M],(()=>({id:s.feature.attributes[M],linkChartLocation:void 0}))).linkChartLocation=v}for(const i of l)i.feature.attributes[N]=re.get(i.feature.attributes[k]+"-"+i.feature.attributes[C])?.get(i.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:d,links:p,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new f({x:i.x,y:i.y})))}));return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),r(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),r(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach((e=>{a.set(e.objectType.name,e.timeInfo)})),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=new Set,i=[],n=this.layers.concat(this.tables);for(const r of e){if(!this._graphTypeLookup.has(r.typeName))continue;!1===n.some((e=>e.objectType.name===r.typeName))&&(this.dataManager.sublayerCaches.set(r.typeName,new Map),a.add(r.typeName));o(this.sublayerIdsCache,r.typeName,(()=>new Set)).add(r.id),i.push(r)}this.dataManager.addToLayer(i);for(const o of a){const e=this._graphTypeLookup.get(o);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(o):this.dataManager.relationshipTypeNames.add(o),t.geometryType?this.layers.push(t):this.tables.push(t)}}await I(this,Array.from(a),t),await this.dataManager.refreshCacheContent(e.map((e=>e.id)),void 0,void 0,void 0,t);const s={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[o,r]of this.entityLinkChartDiagramLookup.entries())r&&s.lockedNodeLocations.set(o,new f(r.coords[0],r.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,s)}_createSublayers(e,t,a){e.forEach((e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)}))}_updateSublayers(e,t){t.forEach((t=>{t.parentCompositeLayer=this;const a=e.find((e=>e.type===t.graphType&&e.name===t.graphTypeName));a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))}))}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=y.PORTAL_ITEM&&e<y.USER}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e?.members?.forEach((e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=b(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[k]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[C]);if(t&&a){const i=b(new L({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[M],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[M],null)}))}))):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig||{}}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=1,o=e=>a(e)&&e>=1,s=e=>Object.values(D).includes(e),r=e=>a(e)&&e>=0,l={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return l;const{computationBudgetTime:h,autoRepulsionRadius:d,repulsionRadiusMultiplier:p,absoluteIdealEdgeLength:c,multiplicativeIdealEdgeLength:u,idealEdgeLengthType:y}=t;return o(h)?l.computationBudgetTime=h:h&&n.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),l.autoRepulsionRadius=d,!d&&i(p)?l.repulsionRadiusMultiplier=p:d||(l.autoRepulsionRadius=!0,n.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&(s(y)?l.idealEdgeLengthType=y:void 0!==y&&n.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===y&&r(c)?l.absoluteIdealEdgeLength=c:"absolute-value"===y&&void 0!==c?n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===y&&r(u)?l.multiplicativeIdealEdgeLength=u:"multiplier"===y&&void 0!==u&&n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),l}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===D.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===D.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new x({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map((e=>e.name)).concat((e.relationshipTypes??[]).map((e=>e.name)))),i=new Set((e.entityTypes??[]).map((e=>e.name))),o=new Set((e.relationshipTypes??[]).map((e=>e.name)));if(this.layers){for(const a of this.layers)!a.graphType&&t.has(a.graphTypeName)&&(a.graphType=i.has(a.graphTypeName)?"entity":"relationship");const e=this.layers.filter((e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):o.has(e.graphTypeName))));this.setAtOrigin("layers",e,g(this.originIdOf("layers")))}else this.layers=new a;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map((e=>e.graphTypeName))??[],a=this.layers.map((e=>e.graphTypeName)).concat(t);for(const n of a)e.has(n)||this._originalInclusionList.namedTypeDefinitions.set(n,{useAllData:!1,members:new Map});const i=[];for(const o of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(o)||(n.getLogger(this).warn(`A named type, ${o}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(o));for(const n of i)this._originalInclusionList.namedTypeDefinitions.delete(n)}}};e([c(G)],q.prototype,"url",void 0),e([c()],q.prototype,"dataPreloadedInLocalCache",void 0),e([c()],q.prototype,"initializationLinkChartConfig",void 0),e([c()],q.prototype,"membershipModified",void 0),e([c()],q.prototype,"dataManager",void 0),e([c()],q.prototype,"initializationInclusionModeDefinition",null),e([c()],q.prototype,"knowledgeGraph",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],q.prototype,"layers",void 0),e([c({readOnly:!0})],q.prototype,"linkChart",null),e([c()],q.prototype,"entityLinkChartDiagramLookup",void 0),e([c()],q.prototype,"relationshipLinkChartDiagramLookup",void 0),e([c()],q.prototype,"linkChartExtent",void 0),e([c()],q.prototype,"memberEntityTypes",void 0),e([c()],q.prototype,"memberRelationshipTypes",void 0),e([c({type:["LinkChartLayer"]})],q.prototype,"operationalLayerType",void 0),e([c()],q.prototype,"sublayerIdsCache",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],q.prototype,"tables",void 0),e([c({json:{read:!1}})],q.prototype,"type",void 0),e([c({json:{read:!1}})],q.prototype,"chronologicalAuxiliaryGraphics",void 0),q=e([u("esri.layers.LinkChartLayer")],q);const J=q;export{J as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,Lyr3DWasmWorkerOutputStatus as h,invalidLayerView as _}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as u}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as y}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as g}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as m}from"../views/3d/layers/support/makeScheduleFunction.js";var c,b;!function(e){e[e.Lifetime=0]="Lifetime",e[e.Jobs=1]="Jobs",e[e.Renderables=2]="Renderables"}(c||(c={})),function(e){e[e.Critical=0]="Critical",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info"}(b||(b={}));let f=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=b.Critical,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(c.Lifetime),this._debugFlags.add(c.Jobs),this._debugFlags.add(c.Renderables)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;t===b.Critical||t===b.Error?r.getLogger(this).error(e):t===b.Warning&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>b.Warning&&(r.getLogger(this).level="info"),this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a((()=>this.view.state?.contentCamera),(()=>this._updateWasmCamera()))]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach((e=>{e.abortController.abort()})),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then((()=>{this._worker?.destroy(),this._worker=null})),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(c.Lifetime,b.Error,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),d)}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);const r=this._layers.get(e.wasmLayerId);if(r){const s=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length,i),this._lyr3DMain._free(s),r.needFrame=!0,r.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():(this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=y().then((i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const r=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),s=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l="global"===this.view.viewingMode,d=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,h=this.view.heightModelInfo?.heightModel,_=!h||"gravity-related-height"===h;return this._lyr3DMain.initialize_lyr3d_wasm(o,r,s,a,n,e,t,l,_,d,this._debugLevel)?(this._worker=new u(m(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(c.Lifetime,b.Critical,"Lyr3d Main WASM failed to initialize",!1))})).catch((e=>{this._debugLog(c.Lifetime,b.Critical,`Lyr3d WASM failed to download error = ${e}`,!1)}))),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach((i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory})),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,r=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,r,i.maxMemory),this._layers.forEach((e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())}))}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(c.Jobs,b.Error,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i,r){const s=[];for(const a of e){const e=new URL(a),n=e.searchParams.get("session");n?this._session=n:!this._session||e.origin===r.origin&&e.pathname===r.pathname||e.searchParams.append("session",this._session),s.push(t(e.toString(),i).then((e=>e.data)))}return s}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},a={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},n=new URL(t.layerView.layer.url),o=this._getRequestPromises(e.urls,r,n);Promise.all(o).then((e=>(a.inputs=e,this._worker.invoke(a,i)))).then((e=>e)).catch((t=>(s(t)?this._debugLog(c.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(c.Jobs,b.Error,`job ${e.jobId} failed with error ${t}.`),{status:h.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}))).then((o=>{if(o.status===h.Failed)this._onJobFailed(t,o,e);else if(o.status===h.Succeeded)this._onJobSucceeded(t,o,e);else if(o.status===h.MissingInputs){const l=this._getRequestPromises(o.missingInputUrls,r,n);Promise.all(l).then((e=>{a.jobDescJson=o.jobDescJson,o.originalInputs?a.inputs=o.originalInputs:a.inputs=[],a.isMissingResourceCase=!0;for(const t of e)a.inputs.push(t);return this._worker.invoke(a,i)})).then((i=>{i.status===h.Failed?this._onJobFailed(t,i,e):i.status===h.Succeeded&&this._onJobSucceeded(t,i,e)})).catch((i=>{this._decrementJobCount(t),s(i)?this._debugLog(c.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(c.Jobs,b.Error,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}))}}))}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then((t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)})).catch((t=>{s(t)||this._debugLog(c.Renderables,b.Error,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)})))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)s.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const a=s.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url)return _;const i=this._lyr3DMain.get_next_layer_id(),r=new AbortController;this._layers.set(i,{layerView:e,abortController:r,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const s=g(t.elevationInfo);return this._lyr3DMain.add_layer(t.url,i,s)?(this._updateWasmCamera(),i):(this._layers.delete(i),_)}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:a,fov:n,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],f.prototype,"view",void 0),f=e([l("esri.layers.Lyr3DWasmPerSceneView")],f);const w=f;export{w as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,Lyr3DWasmWorkerOutputStatus as h,invalidLayerView as _}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as u}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as y}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as g}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as m}from"../views/3d/layers/support/makeScheduleFunction.js";var c,b;!function(e){e[e.Lifetime=0]="Lifetime",e[e.Jobs=1]="Jobs",e[e.Renderables=2]="Renderables"}(c||(c={})),function(e){e[e.Critical=0]="Critical",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info"}(b||(b={}));let f=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=b.Critical,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(c.Lifetime),this._debugFlags.add(c.Jobs),this._debugFlags.add(c.Renderables)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;t===b.Critical||t===b.Error?r.getLogger(this).error(e):t===b.Warning&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>b.Warning&&(r.getLogger(this).level="info"),this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a((()=>this.view.state?.contentCamera),(()=>this._updateWasmCamera()))]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach((e=>{e.abortController.abort()})),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then((()=>{this._worker?.destroy(),this._worker=null})),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(c.Lifetime,b.Error,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:d})}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),0;let e=0;return this._layers.forEach((t=>{t.layerView.wasmLayerId>=0&&++e})),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);const r=this._layers.get(e.wasmLayerId);if(r){const s=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length,i),this._lyr3DMain._free(s),r.needFrame=!0,r.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():(this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=y().then((i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const r=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),s=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l="global"===this.view.viewingMode,d=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,h=this.view.heightModelInfo?.heightModel,_=!h||"gravity-related-height"===h;return this._lyr3DMain.initialize_lyr3d_wasm(o,r,s,a,n,e,t,l,_,d,this._debugLevel)?(this._worker=new u(m(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(c.Lifetime,b.Critical,"Lyr3d Main WASM failed to initialize",!1))})).catch((e=>{this._debugLog(c.Lifetime,b.Critical,`Lyr3d WASM failed to download error = ${e}`,!1)}))),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach((i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory})),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,r=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,r,i.maxMemory),this._layers.forEach((e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())}))}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(c.Jobs,b.Error,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i,r){const s=[];for(const a of e){const e=new URL(a),n=e.searchParams.get("session");n?this._session=n:!this._session||e.origin===r.origin&&e.pathname===r.pathname||e.searchParams.append("session",this._session),s.push(t(e.toString(),i).then((e=>e.data)))}return s}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},a={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},n=new URL(t.layerView.layer.url),o=this._getRequestPromises(e.urls,r,n);Promise.all(o).then((e=>(a.inputs=e,this._worker.invoke(a,i)))).then((e=>e)).catch((t=>(s(t)?this._debugLog(c.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(c.Jobs,b.Error,`job ${e.jobId} failed with error ${t}.`),{status:h.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}))).then((o=>{if(o.status===h.Failed)this._onJobFailed(t,o,e);else if(o.status===h.Succeeded)this._onJobSucceeded(t,o,e);else if(o.status===h.MissingInputs){const l=this._getRequestPromises(o.missingInputUrls,r,n);Promise.all(l).then((e=>{a.jobDescJson=o.jobDescJson,o.originalInputs?a.inputs=o.originalInputs:a.inputs=[],a.isMissingResourceCase=!0;for(const t of e)a.inputs.push(t);return this._worker.invoke(a,i)})).then((i=>{i.status===h.Failed?this._onJobFailed(t,i,e):i.status===h.Succeeded&&this._onJobSucceeded(t,i,e)})).catch((i=>{this._decrementJobCount(t),s(i)?this._debugLog(c.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(c.Jobs,b.Error,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}))}}))}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then((t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)})).catch((t=>{s(t)||this._debugLog(c.Renderables,b.Error,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)})))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)s.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const a=s.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:_};const i=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON));if(0!==i.errorCode)return{wasmLayerId:_,check:i};const r=this._lyr3DMain.get_next_layer_id(),s=new AbortController;this._layers.set(r,{layerView:e,abortController:s,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const a=g(t.elevationInfo);return this._lyr3DMain.add_layer(t.url,r,a)?(this._updateWasmCamera(),{wasmLayerId:r}):(this._layers.delete(r),{wasmLayerId:_})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:a,fov:n,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],f.prototype,"view",void 0),f=e([l("esri.layers.Lyr3DWasmPerSceneView")],f);const w=f;export{w as default};
|
package/layers/VideoLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import l from"../core/Logger.js";import{clamp as s}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{watch as a,initial as p,whenOnce as u}from"../core/reactiveUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as d}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import m from"../geometry/Extent.js";import h from"../geometry/Polyline.js";import f from"../geometry/SpatialReference.js";import v from"./Layer.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{parse as S}from"./support/arcgisLayerUrl.js";import{url as T}from"./support/commonProperties.js";import b from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as C}from"./support/serviceCapabilitiesUtils.js";import x from"./support/TelemetryData.js";import I from"./support/TelemetryDisplay.js";import U from"./support/VideoFrame.js";import E from"./support/VideoTimeExtent.js";import w from"./video/VideoController.js";import{getFrameHorizonPoints as N,getGroundControlPoints as L,getTelemetryData as P,getServiceLayersInfo as J,getSensorTrailPoints as M,readVideoTimeExtent as R}from"./video/videoUtils.js";import k from"../symbols/SimpleMarkerSymbol.js";let V=[];const H=new t([255,127,0]),q=new k({angle:0,color:H,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"});let z=class extends(g(j(n(O(v))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new w,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbol=q,this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=f.WGS84,this.start=0,this.telemetryDisplay=null,this.telemetryColor=H,this.title=null,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.telemetryDisplay=new I({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([a((()=>this.metadata),(()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")})),a((()=>this.telemetry?.sensorLocation),(e=>this._setSensorTrail(e)),p)]),u((()=>this.loaded&&"can-play"===this.state&&this.duration>0)).then((()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)}))}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._fetchService(t)),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return C(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return N(this.metadata)}get groundControlPoints(){return L(this.metadata)}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get state(){return this.controller.state}get telemetry(){return P(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return J(t)}get videoTimeExtent(){return o(l.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=s(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const t=S(this.parsedUrl?.path);if(null==t)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let o=null;const{data:l,ssl:s}=await r(t.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e}),n=l;if(this.url=t.url.path,s&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let a=t?.sublayer;if(null==a&&n.layers?.length&&(a=n.layers[0].id),null==a)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${t.url.path}/${a}`,o=await r(this.url,{query:{f:"json",...this.customParameters},signal:e});const p={...n,...o.data};this.sourceJSON=p,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=M(e,V);V=[...t];const r=V.map((e=>e.toArray())),o=new h({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([y()],z.prototype,"autoplay",null),e([y({readOnly:!0})],z.prototype,"buffered",null),e([y({readOnly:!0,json:{read:!1}})],z.prototype,"capabilities",void 0),e([d("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],z.prototype,"readCapabilitiesFromService",null),e([y({readOnly:!0})],z.prototype,"codecs",void 0),e([y({readOnly:!0})],z.prototype,"connectionInfo",void 0),e([d("connectionInfo",["connectionUrl"])],z.prototype,"readConnectionInfo",null),e([y()],z.prototype,"controller",void 0),e([y({type:String})],z.prototype,"copyright",void 0),e([y({readOnly:!0,type:Date})],z.prototype,"created",void 0),e([y({type:Number})],z.prototype,"currentTime",null),e([y({type:String})],z.prototype,"description",void 0),e([y({type:Number})],z.prototype,"duration",null),e([y({readOnly:!0})],z.prototype,"elevationSource",void 0),e([y({type:Boolean})],z.prototype,"ended",null),e([y({type:U})],z.prototype,"frame",void 0),e([y({readOnly:!0,type:Number})],z.prototype,"frameCount",void 0),e([y()],z.prototype,"frameEffect",void 0),e([y()],z.prototype,"frameOpacity",void 0),e([y({type:m})],z.prototype,"fullExtent",void 0),e([y({readOnly:!0})],z.prototype,"frameHorizonPoints",null),e([y({readOnly:!0,nonNullable:!1,json:{read:{reader:R,source:"time"}},type:E})],z.prototype,"fullTimeExtent",void 0),e([y({readOnly:!0})],z.prototype,"groundControlPoints",null),e([y({type:m})],z.prototype,"initialExtent",void 0),e([y({readOnly:!0,json:{read:{source:"id"}}})],z.prototype,"layerId",void 0),e([y({type:Boolean})],z.prototype,"loop",null),e([y({readOnly:!0})],z.prototype,"metadata",null),e([y({readOnly:!0})],z.prototype,"mimeType",null),e([y({type:Boolean})],z.prototype,"muted",null),e([y({type:b})],z.prototype,"playbackInfo",void 0),e([y({type:Number})],z.prototype,"playbackRate",null),e([y({type:String})],z.prototype,"playerUrl",null),e([y({readOnly:!0})],z.prototype,"playing",null),e([y({readOnly:!0,json:{read:{source:"poster"}}})],z.prototype,"posterUrl",void 0),e([y({readOnly:!0})],z.prototype,"qualities",void 0),e([y()],z.prototype,"sensorSymbol",void 0),e([y({readOnly:!0})],z.prototype,"serviceItemId",void 0),e([y()],z.prototype,"sourceJSON",void 0),e([y({readOnly:!0})],z.prototype,"sourceQuality",void 0),e([y({readOnly:!0,json:{name:"serviceType"}})],z.prototype,"sourceType",void 0),e([y()],z.prototype,"spatialReference",void 0),e([y()],z.prototype,"start",void 0),e([y({readOnly:!0,type:String})],z.prototype,"state",null),e([y({readOnly:!0,type:x})],z.prototype,"telemetry",null),e([y({type:I})],z.prototype,"telemetryDisplay",void 0),e([y({type:t})],z.prototype,"telemetryColor",void 0),e([y({readOnly:!1,json:{read:{source:"name"}}})],z.prototype,"title",void 0),e([y({readOnly:!0})],z.prototype,"type",void 0),e([y(T)],z.prototype,"url",void 0),e([y({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],z.prototype,"version",void 0),e([y({readOnly:!0})],z.prototype,"videoElement",null),e([y({readOnly:!0})],z.prototype,"videoHeight",null),e([y({readOnly:!0,json:{read:!1}})],z.prototype,"videoLayersInfo",void 0),e([d("service","videoLayersInfo",["id","name","poster","serviceType","type"])],z.prototype,"readLayerInfosFromService",null),e([y({type:E,nonNullable:!1,readOnly:!0})],z.prototype,"videoTimeExtent",null),e([y({readOnly:!0})],z.prototype,"videoWidth",null),e([y({readOnly:!0})],z.prototype,"waiting",null),z=e([c("esri.layers.VideoLayer")],z);const D=z;export{D as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import l from"../core/Logger.js";import{clamp as s}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{watch as p,initial as a,whenOnce as u}from"../core/reactiveUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import c from"../geometry/Extent.js";import h from"../geometry/Polyline.js";import f from"../geometry/SpatialReference.js";import v from"./Layer.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{parse as j}from"./support/arcgisLayerUrl.js";import{url as b}from"./support/commonProperties.js";import T from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as C}from"./support/serviceCapabilitiesUtils.js";import w from"./support/TelemetryData.js";import x from"./support/TelemetryDisplay.js";import I from"./support/VideoFrame.js";import U from"./support/VideoTimeExtent.js";import E from"./video/VideoController.js";import{getFrameHorizonPoints as L,getGroundControlPoints as N,getTelemetryData as P,getServiceLayersInfo as J,getSensorTrailPoints as M,readVideoTimeExtent as R}from"./video/videoUtils.js";import k from"../symbols/SimpleFillSymbol.js";import V from"../symbols/SimpleLineSymbol.js";import z from"../symbols/SimpleMarkerSymbol.js";let F=[];const H=new t([255,127,0]),q=new t([0,0,0,.05]),D=new z({angle:0,color:H,size:10,style:"cross"}),G=new k({color:q,outline:new V({color:H,width:2})}),_=new V({color:H,width:1}),B=new z({angle:0,color:H,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),W=new V({color:H,width:1});let Q=class extends(g(O(n(S(v))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new E,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=D.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=G.clone(),this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbol=B.clone(),this.sensorSightLineSymbol=_.clone(),this.sensorTrailSymbol=W.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=f.WGS84,this.start=0,this.telemetryDisplay=null,this.telemetryColor=H,this.title=null,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.telemetryDisplay=new x({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([p((()=>this.metadata),(()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")})),p((()=>this.telemetry?.sensorLocation),(e=>this._setSensorTrail(e)),a)]),u((()=>this.loaded&&"can-play"===this.state&&this.duration>0)).then((()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)}))}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._fetchService(t)),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return C(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return L(this.metadata)}get groundControlPoints(){return N(this.metadata)}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get state(){return this.controller.state}get telemetry(){return P(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return J(t)}get videoTimeExtent(){return o(l.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=s(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const t=j(this.parsedUrl?.path);if(null==t)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let o=null;const{data:l,ssl:s}=await r(t.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e}),n=l;if(this.url=t.url.path,s&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let p=t?.sublayer;if(null==p&&n.layers?.length&&(p=n.layers[0].id),null==p)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${t.url.path}/${p}`,o=await r(this.url,{query:{f:"json",...this.customParameters},signal:e});const a={...n,...o.data};this.sourceJSON=a,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=M(e,F);F=[...t];const r=F.map((e=>e.toArray())),o=new h({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([y()],Q.prototype,"autoplay",null),e([y({readOnly:!0})],Q.prototype,"buffered",null),e([y({readOnly:!0,json:{read:!1}})],Q.prototype,"capabilities",void 0),e([m("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],Q.prototype,"readCapabilitiesFromService",null),e([y({readOnly:!0})],Q.prototype,"codecs",void 0),e([y({readOnly:!0})],Q.prototype,"connectionInfo",void 0),e([m("connectionInfo",["connectionUrl"])],Q.prototype,"readConnectionInfo",null),e([y()],Q.prototype,"controller",void 0),e([y({type:String})],Q.prototype,"copyright",void 0),e([y({readOnly:!0,type:Date})],Q.prototype,"created",void 0),e([y({type:Number})],Q.prototype,"currentTime",null),e([y({type:String})],Q.prototype,"description",void 0),e([y({type:Number})],Q.prototype,"duration",null),e([y({readOnly:!0})],Q.prototype,"elevationSource",void 0),e([y({type:Boolean})],Q.prototype,"ended",null),e([y({type:I})],Q.prototype,"frame",void 0),e([y()],Q.prototype,"frameCenterSymbol",void 0),e([y({readOnly:!0,type:Number})],Q.prototype,"frameCount",void 0),e([y()],Q.prototype,"frameEffect",void 0),e([y()],Q.prototype,"frameOpacity",void 0),e([y()],Q.prototype,"frameOutlineSymbol",void 0),e([y({type:c})],Q.prototype,"fullExtent",void 0),e([y({readOnly:!0})],Q.prototype,"frameHorizonPoints",null),e([y({readOnly:!0,nonNullable:!1,json:{read:{reader:R,source:"time"}},type:U})],Q.prototype,"fullTimeExtent",void 0),e([y({readOnly:!0})],Q.prototype,"groundControlPoints",null),e([y({type:c})],Q.prototype,"initialExtent",void 0),e([y({readOnly:!0,json:{read:{source:"id"}}})],Q.prototype,"layerId",void 0),e([y({type:Boolean})],Q.prototype,"loop",null),e([y({readOnly:!0})],Q.prototype,"metadata",null),e([y({readOnly:!0})],Q.prototype,"mimeType",null),e([y({type:Boolean})],Q.prototype,"muted",null),e([y({type:T})],Q.prototype,"playbackInfo",void 0),e([y({type:Number})],Q.prototype,"playbackRate",null),e([y({type:String})],Q.prototype,"playerUrl",null),e([y({readOnly:!0})],Q.prototype,"playing",null),e([y({readOnly:!0,json:{read:{source:"poster"}}})],Q.prototype,"posterUrl",void 0),e([y({readOnly:!0})],Q.prototype,"qualities",void 0),e([y()],Q.prototype,"sensorSymbol",void 0),e([y()],Q.prototype,"sensorSightLineSymbol",void 0),e([y()],Q.prototype,"sensorTrailSymbol",void 0),e([y({readOnly:!0})],Q.prototype,"serviceItemId",void 0),e([y()],Q.prototype,"sourceJSON",void 0),e([y({readOnly:!0})],Q.prototype,"sourceQuality",void 0),e([y({readOnly:!0,json:{name:"serviceType"}})],Q.prototype,"sourceType",void 0),e([y()],Q.prototype,"spatialReference",void 0),e([y()],Q.prototype,"start",void 0),e([y({readOnly:!0,type:String})],Q.prototype,"state",null),e([y({readOnly:!0,type:w})],Q.prototype,"telemetry",null),e([y({type:x})],Q.prototype,"telemetryDisplay",void 0),e([y({type:t})],Q.prototype,"telemetryColor",void 0),e([y({readOnly:!1,json:{read:{source:"name"}}})],Q.prototype,"title",void 0),e([y({readOnly:!0})],Q.prototype,"type",void 0),e([y(b)],Q.prototype,"url",void 0),e([y({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],Q.prototype,"version",void 0),e([y({readOnly:!0})],Q.prototype,"videoElement",null),e([y({readOnly:!0})],Q.prototype,"videoHeight",null),e([y({readOnly:!0,json:{read:!1}})],Q.prototype,"videoLayersInfo",void 0),e([m("service","videoLayersInfo",["id","name","poster","serviceType","type"])],Q.prototype,"readLayerInfosFromService",null),e([y({type:U,nonNullable:!1,readOnly:!0})],Q.prototype,"videoTimeExtent",null),e([y({readOnly:!0})],Q.prototype,"videoWidth",null),e([y()],Q.prototype,"volume",null),e([y({readOnly:!0})],Q.prototype,"waiting",null),Q=e([d("esri.layers.VideoLayer")],Q);const A=Q;export{A as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../core/lang.js";import{millisecondsPerTimeUnit as t}from"../../../core/timeUtils.js";import{polygonCentroid as i,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as a,getGeometryExtent as r}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as n}from"../../../geometry/support/quantizationUtils.js";import{isValid as o,equals as l}from"../../../geometry/support/spatialReferenceUtils.js";import u from"./AttributesBuilder.js";import{cleanFromGeometryEngine as c,getGeometry as m,transformCentroid as d}from"./geometryUtils.js";import{project as h}from"./projectionSupport.js";import{getDateInNumber as p}from"./queryUtils.js";import{makeEdgeCandidate as f,makeVertexCandidate as y}from"./SnappingCandidate.js";import{isDateField as g,isDateOnlyField as x,isTimestampOffsetField as T,isStringField as I,isTimeOnlyField as F}from"../../support/fieldUtils.js";import _ from"../../../rest/support/AutoIntervalBinParameters.js";import V from"../../../rest/support/DateBinParameters.js";import v from"../../../rest/support/FixedBoundariesBinParameters.js";import b from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as S,calculateStringStatistics as R,calculateStatistics as B,processSummaryStatisticsResult as z,calculateUniqueValuesCount as A,createUVResult as w,calculateClassBreaks as M,resolveCBResult as P,calculateHistogram as D,getAttributeComparator as q,calculatePercentile as N,binIndex as Z,getBinParams as j}from"../../../statistics/utils.js";const G="bin";class C{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new u(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,a=t?.length;if(!!!a)return 1;const r=new Map,n=new Map,o=new Set;for(const l of s){const{statisticType:s}=l,a="exceedslimit"!==s?l.onStatisticField:void 0;if(!n.has(a)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,r);i.push(t)}n.set(a,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=n.get(a);for(const t in u){const{data:s,items:a}=u[t],r=s.join(",");i&&!e.validateItems(a,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;o(this.query.outSR)&&!l(t.spatialReference,this.query.outSR)?e.queryGeometry=c({spatialReference:this.query.outSR,...h(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=c({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const s=this.featureAdapter,a=O(this.hasZ,this.hasM),{point:r,mode:n}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,d=this._getPointCreator(n,t,this.spatialReference,i),h=new H(null,0),p=new H(null,0),g={x:0,y:0,z:0};for(const x of this.items){const t=s.getGeometry(x);if(null==t)continue;const{coords:i}=t,n=t.isPoint?Q:t.lengths;if(h.coords=i,p.coords=i,e.returnEdge){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e;for(let t=0;t<i;t++,e+=a){if(!c&&t===i-1)continue;const n=h;n.coordsIndex=e;const y=p;y.coordsIndex=t===i-1?m:e+a;const T=g;if(!E(g,r,n,y))continue;const I=(r.x-T.x)/o,F=(r.y-T.y)/l,_=I*I+F*F;_<=1&&u.candidates.push(f(s.getObjectId(x),d(T),Math.sqrt(_),d(n),d(y)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e,f=p;f.coordsIndex=m;for(let t=0;t<i;t++,e+=a){const a=h;if(a.coordsIndex=e,c&&t===i-1&&a.x===f.x&&a.y===f.y)continue;const n=(r.x-a.x)/o,m=(r.y-a.y)/l,p=n*n+m*m;p<=1&&u.candidates.push(y(s.getObjectId(x),d(a),Math.sqrt(p)))}}}else if(m&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<n.length;i++){t.push(e);const s=n[i];e+=s*a,!c&&s>1&&t.push(e-a)}for(const i of t){const e=h;e.coordsIndex=i;const t=(r.x-e.x)/o,a=(r.y-e.y)/l,n=t*t+a*a;n<=1&&u.candidates.push(y(s.getObjectId(x),d(e),Math.sqrt(n)))}}}return u.candidates.sort(((e,t)=>e.distance-t.distance)),u}_getPointCreator(e,t,i,s){const a=null==s||l(i,s)?e=>e:e=>h(e,i,s),{hasZ:r}=this,n=0;return"3d"===e?r&&t?({x:e,y:t,z:i})=>a({x:e,y:t,z:i}):({x:e,y:t})=>a({x:e,y:t,z:n}):({x:e,y:t})=>a({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,minValue:n,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=g(m)||x(m)||T(m),h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:l,timeZone:u},this.items),p=S({normalizationType:a,normalizationField:s,minValue:n,maxValue:o}),f={value:.5,fieldType:m?.type},y=I(m)?R({values:h,supportsNullCount:p,percentileParams:f,outStatisticTypes:c}):B({values:h,minValue:n,maxValue:o,useSampleStdDev:!a,supportsNullCount:p,percentileParams:f,outStatisticTypes:c});return z(y,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:a,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:n},this.items,!1),l=A(o);return w(l,s,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items),p=M(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return P(p,n)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items);return D(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),a=t[0],r=this.fieldsIndex.get(a),n=!!t[1]&&"desc"===t[1].toLowerCase(),o=q(r?.type,n);e.sort(((e,t)=>{const s=i(e,a,r),n=i(t,a,r);return o(s,n)}))}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:m,resultRecordCount:d,resultOffset:h,returnZ:p,returnM:f}=e,y=null!=d&&t.length>(h||0)+d,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:s&&f,hasZ:a&&p,objectIdFieldName:r,spatialReference:c(u||o),transform:m&&n(m)||null}}_createFeatures(e,t){const i=new u(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:c,maxAllowableOffset:h,resultOffset:p,resultRecordCount:f,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=s&&g;let I=[],F=0;const _=[...t];if(this._sortFeatures(_,r,((e,t,s)=>i.getFieldValue(e,t,s))),this.geometryType&&(l||c)){const e=n(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!c)for(const s of _){const a=this.featureAdapter.getGeometry(s),r={attributes:i.getAttributes(s),geometry:m(this.geometryType,this.hasZ,this.hasM,a,h,e,x,T),metadata:this.featureAdapter.getMetadata?.(s)};t&&a&&!r.geometry&&(r.centroid=d(this,this.featureAdapter.getCentroid(s,this),e)),I[F++]=r}else if(!l&&c)for(const s of _)I[F++]={attributes:i.getAttributes(s),centroid:d(this,this.featureAdapter.getCentroid(s,this),e)};else for(const s of _)I[F++]={attributes:i.getAttributes(s),centroid:d(this,this.featureAdapter.getCentroid(s,this),e),geometry:m(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(s),h,e,x,T),metadata:this.featureAdapter.getMetadata?.(s)}}else for(const n of _){const e=i.getAttributes(n);e&&(I[F++]={attributes:e})}const V=p||0;if(null!=f){const e=V+f;I=I.slice(V,Math.min(I.length,e))}return I}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,i=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=O(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce(((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)}),0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],a=new Map,r=new Map,n=new Map,o=new Map,l=new u(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:m,having:d,orderByFields:h,resultRecordCount:p}=e,f=m?.length,y=!!f,g=y?m[0]:null,x=y&&!this.fieldsIndex.get(g);for(const u of c??[]){const{outStatisticFieldName:e,statisticType:c}=u,h=u,p="exceedslimit"!==c?u.onStatisticField:void 0,T="percentile_disc"===c||"percentile_cont"===c,F="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,_=y&&1===f&&(p===g||x)&&"count"===c;if(y){if(!n.has(p)){const e=[];for(const i of m){const s=this._getAttributeValues(l,i,t,a);e.push(s)}n.set(p,this._calculateUniqueValues(e,t,!F&&l.returnDistinctValues))}const i=n.get(p);if(!i)continue;const s=Object.keys(i);for(const r of s){const{count:s,data:n,items:u,itemPositions:c}=i[r],f=n.join(",");if(!d||l.validateItems(u,d)){const i=o.get(f)||{attributes:{}};if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(h,u);i.aggregateGeometries[t]=e}else{let r=null;if(_)r=s;else{const e=this._getAttributeValues(l,p,t,a),i=c.map((t=>e[t]));r=T&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,l.returnDistinctValues)}i.attributes[e]=r}let r=0;m.forEach(((e,t)=>i.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++r]=n[t])),o.set(f,i)}}}else if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(h,t);i.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(l,p,t,a);i.attributes[e]=T&&"statisticParameters"in h?this._getPercentileValue(h,s):this._getStatisticValue(h,s,r,l.returnDistinctValues)}const V="min"!==c&&"max"!==c||!I(this.fieldsIndex.get(p))&&!this._isAnyDateField(p)?null:this.fieldsIndex.get(p)?.type;s.push({name:e,alias:e,type:V||"esriFieldTypeDouble"})}const T=y?Array.from(o.values()):[i];return this._sortFeatures(T,h,((e,t)=>e.attributes[t])),p&&(T.length=Math.min(p,T.length)),{fields:s,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return g(t)||x(t)||T(t)||F(t)}async _getAggregateGeometry(e,t){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:c,spatialReference:d,geometryType:h,hasZ:p,hasM:f}=this,y=t.map((e=>m(h,p,f,c.getGeometry(e)))),g=n(d,y,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=g?a(g):r(o(d,y));x.aggregateGeometries={...e,spatialReference:d},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=g?i(g):s(r(o(d,y)));x.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},x.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(x.aggregateGeometries=g,x.outStatisticFieldName=u||"convexHull");return x}_getStatisticValue(e,t,i,s){const{onStatisticField:a,statisticType:r}=e;let n=null;n=i?.has(a)?i.get(a):I(this.fieldsIndex.get(a))||this._isAnyDateField(a)?R({values:t,returnDistinct:s}):B({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(a,n);return n["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:a}=e,{value:r,orderBy:n}=s,o=this.fieldsIndex.get(i);return N(t,{value:r,orderBy:n,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const a=this.fieldsIndex.get(t),r=i.map((i=>e.getFieldValue(i,t,a)));return s.set(t,r),r}_calculateUniqueValues(e,t,i){const s={},a=t.length;for(let r=0;r<a;r++){const a=t[r],n=[];for(const t of e)n.push(t[r]);const o=n.join(",");null==s[o]?s[o]={count:1,data:n,items:[a],itemPositions:[r]}:(i||s[o].count++,s[o].items.push(a),s[o].itemPositions.push(r))}return s}async _getDataValues(t,i,s=!0){const a=new u(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:r,scale:n,timeZone:o}=t;return r?a.getExpressionValues(i,r,{viewingMode:"map",scale:n,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(i,e(t),s)}async _calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,a=t.min??0,r=t.max??0,n=s.map((([e,t])=>({minValue:e,maxValue:t,count:0,items:[]})));for(let o=0;o<e.length;o++){const t=e[o],l=i[o];if(null!=t&&t>=a&&t<=r){const e=Z(s,t);e>-1&&(n[e].count++,n[e].items.push(l))}}return n}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:s,valueType:a}=t,r=[],n=[{name:s??i,alias:s??i,type:a??"esriFieldTypeString"},{name:G,alias:G,type:"esriFieldTypeInteger"}],o=new u(e,this.featureAdapter,this.fieldsIndex),l=new Map,c=[...this.items];this._sortFeatures(c,[i],((e,t,i)=>o.getFieldValue(e,t,i)));const m=this._getAttributeValues(o,i,c,l),d=this._calculateUniqueValues([m],c,o.returnDistinctValues);for(const u in d){const{items:t}=d[u],a=await this._createBinsResponse(e,t);if(r.push(...a.features.map((e=>({...e,attributes:{...e.attributes,[s??i]:u}})))),a.fields)for(const e of a.fields)n.some((t=>t.name===e.name))||n.push(e)}return{fields:n,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(_.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(V.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(v.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(b.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:s,normalizationField:a,numBins:r,normalizationType:n,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),m=j(c,{field:s,normalizationField:a,normalizationType:n,normalizationTotal:o,numBins:r,minValue:p(l,!1),maxValue:p(u,!1)}),d=await this._calculateHistogramBins(c,m,i);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,i,s){const{field:a,interval:r,start:n,end:o}=e,l=r.unit,u="quarters"===l?3*t.months:t[l],c=r.value*u/t.milliseconds,m=await this._getDataValues({field:e.field,timeZone:i.outTimeReference?.ianaTimeZone},s),d=F(this.fieldsIndex.get(a)),h=j(m,{field:a,classificationMethod:"defined-interval",definedInterval:c,minValue:p(n,d),maxValue:p(o,d)},!0),f=await this._calculateHistogramBins(m,h,s);return this._createFeaturesFromHistogramBins(f,i)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:s}=e,a=await this._getDataValues({field:s,timeZone:t.outTimeReference?.ianaTimeZone},i),r=F(this.fieldsIndex.get(s)),n=e.boundaries.map((e=>p(e,r))).sort(((e,t)=>e-t)),o=[];for(let c=0;c<n.length-1;c++)o.push([n[c],n[c+1]]);const l={intervals:o,min:n.at(0),max:n.at(-1)},u=await this._calculateHistogramBins(a,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n}=e,o=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),l=F(this.fieldsIndex.get(s)),u=j(o,{field:s,classificationMethod:"defined-interval",definedInterval:a,minValue:p(r,l),maxValue:p(n,l)},!0),c=await this._calculateHistogramBins(o,u,i);return this._createFeaturesFromHistogramBins(c,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,a=s||"lowerBoundary",r=i||"upperBoundary",n=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:G,alias:G,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;for(const m of e){const{minValue:e,maxValue:i,items:s}=m,d={attributes:{}};let h;if(d.attributes[a]=e,d.attributes[r]=i,l?(h=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},s),d.attributes[G]=++c,"flat"===t.bin.jsonStyle?n.push(...h.features.map((({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...d.attributes}:{...t,...d.attributes}})))):(d.stackedAttributes=h.features.map((({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t)),n.push(d))):(t.bin?.splitBy&&(d.attributes[G]=++c),h=await this._createStatisticsQueryResponse(t,s,d),n.push(d)),h.fields)for(const t of h.fields)o.some((e=>e.name===t.name))||o.push(t)}return"desc"===t.binOrder&&n.reverse(),{fields:o,features:n}}}function E(e,t,i,s){const a=s.x-i.x,r=s.y-i.y,n=t.x-i.x,o=t.y-i.y,l=a*a+r*r;if(0===l)return!1;const u=n*a+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+a*c,e.y=i.y+r*c,!0}function O(e,t){return e?t?4:3:t?3:2}class H{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const Q=[1];export{C as QueryEngineResult};
|
|
5
|
+
import{clone as e}from"../../../core/lang.js";import{millisecondsPerTimeUnit as t}from"../../../core/timeUtils.js";import{polygonCentroid as i,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as a,getGeometryExtent as r}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as n}from"../../../geometry/support/quantizationUtils.js";import{isValid as o,equals as l}from"../../../geometry/support/spatialReferenceUtils.js";import u from"./AttributesBuilder.js";import{cleanFromGeometryEngine as c,getGeometry as m,transformCentroid as d}from"./geometryUtils.js";import{project as h}from"./projectionSupport.js";import{getDateInNumber as p}from"./queryUtils.js";import{makeEdgeCandidate as f,makeVertexCandidate as y}from"./SnappingCandidate.js";import{isDateField as g,isDateOnlyField as x,isTimestampOffsetField as T,isStringField as I,isTimeOnlyField as F}from"../../support/fieldUtils.js";import _ from"../../../rest/support/AutoIntervalBinParameters.js";import V from"../../../rest/support/DateBinParameters.js";import v from"../../../rest/support/FixedBoundariesBinParameters.js";import b from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as S,calculateStringStatistics as R,calculateStatistics as B,processSummaryStatisticsResult as z,calculateUniqueValuesCount as A,createUVResult as w,calculateClassBreaks as M,resolveCBResult as P,calculateHistogram as D,getAttributeComparator as q,calculatePercentile as N,binIndex as Z,getBinParams as j}from"../../../statistics/utils.js";const G="bin";class C{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new u(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,a=t?.length;if(!!!a)return 1;const r=new Map,n=new Map,o=new Set;for(const l of s){const{statisticType:s}=l,a="exceedslimit"!==s?l.onStatisticField:void 0;if(!n.has(a)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,r);i.push(t)}n.set(a,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=n.get(a);for(const t in u){const{data:s,items:a}=u[t],r=s.join(",");i&&!e.validateItems(a,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;o(this.query.outSR)&&!l(t.spatialReference,this.query.outSR)?e.queryGeometry=c({spatialReference:this.query.outSR,...h(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=c({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const s=this.featureAdapter,a=O(this.hasZ,this.hasM),{point:r,mode:n}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,d=this._getPointCreator(n,t,this.spatialReference,i),h=new H(null,0),p=new H(null,0),g={x:0,y:0,z:0};for(const x of this.items){const t=s.getGeometry(x);if(null==t)continue;const{coords:i}=t,n=t.isPoint?Q:t.lengths;if(h.coords=i,p.coords=i,e.returnEdge){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e;for(let t=0;t<i;t++,e+=a){if(!c&&t===i-1)continue;const n=h;n.coordsIndex=e;const y=p;y.coordsIndex=t===i-1?m:e+a;const T=g;if(!E(g,r,n,y))continue;const I=(r.x-T.x)/o,F=(r.y-T.y)/l,_=I*I+F*F;_<=1&&u.candidates.push(f(s.getObjectId(x),d(T),Math.sqrt(_),d(n),d(y)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e,f=p;f.coordsIndex=m;for(let t=0;t<i;t++,e+=a){const a=h;if(a.coordsIndex=e,c&&t===i-1&&a.x===f.x&&a.y===f.y)continue;const n=(r.x-a.x)/o,m=(r.y-a.y)/l,p=n*n+m*m;p<=1&&u.candidates.push(y(s.getObjectId(x),d(a),Math.sqrt(p)))}}}else if(m&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<n.length;i++){t.push(e);const s=n[i];e+=s*a,!c&&s>1&&t.push(e-a)}for(const i of t){const e=h;e.coordsIndex=i;const t=(r.x-e.x)/o,a=(r.y-e.y)/l,n=t*t+a*a;n<=1&&u.candidates.push(y(s.getObjectId(x),d(e),Math.sqrt(n)))}}}return u.candidates.sort(((e,t)=>e.distance-t.distance)),u}_getPointCreator(e,t,i,s){const a=null==s||l(i,s)?e=>e:e=>h(e,i,s),{hasZ:r}=this,n=0;return"3d"===e?r&&t?({x:e,y:t,z:i})=>a({x:e,y:t,z:i}):({x:e,y:t})=>a({x:e,y:t,z:n}):({x:e,y:t})=>a({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,minValue:n,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=g(m)||x(m)||T(m),h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:l,timeZone:u},this.items),p=S({normalizationType:a,normalizationField:s,minValue:n,maxValue:o}),f={value:.5,fieldType:m?.type},y=I(m)?R({values:h,supportsNullCount:p,percentileParams:f,outStatisticTypes:c}):B({values:h,minValue:n,maxValue:o,useSampleStdDev:!a,supportsNullCount:p,percentileParams:f,outStatisticTypes:c});return z(y,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:a,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:n},this.items,!1),l=A(o);return w(l,s,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items),p=M(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return P(p,n)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items);return D(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),a=t[0],r=this.fieldsIndex.get(a),n=!!t[1]&&"desc"===t[1].toLowerCase(),o=q(r?.type,n);e.sort(((e,t)=>{const s=i(e,a,r),n=i(t,a,r);return o(s,n)}))}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:m,resultRecordCount:d,resultOffset:h,returnZ:p,returnM:f}=e,y=null!=d&&t.length>(h||0)+d,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:s&&f,hasZ:a&&p,objectIdFieldName:r,spatialReference:c(u||o),transform:m&&n(m)||null}}_createFeatures(e,t){const i=new u(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:c,maxAllowableOffset:h,resultOffset:p,resultRecordCount:f,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=s&&g;let I=[],F=0;const _=[...t];if(this._sortFeatures(_,r,((e,t,s)=>i.getFieldValue(e,t,s))),this.geometryType&&(l||c)){const e=n(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!c)for(const s of _){const a=this.featureAdapter.getGeometry(s),r={attributes:i.getAttributes(s),geometry:m(this.geometryType,this.hasZ,this.hasM,a,h,e,x,T),metadata:this.featureAdapter.getMetadata?.(s)};t&&a&&!r.geometry&&(r.centroid=d(this,this.featureAdapter.getCentroid(s,this),e)),I[F++]=r}else if(!l&&c)for(const s of _)I[F++]={attributes:i.getAttributes(s),centroid:d(this,this.featureAdapter.getCentroid(s,this),e)};else for(const s of _)I[F++]={attributes:i.getAttributes(s),centroid:d(this,this.featureAdapter.getCentroid(s,this),e),geometry:m(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(s),h,e,x,T),metadata:this.featureAdapter.getMetadata?.(s)}}else for(const n of _){const e=i.getAttributes(n);e&&(I[F++]={attributes:e})}const V=p||0;if(null!=f){const e=V+f;I=I.slice(V,Math.min(I.length,e))}return I}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,i=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=O(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce(((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)}),0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],a=new Map,r=new Map,n=new Map,o=new Map,l=new u(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:m,having:d,orderByFields:h,resultRecordCount:p}=e,f=m?.length,y=!!f,g=y?m[0]:null,x=y&&!this.fieldsIndex.get(g);for(const u of c??[]){const{outStatisticFieldName:e,statisticType:c}=u,h=u,p="exceedslimit"!==c?u.onStatisticField:void 0,T="percentile_disc"===c||"percentile_cont"===c,F="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,_=y&&1===f&&(p===g||x)&&"count"===c;if(y){if(!n.has(p)){const e=[];for(const i of m){const s=this._getAttributeValues(l,i,t,a);e.push(s)}n.set(p,this._calculateUniqueValues(e,t,!F&&l.returnDistinctValues))}const i=n.get(p);if(!i)continue;const s=Object.keys(i);for(const r of s){const{count:s,data:n,items:u,itemPositions:c}=i[r],f=n.join(",");if(!d||l.validateItems(u,d)){const i=o.get(f)||{attributes:{}};if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(h,u);i.aggregateGeometries[t]=e}else{let r=null;if(_)r=s;else{const e=this._getAttributeValues(l,p,t,a),i=c.map((t=>e[t]));r=T&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,l.returnDistinctValues)}i.attributes[e]=r}let r=0;m.forEach(((e,t)=>i.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++r]=n[t])),o.set(f,i)}}}else if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(h,t);i.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(l,p,t,a);i.attributes[e]=T&&"statisticParameters"in h?this._getPercentileValue(h,s):this._getStatisticValue(h,s,r,l.returnDistinctValues)}const V="min"!==c&&"max"!==c||!I(this.fieldsIndex.get(p))&&!this._isAnyDateField(p)?null:this.fieldsIndex.get(p)?.type;s.push({name:e,alias:e,type:V||"esriFieldTypeDouble"})}const T=y?Array.from(o.values()):[i];return this._sortFeatures(T,h,((e,t)=>e.attributes[t])),p&&(T.length=Math.min(p,T.length)),{fields:s,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return g(t)||x(t)||T(t)||F(t)}async _getAggregateGeometry(e,t){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:c,spatialReference:d,geometryType:h,hasZ:p,hasM:f}=this,y=t.map((e=>m(h,p,f,c.getGeometry(e)))),g=n(d,y,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=g?a(g):r(o(d,y));x.aggregateGeometries={...e,spatialReference:d},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=g?i(g):s(r(o(d,y)));x.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},x.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(x.aggregateGeometries=g,x.outStatisticFieldName=u||"convexHull");return x}_getStatisticValue(e,t,i,s){const{onStatisticField:a,statisticType:r}=e;let n=null;n=i?.has(a)?i.get(a):I(this.fieldsIndex.get(a))||this._isAnyDateField(a)?R({values:t,returnDistinct:s}):B({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(a,n);return n["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:a}=e,{value:r,orderBy:n}=s,o=this.fieldsIndex.get(i);return N(t,{value:r,orderBy:n,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const a=this.fieldsIndex.get(t),r=i.map((i=>e.getFieldValue(i,t,a)));return s.set(t,r),r}_calculateUniqueValues(e,t,i){const s={},a=t.length;for(let r=0;r<a;r++){const a=t[r],n=[];for(const t of e)n.push(t[r]);const o=n.join(",");null==s[o]?s[o]={count:1,data:n,items:[a],itemPositions:[r]}:(i||s[o].count++,s[o].items.push(a),s[o].itemPositions.push(r))}return s}async _getDataValues(t,i,s=!0){const a=new u(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:r,scale:n,timeZone:o}=t;return r?a.getExpressionValues(i,r,{viewingMode:"map",scale:n,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(i,e(t),s)}async _calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,a=t.min??0,r=t.max??0,n=s.map((([e,t])=>({minValue:e,maxValue:t,count:0,items:[]})));for(let o=0;o<e.length;o++){const t=e[o],l=i[o];if(null!=t&&t>=a&&t<=r){const e=Z(s,t);e>-1&&(n[e].count++,n[e].items.push(l))}}return n}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:s,valueType:a}=t,r=[],n=[{name:s??i,alias:s??i,type:a??"esriFieldTypeString"},{name:G,alias:G,type:"esriFieldTypeInteger"}],o=new u(e,this.featureAdapter,this.fieldsIndex),l=new Map,c=[...this.items];this._sortFeatures(c,[i],((e,t,i)=>o.getFieldValue(e,t,i)));const m=this._getAttributeValues(o,i,c,l),d=this._calculateUniqueValues([m],c,o.returnDistinctValues);for(const u in d){const{items:t}=d[u],a=await this._createBinsResponse(e,t);if(r.push(...a.features.map((e=>({...e,attributes:{...e.attributes,[s??i]:u}})))),a.fields)for(const e of a.fields)n.some((t=>t.name===e.name))||n.push(e)}return{fields:n,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(_.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(V.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(v.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(b.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:s,normalizationField:a,numBins:r,normalizationType:n,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),m=j(c,{field:s,normalizationField:a,normalizationType:n,normalizationTotal:o,numBins:r,minValue:p(l,!1),maxValue:p(u,!1)}),d=await this._calculateHistogramBins(c,m,i);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,i,s){const{field:a,interval:r,start:n,end:o}=e,l=r.unit,u="quarters"===l?3*t.months:t[l],c=r.value*u/t.milliseconds,m=await this._getDataValues({field:e.field,timeZone:i.outTimeReference?.ianaTimeZone},s),d=F(this.fieldsIndex.get(a)),h=j(m,{field:a,classificationMethod:"defined-interval",definedInterval:c,minValue:p(n,d),maxValue:p(o,d)},!1),f=await this._calculateHistogramBins(m,h,s);return this._createFeaturesFromHistogramBins(f,i)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:s}=e,a=await this._getDataValues({field:s,timeZone:t.outTimeReference?.ianaTimeZone},i),r=F(this.fieldsIndex.get(s)),n=e.boundaries.map((e=>p(e,r))).sort(((e,t)=>e-t)),o=[];for(let c=0;c<n.length-1;c++)o.push([n[c],n[c+1]]);const l={intervals:o,min:n.at(0),max:n.at(-1)},u=await this._calculateHistogramBins(a,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n}=e,o=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),l=F(this.fieldsIndex.get(s)),u=j(o,{field:s,classificationMethod:"defined-interval",definedInterval:a,minValue:p(r,l),maxValue:p(n,l)},!0),c=await this._calculateHistogramBins(o,u,i);return this._createFeaturesFromHistogramBins(c,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,a=s||"lowerBoundary",r=i||"upperBoundary",n=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:G,alias:G,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;for(const m of e){const{minValue:e,maxValue:i,items:s}=m,d={attributes:{}};let h;if(d.attributes[a]=e,d.attributes[r]=i,l?(h=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},s),d.attributes[G]=++c,"flat"===t.bin.jsonStyle?n.push(...h.features.map((({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...d.attributes}:{...t,...d.attributes}})))):(d.stackedAttributes=h.features.map((({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t)),n.push(d))):(t.bin?.splitBy&&(d.attributes[G]=++c),h=await this._createStatisticsQueryResponse(t,s,d),n.push(d)),h.fields)for(const t of h.fields)o.some((e=>e.name===t.name))||o.push(t)}return"desc"===t.binOrder&&n.reverse(),{fields:o,features:n}}}function E(e,t,i,s){const a=s.x-i.x,r=s.y-i.y,n=t.x-i.x,o=t.y-i.y,l=a*a+r*r;if(0===l)return!1;const u=n*a+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+a*c,e.y=i.y+r*c,!0}function O(e,t){return e?t?4:3:t?3:2}class H{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const Q=[1];export{C as QueryEngineResult};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import o from"../../Graphic.js";import e from"../../core/Error.js";import t from"../../geometry/Point.js";import r from"../../geometry/Polygon.js";import n from"../../geometry/Polyline.js";import i from"../GraphicsLayer.js";import{systemOidFieldName as s}from"./constants.js";import a from"./SessionMemoryStorage.js";import{Direction2D as l}from"../../libs/linkchartlayout/LinkChartLayout.js";import{layoutMap as m}from"../../linkChart/enums.js";import{executeQueryStreaming as c}from"../../rest/knowledgeGraphService.js";import y from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import p from"../../symbols/CIMSymbol.js";import f from"../../symbols/SimpleFillSymbol.js";import h from"../../symbols/TextSymbol.js";function d(o,e){const t=new Map;if(e.dataModel?.relationshipTypes)for(const r of e.dataModel.relationshipTypes)r.name&&t.set(r.name,[]);for(const r of o)t.has(r.typeName)&&t.get(r.typeName)?.push(r.id);return t}async function g(o,e,t){const r=[],n=d(o,e),i={},s=[];for(const[c,y]of n){if(y.length<1)continue;const o=`${c}_ids`;i[o]=y,s.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${o} RETURN id(n), labels(n)[0], id(m), labels(m)[0]`)}if(0===s.length)return[];const a=s.join(" UNION "),l=new y({openCypherQuery:a,bindParameters:i}),m=(await c(e,l,t?.requestOptions)).resultRowsStream.getReader();for(;;){const{done:o,value:e}=await m.read();if(o)break;for(const t of e)r.push({id:t[0],typeName:t[1]}),r.push({id:t[2],typeName:t[3]})}return r}async function u(o,e,t){const r=new Map,n=d(o,e),i={},s=[];for(const[c,y]of n){if(y.length<1)continue;const o=`${c}_ids`;i[o]=y,s.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${o} RETURN id(r), id(n), id(m)`)}if(0===s.length)return r;const a=s.join(" UNION "),l=new y({openCypherQuery:a,bindParameters:i}),m=(await c(e,l,t?.requestOptions)).resultRowsStream.getReader();for(;;){const{done:o,value:e}=await m.read();if(o)break;for(const t of e)r.set(t[0],[t[1],t[2]])}return r}const b="ESRI__ChronologicalLayoutOverlay",w=()=>b,x=e=>{const s=[],a={type:"CIMGeometricEffectCut",beginCut:3,endCut:3};for(const t of e.chronologicalAuxiliaryGraphics?.lines??[]){const e={type:"CIMSolidStroke",enable:!0,width:t.width,color:[t.color.r,t.color.g,t.color.b,Math.round(t.color.a/100*255)],effects:t.dashPattern.length>0?[{type:"CIMGeometricEffectDashes",dashTemplate:t.dashPattern,lineDashEnding:"NoConstraint"},a]:
|
|
5
|
+
import o from"../../Graphic.js";import e from"../../core/Error.js";import t from"../../geometry/Point.js";import r from"../../geometry/Polygon.js";import n from"../../geometry/Polyline.js";import i from"../GraphicsLayer.js";import{systemOidFieldName as s}from"./constants.js";import a from"./SessionMemoryStorage.js";import{Direction2D as l}from"../../libs/linkchartlayout/LinkChartLayout.js";import{layoutMap as m}from"../../linkChart/enums.js";import{executeQueryStreaming as c}from"../../rest/knowledgeGraphService.js";import y from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import p from"../../symbols/CIMSymbol.js";import f from"../../symbols/SimpleFillSymbol.js";import h from"../../symbols/TextSymbol.js";function d(o,e){const t=new Map;if(e.dataModel?.relationshipTypes)for(const r of e.dataModel.relationshipTypes)r.name&&t.set(r.name,[]);for(const r of o)t.has(r.typeName)&&t.get(r.typeName)?.push(r.id);return t}async function g(o,e,t){const r=[],n=d(o,e),i={},s=[];for(const[c,y]of n){if(y.length<1)continue;const o=`${c}_ids`;i[o]=y,s.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${o} RETURN id(n), labels(n)[0], id(m), labels(m)[0]`)}if(0===s.length)return[];const a=s.join(" UNION "),l=new y({openCypherQuery:a,bindParameters:i}),m=(await c(e,l,t?.requestOptions)).resultRowsStream.getReader();for(;;){const{done:o,value:e}=await m.read();if(o)break;for(const t of e)r.push({id:t[0],typeName:t[1]}),r.push({id:t[2],typeName:t[3]})}return r}async function u(o,e,t){const r=new Map,n=d(o,e),i={},s=[];for(const[c,y]of n){if(y.length<1)continue;const o=`${c}_ids`;i[o]=y,s.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${o} RETURN id(r), id(n), id(m)`)}if(0===s.length)return r;const a=s.join(" UNION "),l=new y({openCypherQuery:a,bindParameters:i}),m=(await c(e,l,t?.requestOptions)).resultRowsStream.getReader();for(;;){const{done:o,value:e}=await m.read();if(o)break;for(const t of e)r.set(t[0],[t[1],t[2]])}return r}const b="ESRI__ChronologicalLayoutOverlay",w=()=>b,x=e=>{const s=[],a={type:"CIMGeometricEffectCut",beginCut:3,endCut:3};for(const t of e.chronologicalAuxiliaryGraphics?.lines??[]){const e={type:"CIMSolidStroke",enable:!0,width:t.width,color:[t.color.r,t.color.g,t.color.b,Math.round(t.color.a/100*255)],effects:t.dashPattern.length>0?[{type:"CIMGeometricEffectDashes",dashTemplate:t.dashPattern,lineDashEnding:"NoConstraint"},a]:void 0},r={type:"CIMVectorMarker",enable:!0,size:10,frame:{xmin:-5,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[-2.06,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[t.color.r,t.color.g,t.color.b,Math.round(t.color.a/100*255)]}]}}],markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineEnd",offsetAlongLine:0}},i=new p({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:t.arrowheadSizeAtEnd?[e,r]:[e]}}});for(const a of t.elements){const e=new n({paths:[[[a.origin.x,a.origin.y],[a.destination.x,a.destination.y]]]});s.push(new o({geometry:e,symbol:i}))}}for(const t of e.chronologicalAuxiliaryGraphics?.polygons??[]){const e=new f({color:[t.color.r,t.color.g,t.color.b,t.color.a/100],style:"solid",outline:null});for(const n of t.elements){const t=new r({rings:[n.points.map((o=>[o.x,o.y]))]});s.push(new o({geometry:t,symbol:e}))}}for(const r of e.chronologicalAuxiliaryGraphics?.texts??[]){let e="middle",n="center";switch(r.direction?.value){case l.left:n="right";break;case l.right:n="left";break;case l.bottom:e="bottom"}for(const i of r.elements){const a=new h({color:[r.color.r,r.color.g,r.color.b,r.color.a/100],text:i.str,font:{size:r.height,weight:"bold"},verticalAlignment:e,horizontalAlignment:n}),l=new t({x:i.anchor.x,y:i.anchor.y});s.push(new o({geometry:l,symbol:a}))}}return new i({graphics:s,listMode:"hide",title:b,id:b})},M=(o,e)=>{const t=new Map;for(const n of[...e.entityTypes??[],...e.relationshipTypes??[]])for(const o of n.properties??[])o.geometryType&&"esriGeometryNull"!==o.geometryType&&t.set(n.name,o.name??"");const r=a.getInstance();for(const n of o)r.writeToStore([n],s,t.get(n.typeName??"")??"")},C=o=>m.get(o)??"radial-root-centric";function S(o){if(!o.spatialReference.isWGS84)throw new e("knowledge-graph:layer-support-utils","The utilsExtentToInBoundsRings function only supports WGS84 spatial references.");return o.clone().normalize().map((o=>[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]]))}export{C as convertLayoutTypeToWebSupportedFormat,x as getChronologicalOverlay,w as getDefaultChronologicalOverlayLayerId,g as getRelationshipEndNodeIds,u as getRelationshipEndNodeMap,M as loadRecordsIntoLocalCache,S as utilsExtentToInBoundsRings};
|