@arcgis/core 4.32.0-next.20241021 → 4.32.0-next.20241023
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/applications/MapViewer/templateUtils.d.ts +4 -0
- package/applications/MapViewer/templateUtils.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0b7ee57bec7ffac312f2.js +1 -0
- package/assets/esri/core/workers/chunks/{1ba1d9c867ec6a492af9.js → 0f3912bca9fe25eea75c.js} +1 -1
- package/assets/esri/core/workers/chunks/{842ebde78db9bfcaf07b.js → 1678d1d0ecb9b2af69a8.js} +1 -1
- package/assets/esri/core/workers/chunks/1d16ca7791f64dd7c7fb.js +1 -0
- package/assets/esri/core/workers/chunks/1d4be734ff961e313257.js +1 -0
- package/assets/esri/core/workers/chunks/{b292758308dfac4ba8ee.js → 2d8aa31dc96bbd014036.js} +1 -1
- package/assets/esri/core/workers/chunks/{53f648321c5fde26bfe4.js → 319e06888467f9f460ab.js} +1 -1
- package/assets/esri/core/workers/chunks/33cae7ece52a77394b05.js +1 -0
- package/assets/esri/core/workers/chunks/{210a954f5299fe105e0b.js → 539060ffb7f230fb1bd0.js} +1 -1
- package/assets/esri/core/workers/chunks/545441dcc8e915e63ff1.js +1 -0
- package/assets/esri/core/workers/chunks/{303f39b9b7bd33109df8.js → 587df97288a83721d251.js} +1 -1
- package/assets/esri/core/workers/chunks/5caa02a7a85d05e253b4.js +1 -0
- package/assets/esri/core/workers/chunks/5cfecb320e1dcd258b2e.js +1 -0
- package/assets/esri/core/workers/chunks/67018ef25736f0722f6e.js +1 -0
- package/assets/esri/core/workers/chunks/89f74819ac1b5884c149.js +1 -0
- package/assets/esri/core/workers/chunks/92b2d81ef16877341f97.js +1 -0
- package/assets/esri/core/workers/chunks/{e6e77cbdeb99d90caad1.js → 97f62fad6d416a666319.js} +1 -1
- package/assets/esri/core/workers/chunks/98c1956b2e27058c8a51.js +1 -0
- package/assets/esri/core/workers/chunks/9c8a910b6261a4d5da77.js +1 -0
- package/assets/esri/core/workers/chunks/ab6eaa3ae2e233f91a5e.js +1 -0
- package/assets/esri/core/workers/chunks/{63719f892a7d1025c7d3.js → b42c1ab7579a3c464f72.js} +1 -1
- package/assets/esri/core/workers/chunks/{03eba36affe6ed1f5a11.js → bc4ef18d0a02354186e3.js} +7 -7
- package/assets/esri/core/workers/chunks/{c71304c88fce556340ef.js → c859f73b57a764e99b02.js} +1 -1
- package/assets/esri/core/workers/chunks/cb3038ec3ef0d86bf2a0.js +1 -0
- package/assets/esri/core/workers/chunks/{ae20ca2008a2ea6a46b2.js → d8f4bd2b4366388f8a28.js} +1 -1
- package/assets/esri/core/workers/chunks/e71fa25ed45bae5a1adb.js +320 -0
- package/assets/esri/core/workers/chunks/{9c9a8a529494c6d1dfa3.js → ec9d5af8887854e821c8.js} +1 -1
- package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +14 -0
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +1 -1
- 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/Bufferer-BhkgvSV4.js +5 -0
- package/chunks/{Distance2DCalculator-DM4OojiI.js → Distance2DCalculator-BX0Ep7eP.js} +1 -1
- package/chunks/{GeodeticDistanceCalculator-DzvUOSaR.js → GeodeticDistanceCalculator-B5uO-Y_z.js} +1 -1
- package/chunks/OperatorCrosses.js +5 -0
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersects.js +5 -0
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +5 -0
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorTouches.js +5 -0
- package/chunks/OperatorWithin.js +5 -0
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/SSAOBlur.glsl.js +5 -5
- package/chunks/SideCalculator2D-CoWc8Oe3.js +1 -1
- package/chunks/Transformation2D.js +1 -1
- package/core/MemCache.js +1 -1
- package/core/MemCachePool.js +1 -1
- package/core/unitUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/operators/affineTransformOperator.js +1 -1
- package/geometry/operators/alphaShapeOperator.js +1 -1
- package/geometry/operators/areaOperator.js +1 -1
- package/geometry/operators/autoCompleteOperator.js +1 -1
- package/geometry/operators/boundaryOperator.js +1 -1
- package/geometry/operators/bufferOperator.js +1 -1
- package/geometry/operators/centroidOperator.js +1 -1
- package/geometry/operators/clipOperator.js +1 -1
- package/geometry/operators/containsOperator.js +1 -1
- package/geometry/operators/convexHullOperator.js +1 -1
- package/geometry/operators/crossesOperator.js +1 -1
- package/geometry/operators/cutOperator.js +1 -1
- package/geometry/operators/densifyOperator.js +1 -1
- package/geometry/operators/differenceOperator.js +1 -1
- package/geometry/operators/disjointOperator.js +1 -1
- package/geometry/operators/distanceOperator.js +1 -1
- package/geometry/operators/equalsOperator.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/generalizeOperator.js +1 -1
- package/geometry/operators/geodesicBufferOperator.js +1 -1
- package/geometry/operators/geodesicProximityOperator.js +1 -1
- package/geometry/operators/geodeticAreaOperator.js +1 -1
- package/geometry/operators/geodeticDensifyOperator.js +1 -1
- package/geometry/operators/geodeticDistanceOperator.js +1 -1
- package/geometry/operators/geodeticLengthOperator.js +1 -1
- package/geometry/operators/graphicBufferOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
- package/geometry/operators/gx/operatorGeodeticArea.js +1 -1
- package/geometry/operators/gx/operatorGeodeticDensify.js +1 -1
- package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
- package/geometry/operators/gx/operatorGeodeticLength.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorProject.js +1 -1
- package/geometry/operators/gx/operatorProximityGeodesic.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/integrateOperator.js +1 -1
- package/geometry/operators/intersectionOperator.js +1 -1
- package/geometry/operators/intersectsOperator.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/containsOperator.js +5 -0
- package/geometry/operators/json/crossesOperator.js +5 -0
- package/geometry/operators/json/disjointOperator.js +5 -0
- package/geometry/operators/json/intersectsOperator.js +5 -0
- package/geometry/operators/json/offsetOperator.js +5 -0
- package/geometry/operators/json/overlapsOperator.js +5 -0
- package/geometry/operators/json/touchesOperator.js +5 -0
- package/geometry/operators/json/withinOperator.js +5 -0
- package/geometry/operators/labelPointOperator.js +1 -1
- package/geometry/operators/lengthOperator.js +1 -1
- package/geometry/operators/linesToPolygonsOperator.js +1 -1
- package/geometry/operators/locateBetweenOperator.js +1 -1
- package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
- package/geometry/operators/offsetOperator.js +1 -1
- package/geometry/operators/overlapsOperator.js +1 -1
- package/geometry/operators/polygonOverlayOperator.js +1 -1
- package/geometry/operators/polygonSlicerOperator.js +1 -1
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/proximityOperator.js +1 -1
- package/geometry/operators/relateOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOperator.js +1 -1
- package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +5 -0
- package/geometry/operators/support/initNoPeFactory.js +5 -0
- package/geometry/operators/support/jsonConverter.js +5 -0
- package/geometry/operators/support/proximityResult.js +1 -1
- package/geometry/operators/symmetricDifferenceOperator.js +1 -1
- package/geometry/operators/touchesOperator.js +1 -1
- package/geometry/operators/unionOperator.js +1 -1
- package/geometry/operators/withinOperator.js +1 -1
- package/geometry/support/MeshVertexAttributes.js +1 -1
- package/interfaces.d.ts +134 -0
- package/layers/LinkChartLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/OptimizedGeometry.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/knowledgeGraph/supportUtils.js +1 -1
- package/layers/support/ElevationQueryTileCache.js +1 -1
- package/layers/support/ElevationTileData.js +1 -1
- package/layers/support/mediaUtils.js +1 -1
- package/layers/support/parquetLayerUtils.js +1 -1
- package/layers/support/rasterFunctions/ClipFunction.js +1 -1
- package/layers/support/rasterFunctions/clipUtils.js +1 -1
- package/layers/support/rasterFunctions/localUtils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/linkChart/LinkChartProperties.js +1 -1
- package/package.json +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/raster/renderers/rgb.js +1 -1
- package/smartMapping/raster/renderers/stretch.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
- package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.d.ts +4 -0
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/CachedMeshData.js +5 -0
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileTexture.js +1 -1
- package/views/3d/webgl/ManagedFBO.js +1 -1
- package/views/3d/webgl/ManagedFBOAttachment.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOPool.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/ProceduralTextureRepository.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/SSAOBlur.glsl.js +1 -1
- package/views/input/BrowserEventSource.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/VertexArrayObject.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLine2D.js +5 -0
- package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
- package/widgets/ElevationProfile/support/constants.js +1 -1
- package/widgets/ElevationProfile/support/visualizationUtils.js +5 -0
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/support/columnUtils.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/FeatureTable/support/templateUtils.js +5 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/assets/esri/core/workers/chunks/03d0394fff1463c224f9.js +0 -1
- package/assets/esri/core/workers/chunks/0c40cac18711f79f0a7d.js +0 -1
- package/assets/esri/core/workers/chunks/1a97f98facfc62a9fc69.js +0 -1
- package/assets/esri/core/workers/chunks/1e3ed3ee48c2977cff6f.js +0 -1
- package/assets/esri/core/workers/chunks/1fc064e37d030e449d5e.js +0 -1
- package/assets/esri/core/workers/chunks/4daab36de5efa03a8cbb.js +0 -1
- package/assets/esri/core/workers/chunks/77d129134c2a66cd86d8.js +0 -1
- package/assets/esri/core/workers/chunks/88bd9e023764da377aa7.js +0 -1
- package/assets/esri/core/workers/chunks/92ce57cb12d9a7a3699e.js +0 -1
- package/assets/esri/core/workers/chunks/a5675c989d00b7400f98.js +0 -1
- package/assets/esri/core/workers/chunks/c06c5c815b5e37717fa1.js +0 -1
- package/assets/esri/core/workers/chunks/ca1385e165aae8a32ca2.js +0 -1
- package/assets/esri/core/workers/chunks/ce8c1208916f54af7e68.js +0 -320
- package/assets/esri/core/workers/chunks/df51c93b2dbcc89efc23.js +0 -1
- package/assets/esri/core/workers/chunks/efa3c919261672871f2f.js +0 -1
- package/chunks/Bufferer-fr1_Nc47.js +0 -5
- package/geometry/operators/support/converterAPI.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{execute as r,executeMany as t,isSimpleAsFeature as n,supportsCurves as o}from"./gx/operatorSimplify.js";import{getSpatialReference as e,toGeometry as u,fromSpatialReference as p,fromGeometry as s}from"./support/
|
|
5
|
+
import{execute as r,executeMany as t,isSimpleAsFeature as n,supportsCurves as o}from"./gx/operatorSimplify.js";import{getSpatialReference as e,toGeometry as u,fromSpatialReference as p,fromGeometry as s}from"./support/apiConverter.js";function i(t){const n=e(t);return u(r(s(t),p(n),!1),n)}function a(r){const n=r.map(s),o=e(r);return t(n,p(o),!1).map((r=>u(r,o)))}function c(r){return n(s(r),p(e(r)),!1)}function f(){return o()}export{i as execute,a as executeMany,c as isSimple,f as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as r}from"../../core/arrayUtils.js";import{executeMany as t,supportsCurves as o}from"./gx/operatorSinglePartToMultiPart.js";import{fromGeometry as e,getSpatialReference as p,toGeometry as
|
|
5
|
+
import{isSome as r}from"../../core/arrayUtils.js";import{executeMany as t,supportsCurves as o}from"./gx/operatorSinglePartToMultiPart.js";import{fromGeometry as e,getSpatialReference as p,toGeometry as a}from"./support/apiConverter.js";function s(o){const s=o.map(e),i=p(o);return t(s).map((r=>a(r,i))).filter(r)}function i(){return o()}export{s as executeMany,i as supportsCurves};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{P as e}from"../../../chunks/Transformation2D.js";import{E as t,M as n,P as s,a,b as r,c as o,d as i}from"../../../chunks/QuadraticBezier.js";import{G as u}from"../../../chunks/Geometry.js";import"../../../geometry.js";import"./initNoPeFactory.js";import c from"../../Extent.js";import l from"../../Multipoint.js";import h from"../../Point.js";import m from"../../Polygon.js";import f from"../../Polyline.js";const p="_gxVersion",g=2,y=1;function C(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function x(e){switch(e.type){case"point":return V(e);case"multipoint":return M(e);case"polyline":return Z(e);case"polygon":return P(e);case"extent":return w(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function w(e){if(!e.getCacheValue(p)){const n=new t;n.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&n.setInterval(g,0,e.mmin,e.mmax),e.hasZ&&n.setInterval(y,0,e.zmin,e.zmax),e.setCacheValue(p,n)}return e.getCacheValue(p)}function M(e){if(!e.getCacheValue(p)){const t=new n,a=new s,r=e.points,o=e.hasM,i=e.hasZ,u=i?3:2;for(let e=0,n=r.length;e<n;e++){const n=r[e];a.setXYCoords(n[0],n[1]),i&&a.setZ(n[2]??0),o&&a.setM(n[u]??NaN),t.add(a)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function V(e){if(!e.getCacheValue(p)){const t=new s;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function P(e){if(!e.getCacheValue(p)){const t=new a;d(t,e),e.setCacheValue(p,t)}return e.getCacheValue(p)}function Z(e){if(!e.getCacheValue(p)){const t=new r;d(t,e),e.setCacheValue(p,t)}return e.getCacheValue(p)}function d(e,t){const n="polygon"===t.type,a=new s,r=n?t.rings:t.paths,o=t.hasM,i=t.hasZ,u=i?3:2;for(let s=0,c=r.length;s<c;s++){const t=r[s],c=n?t.length-1:t.length;for(let n=0;n<c;n++){const s=t[n];a.setXYCoords(s[0],s[1]),i&&a.setZ(s[2]??0),o&&a.setM(s[u]??NaN),0===n?e.startPathPoint(a):e.lineToPoint(a)}}}function j(e){if(e.wkid)return o(e.wkid);const t=e.wkt2||e.wkt;return t?i(t):null}function E(e,t){if(e)switch(e.getGeometryType()){case u.enumPoint:return X(e,t);case u.enumEnvelope:return v(e,t);case u.enumMultiPoint:return R(e,t);case u.enumPolyline:return k(e,t);case u.enumPolygon:return Y(e,t)}return null}function v(e,t){if(e.isEmpty())return null;const n=new c({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),s=e.getDescription();if(s.hasM()){const t=e.queryInterval(g,0);n.mmin=t.vmin,n.mmax=t.vmax}if(s.hasZ()){const t=e.queryInterval(y,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(p,e),n}function R(e,t){if(e.isEmpty())return null;const n=e.getDescription(),a=n.hasM(),r=n.hasZ(),o=[],i=new s;for(let s=0,c=e.getPointCount();s<c;s++){e.getPointByVal(s,i);const t=[i.getX(),i.getY()];r&&t.push(i.getZ()),a&&t.push(i.getM()),o.push(t)}const u=new l({hasM:a,hasZ:r,points:o,spatialReference:t});return u.setCacheValue(p,e),u}function X(t,n){if(t instanceof e)return new h({x:t.x,y:t.y,spatialReference:n});if(t.isEmpty())return null;const s=new h({x:t.getX(),y:t.getY(),spatialReference:n}),a=t.getDescription();return a.hasM()&&(s.m=t.getM()),a.hasZ()&&(s.z=t.getZ()),s.setCacheValue(p,t),s}function Y(e,t){if(e.isEmpty())return null;const n=new m({spatialReference:t});return z(n,e),n.setCacheValue(p,e),n}function k(e,t){if(e.isEmpty())return null;const n=new f({spatialReference:t});return z(n,e),n.setCacheValue(p,e),n}function z(e,t){const n="polygon"===e.type,a=t.getDescription(),r=a.hasM(),o=a.hasZ(),i=[],u=new s;for(let s=0,c=t.getPathCount();s<c;s++){i.push([]);for(let e=t.getPathStart(s),n=t.getPathEnd(s);e<n;e++){t.getPointByVal(e,u);const n=[u.getX(),u.getY()];o&&n.push(u.getZ()),r&&n.push(u.getM()),i[s].push(n)}n&&i[s].push(i[s][0].slice())}e.hasM=r,e.hasZ=o,n?e.rings=i:e.paths=i}export{w as fromExtent,x as fromGeometry,M as fromMultipoint,V as fromPoint,P as fromPolygon,Z as fromPolyline,j as fromSpatialReference,C as getSpatialReference,v as toExtent,E as toGeometry,R as toMultipoint,X as toPoint,Y as toPolygon,k as toPolyline};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{i as r}from"../../../chunks/QuadraticBezier.js";import"../../../chunks/Geometry.js";import"../../../chunks/Transformation2D.js";import{gradGcsIds as t,getMetersPerUnit as e,isProjectedWKT as s}from"../../../core/unitUtils.js";import{isGeographic as i}from"../../support/spatialReferenceUtils.js";r((r=>{let o,n;"number"==typeof r?o=r:n=r;const a={wkid:o,wkt:n};let m,p;if(n){m=s(n);const r=i(a);if(!m&&!r)throw new Error(`Unsupported WKT type: ${n}`)}else m=!i(a);return p=o&&t.has(o)?Math.PI/200:m?e(a):Math.PI/180,{isPCS:m,metersOrRadiansPerUnit:p,semiMajor:0,wkidOrWkt:r}}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{g as e,e as t,G as r,d as n,t as i}from"../../../chunks/Geometry.js";import{x as s,i as a}from"../../../chunks/Transformation2D.js";import{S as o,bl as d,bm as m,ad as u,bn as h,bo as _}from"../../../chunks/QuadraticBezier.js";import"./initNoPeFactory.js";const l={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backspace:"\b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_formfeed:"\f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_lt:"<".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_newline:"\n".charCodeAt(0),s_r:"r".charCodeAt(0),s_carriageReturn:"\r".charCodeAt(0),s_t:"t".charCodeAt(0),s_tab:"\t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class c{getOperatorType(){return 10405}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,r,n,i,s){k(e,t,r,n)}exportSpatialReference(t,r,n,i){e(0)}exportProjectionTransformation(t,r,n,i){e(0)}exportDatumTransformation(t,r,n,i){e(0)}static geometryTypeToString(t){return e(0),""}}function k(n,i,s,a,o){if(i||s){if(a.startObject(),null!==i){switch(i.getGeometryType()){case r.enumPolygon:p(!0,n,i,a);break;case r.enumPolyline:p(!1,n,i,a);break;case r.enumMultiPoint:T(n,i,a);break;case r.enumPoint:b(n,i,a);break;case r.enumEnvelope:g(n,i,a);break;case r.enumMultipatch:e(0);break;default:t("exportToJSON")}}null!==s&&(a.addFieldName("spatialReference"),y(n,s,a)),a.endObject()}}function p(t,r,i,s){const a=i.getImpl(),u=!!(2&r),h=!!(4&r),_=!!(8&r),l=a.hasAttribute(1)&&!u,c=a.hasAttribute(2)&&!h,k=a.hasAttribute(3)&&!_,p=a.hasNonLinearSegments();l&&(s.addFieldName("hasZ"),s.addBool(!0)),c&&(s.addFieldName("hasM"),s.addBool(!0)),t?p?s.addFieldName("curveRings"):s.addFieldName("rings"):p?s.addFieldName("curvePaths"):s.addFieldName("paths");let T=null;const b=[];if(i.isEmpty())s.startArray(),s.endArray();else{const e=17-(31&r>>13);s.startArray();const t=i.getPathCount();let _=0;const g=a.getAttributeStreamRef(0);let f=null,y=null,N=null;const v=new o;let C=null,A=null,F=null;p&&(C=a.getSegmentFlagsStreamRef(),A=a.getSegmentIndexStreamRef(),F=a.getSegmentDataStreamRef()),l&&(f=a.getAttributeStreamRef(1)),c&&(y=a.getAttributeStreamRef(2)),k&&(N=a.getAttributeStreamRef(3),T=d(3,0));for(let r=0;r<t;r++){s.startArray(),k&&b.push(0);const t=i.getPathEnd(r);if(_===t){s.endArray();continue}const a=i.isClosedPath(r);let o=g.read(2*_),d=g.read(2*_+1),p=l?f.read(_):Number.NaN,x=c?y.read(_):Number.NaN,j=k?N.read(_):0;S(l,c,o,d,p,x,e,s);let O=1;k&&(T.add(j),b[b.length-1]++);const D=o,I=d,E=p,w=x,V=j;let z=!1,R=0,P=Number.NaN,B=Number.NaN,K=0;for(let r=_+1,i=_,W=a?t+1:t;r<W;r++,i++){const a=null!==C?31&C.read(i):1;let _,W;if(r<t?(_=g.read(2*r),W=g.read(2*r+1),l&&(P=f.read(r)),c&&(B=y.read(r)),k&&(K=N.read(r))):(_=D,W=I,P=E,B=w,K=V),1!==a){z=!0,4===a?v.createEllipticArc():2===a?v.createCubicBezier():16===a?v.createQuadraticBezier():8===a?v.createQuadraticRationalBezier():n("JSON export.unsupported curve");const t=v.get(),r=A.read(i);t.setStartXYCoords(o,d),t.setEndXYCoords(_,W),l&&(t.setStartAttribute(1,0,p),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,x),t.setEndAttribute(2,0,B)),t.readFromBufferStream(F,r);m(v.get(),u,h,e,s)&&R++}else S(l,c,_,W,P,B,e,s);k&&(T.add(K),b[b.length-1]++),O++,o=_,d=W,p=P,x=B,j=K}z&&0===R||(O<2&&R<1&&(S(l,c,o,d,p,x,e,s),O++,k&&(T.add(j),b[b.length-1]++)),a&&O<3&&R<2&&(S(l,c,D,I,E,w,e,s),O++,o=D,d=I,p=E,x=w,j=V,k&&(T.add(V),b[b.length-1]++))),s.endArray(),_=t}s.endArray()}if(k){s.addFieldName("ids"),s.startArray();let t=0;for(let r=0,n=b.length;r<n;++r){const n=b[r];e(0===n||null!==T&&t+n<=T.size()),s.startArray();for(let e=0;e<n;++e)s.addInt32(T.read(t)),t++;s.endArray()}s.endArray()}}function T(t,r,n){const i=r.getImpl(),s=i.hasAttribute(1)&&!(2&t),a=i.hasAttribute(2)&&!(4&t),o=i.hasAttribute(3)&&!(8&t);s&&(n.addFieldName("hasZ"),n.addBool(!0)),a&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const d=r.getPointCount();if(r.isEmpty())n.startArray(),n.endArray();else{const e=17-(31&t>>13);n.startArray();const r=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let t=0;t<d;t++){const i=r.read(2*t),d=r.read(2*t+1);let u=Number.NaN,h=Number.NaN;s&&(u=o.read(t)),a&&(h=m.read(t)),S(s,a,i,d,u,h,e,n)}n.endArray()}if(o){let t=null;i.isEmpty()||(t=i.getAttributeStreamRef(3)),e(0===d||null!==t&&t.size()>=d),n.addFieldName("ids"),n.startArray();for(let e=0;e<d;e++)n.addInt32(t.read(e));n.endArray()}}function b(e,t,r){const n=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return r.addFieldName("x"),r.addNull(),r.addFieldName("y"),r.addNull(),n&&(r.addFieldName("z"),r.addNull()),i&&(r.addFieldName("m"),r.addNull()),void(s&&(r.addFieldName("id"),r.addInt32(0)));const a=17-(31&e>>13);r.addFieldName("x"),r.addDouble(t.getX(),a),r.addFieldName("y"),r.addDouble(t.getY(),a),n&&(r.addFieldName("z"),r.addDouble(t.getZ(),a)),i&&(r.addFieldName("m"),r.addDouble(t.getM(),a)),s&&(r.addFieldName("id"),r.addInt32(t.getID()))}function g(e,t,r){const n=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return r.addFieldName("xmin"),r.addNull(),r.addFieldName("ymin"),r.addNull(),r.addFieldName("xmax"),r.addNull(),r.addFieldName("ymax"),r.addNull(),n&&(r.addFieldName("zmin"),r.addNull(),r.addFieldName("zmax"),r.addNull()),i&&(r.addFieldName("mmin"),r.addNull(),r.addFieldName("mmax"),r.addNull()),void(s&&(r.addFieldName("idmin"),r.addInt32(0),r.addFieldName("idmax"),r.addInt32(0)));const a=17-(31&e>>13);if(r.addFieldName("xmin"),r.addDouble(t.getXMin(),a),r.addFieldName("ymin"),r.addDouble(t.getYMin(),a),r.addFieldName("xmax"),r.addDouble(t.getXMax(),a),r.addFieldName("ymax"),r.addDouble(t.getYMax(),a),n){const e=t.queryInterval(1,0);r.addFieldName("zmin"),r.addDouble(e.vmin,a),r.addFieldName("zmax"),r.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);r.addFieldName("mmin"),r.addDouble(e.vmin,a),r.addFieldName("mmax"),r.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);r.addFieldName("idmin"),r.addInt32(e.vmin),r.addFieldName("idmax"),r.addInt32(e.vmax)}}function f(e,t,r){r.startObject();const n=t.getID();n<=0&&i("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(n),r.endObject()}function y(e,t,r){r.startObject();let n=0;t.isCustomWkid()||(n=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(n=0)),n>0){r.addFieldName("wkid"),r.addInt32(n);const e=t.getLatestID();if(e>0&&e!==n&&(r.addFieldName("latestWkid"),r.addInt32(e)),i>0){r.addFieldName("vcsWkid"),r.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(r.addFieldName("latestVcsWkid"),r.addInt32(e))}}if(0===t.getCoordinateSystemType())r.addFieldName("wkid"),r.addNull(),null!==t.getUnit()&&(r.addFieldName("unit"),f(e,t.getUnit(),r));else if(n<=0||1&e){let n="";64&e&&(n=t.getText2(),r.addFieldName("wkt2"),r.addString(n));const i=t.getText();i!==n&&(r.addFieldName("wkt"),r.addString(i))}if(16&e){const e=new u;t.queryPrecisionDescriptor(e),r.addFieldName("xyTolerance"),r.addDouble(e.getTolerance(0)),r.addFieldName("zTolerance"),r.addDouble(e.getTolerance(1)),r.addFieldName("mTolerance"),r.addDouble(e.getTolerance(2)),r.addFieldName("falseX"),r.addDouble(e.getFalseX()),r.addFieldName("falseY"),r.addDouble(e.getFalseY()),r.addFieldName("xyUnits"),r.addDouble(e.getGridUnitsXY()),r.addFieldName("falseZ"),r.addDouble(e.getFalseZ()),r.addFieldName("zUnits"),r.addDouble(e.getGridUnitsZ()),r.addFieldName("falseM"),r.addDouble(e.getFalseM()),r.addFieldName("mUnits"),r.addDouble(e.getGridUnitsM())}r.endObject()}function S(e,t,r,n,i,s,a,o){o.startArray(),o.addDouble(r,a),o.addDouble(n,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function N(e){return{m_iteratorType:"object",m_o:e,m_keys:Object.keys(e),m_i:-1,m_bReturnKey:!0,next:v}}function v(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function C(e){return{m_iteratorType:"array",m_i:-1,m_a:e,next:A}}function A(){return-1===this.m_i?(this.m_i=0,{value:{m_token:2,m_value:null},done:!1}):this.m_i<this.m_a.length?{value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1}:{value:{m_token:4,m_value:null},done:!0}}class F{constructor(e){this.m_currentToken=0;const t=e;this.m_iteratorStack=[t instanceof Array?C(t):N(t)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(C(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(N(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=s()&&this.m_currentValue<=a()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;t("unrecognized json element type")}return t("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){e(0)}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&i("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&i("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&i("invalid token"),this.m_currentValue}currentInt64Value(){return e(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&i("invalid token"),this.m_currentValue}isError(){return 0}}class x{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(t){e(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class j{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push((()=>this.accept_())),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):(t.jsonStream,e(0))}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){e(0)}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push((()=>this.start_())),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(t){e(0)}resetToPosition(t){return e(0),!1}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return e(0),""}childrenAsString(){return e(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1!==this.m_currentTokenType)if(2!==this.m_currentTokenType);else{let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e)}else{let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e)}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}i("invalid token")}toUTF8_(e,t){let r=0,n=e;for(;t.charCodeAt(n)===l.s_backslash&&t.charCodeAt(n+1)===l.s_u;)r++,n+=6;n=e;const i=new Uint8Array(r);let s=0;for(;t.charCodeAt(n)===l.s_backslash&&t.charCodeAt(n+1)===l.s_u;)i[s++]=Number.parseInt(t.slice(n+2,n+6),16),n+=6;return{u8s:this.m_utf8Decoder.decode(i),end:n}}unquoteCurrentString_(){let e="",t=1;const r=this.m_endToken-this.m_startToken-1;let n=0;const i=this.m_getCurrentSubstr();for(let s=t;s<r;s++)if(i.charCodeAt(s)!==l.s_backslash)n++;else{switch(n>0&&(e+=i.slice(t,t+n)),i.charCodeAt(++s)){case l.s_doubleQuote:e+='"';break;case l.s_u:{const{u8s:t,end:r}=this.toUTF8_(s-1,i);s=r-1,e+=t;break}case l.s_backslash:e+="\\";break;case l.s_forwardslash:e+="/";break;case l.s_b:e+="\b";break;case l.s_f:e+="\f";break;case l.s_n:e+="\n";break;case l.s_r:e+="\r";break;case l.s_t:e+="\t"}t=s+1,n=0}return n>0&&(e+=i.slice(t,t+n)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&i("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&i("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&i("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&i("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&i("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&i("invalid token"),r}currentInt64Value(){return e(0),0n}currentBoolValue(){return e(0),!1}isError(){return 0}JSONString(){return e(0),""}pushPosition(){return e(0),!1}popPosition(){return e(0),!1}skipCStyleComments_(){e(0)}skipCppStyleComments_(){e(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&i("invalid token"),e=this.m_peekChar(),e===l.s_asterisk?this.skipCStyleComments_():e===l.s_forwardslash?this.skipCppStyleComments_():i("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&i("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&i("invalid token"),t=this.m_peekChar();t===l.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===l.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===l.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&i("invalid token");let e=this.m_peekChar();for(;e!==l.s_doubleQuote;){const t=e===l.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&i("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===l.s_doubleQuote||e===l.s_backslash||e===l.s_forwardslash||e===l.s_b||e===l.s_f||e===l.s_n||e===l.s_r||e===l.s_t)this.m_stepOverChar(),this.m_eof()&&i("invalid token"),e=this.m_peekChar();else if(e===l.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&i("invalid token"),e=this.m_peekChar(),e>=l.s_zero&&e<=l.s_nine||e>=l.s_a&&e<=l.s_f||e>=l.s_A&&e<=l.s_F||i("invalid token");else i("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===l.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===l.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):i("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==l.s_doubleQuote&&i("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push((()=>this.fieldNameEnd_()))}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():i("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push((()=>this.elementEnd_())),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():i("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push((()=>this.pairEnd_())),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push((()=>this.objectStart_()))}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push((()=>this.arrayStart_()))}valueString_(){e(0)}int_(){this.m_peekChar()!==l.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&i("invalid token"),e=this.m_peekChar()}while(e>=l.s_zero&&e<=l.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&i("invalid token"),e=this.m_peekChar(),e>=l.s_zero&&e<=l.s_nine||i("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&i("invalid token"),e=this.m_peekChar(),e!==l.s_plus&&e!==l.s_minus||(this.m_stepOverChar(),this.m_eof()&&i("invalid token"),e=this.m_peekChar()),e>=l.s_zero&&e<=l.s_nine||i("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===l.s_minus?(this.m_stepOverChar(),this.m_eof()&&i("invalid token"),t=this.m_peekChar(),e=!0,t>=l.s_zero&&t<=l.s_nine||i("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===l.s_period)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==l.s_e&&t!==l.s_E||this.exp_();else if(t===l.s_e||t===l.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const r=this.m_endToken-this.m_startToken-t;if(r<10)this.m_currentTokenType=8;else if(10===r){const r=this.m_getCurrentSubstr();e?r.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:r.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(r<19)this.m_currentTokenType=9;else if(19===r){const r=this.m_getCurrentSubstr();e?r.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:r.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&i("invalid token"),"null"!==e&&i("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&i("invalid token"),"true"!==e&&i("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&i("invalid token"),"false"!==e&&i("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&i("invalid token"),"NaN"!==e&&i("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===l.s_beginObject?this.valueStartObject_():e===l.s_beginArray?this.valueStartArray_():e===l.s_doubleQuote?this.valueString_():e===l.s_minus||e>=l.s_zero&&e<=l.s_zero+9?this.valueNumber_():e===l.s_n?this.valueNull_():e===l.s_t?this.valueTrue_():e===l.s_f?this.valueFalse_():e===l.s_N?this.valueNan_():i("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push((()=>this.accept_()));const e=this.m_peekChar();e!==l.s_beginObject&&e!==l.s_beginArray&&i("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class O{getOperatorType(){return 10404}accelerateGeometry(e,t,r){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,r,n,s,a,o){let d;"string"==typeof r?(d=new j({jsonString:r}),d.nextToken()):d=r,1!==d.currentToken()&&i("failed to import map geometry: start of object is expected");const m=h(t,e,d,n,s);return void 0!==m.geom||void 0!==m.sr?new _(m):null}importProjectionTransformation(t,r){return e(0),{}}importDatumTransformation(t,r){return e(0),{}}static stringToGeometryType(e){return r.enumPoint}}const D=new x,I=new c,E=new O;function w(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function V(e){const t=new F(e);return t.nextToken(),E.execute(0,r.enumUnknown,t,!0,!0)}function z(e,t){return D.reset(),e instanceof _&&(t=e.getSpatialReference(),e=e.getGeometry()),I.execute(0,e,t,D),D.getObject()}export{V as fromGeometry,w as getSpatialReference,z as toGeometry};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{toPoint as t,getSpatialReference as e}from"./
|
|
5
|
+
import{toPoint as t,getSpatialReference as e}from"./apiConverter.js";function i(i,n,o=!1){const r=n.type,m=t(i.m_coordinate,e(n)),d=i.m_distance,p=i.isEmpty(),c=i.m_bRightSide,s="point"===r||"multipoint"===r?i.m_vertexIndex:null;return{coordinate:m,distance:d,isEmpty:p,...o&&{rightSide:c},...null!=s&&{vertexIndex:s}}}export{i as toProximityResult};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as r}from"../../core/arrayUtils.js";import{execute as t,executeMany as e,supportsCurves as o}from"./gx/operatorSymmetricDifference.js";import{getSpatialReference as n,toGeometry as s,fromSpatialReference as
|
|
5
|
+
import{isSome as r}from"../../core/arrayUtils.js";import{execute as t,executeMany as e,supportsCurves as o}from"./gx/operatorSymmetricDifference.js";import{getSpatialReference as n,toGeometry as s,fromSpatialReference as p,fromGeometry as i}from"./support/apiConverter.js";function u(r,e){const o=n(r);return s(t(i(r),i(e),p(o)),o)}function a(t,o){const u=t.map(i),a=n(t);return e(u,i(o),p(a)).map((r=>s(r,a))).filter(r)}function c(){return o()}export{u as execute,a as executeMany,c as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{O as e}from"../../chunks/OperatorTouches.js";import{getSpatialReference as r,fromGeometry as t,fromSpatialReference as n}from"./support/apiConverter.js";const o=new e;function u(e){const u=r(e);return o.accelerateGeometry(t(e),n(u),0)}function s(e,r){return o.execute(t(e),t(r),n(e.spatialReference),null)}function c(){return o.supportsCurves()}export{u as accelerateGeometry,s as execute,c as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{execute as r,executeMany as t,supportsCurves as o}from"./gx/operatorUnion.js";import{getSpatialReference as n,toGeometry as e,fromSpatialReference as s,fromGeometry as u}from"./support/
|
|
5
|
+
import{execute as r,executeMany as t,supportsCurves as o}from"./gx/operatorUnion.js";import{getSpatialReference as n,toGeometry as e,fromSpatialReference as s,fromGeometry as u}from"./support/apiConverter.js";function p(t,o){const p=n(t);return e(r(u(t),u(o),s(p)),p)}function a(r){const o=r.map(u),p=n(r);return e(t(o,s(p)),p)}function c(){return o()}export{p as execute,a as executeMany,c as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{O as e}from"../../chunks/OperatorWithin.js";import{getSpatialReference as r,fromGeometry as t,fromSpatialReference as n}from"./support/apiConverter.js";const o=new e;function u(e){const u=r(e);return o.accelerateGeometry(t(e),n(u),0)}function s(e,r){return o.execute(t(e),t(r),n(e.spatialReference),null)}function c(){return o.supportsCurves()}export{u as accelerateGeometry,s as execute,c as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import e from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../core/accessorSupport/decorators/cast.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import e from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../core/accessorSupport/decorators/cast.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{castArray as i,writeTypedArray as l}from"./meshProperties.js";var g;let p=g=class extends o{constructor(t){super(t),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(t){return i(t,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},e.getLogger(this))}castPosition(t){t&&t instanceof Float32Array&&e.getLogger(this).warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array");return i(t,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},e.getLogger(this))}castUv(t){return i(t,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},e.getLogger(this))}castNormal(t){return i(t,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},e.getLogger(this))}castTangent(t){return i(t,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},e.getLogger(this))}clone(){const t={position:r(this.position),uv:r(this.uv),normal:r(this.normal),tangent:r(this.tangent),color:r(this.color)};return new g(t)}clonePositional(){const t={position:r(this.position),normal:r(this.normal),tangent:r(this.tangent),uv:this.uv,color:this.color};return new g(t)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};t([s({json:{write:l}})],p.prototype,"color",void 0),t([n("color")],p.prototype,"castColor",null),t([s({nonNullable:!0,json:{write:l}})],p.prototype,"position",void 0),t([n("position")],p.prototype,"castPosition",null),t([s({json:{write:l}})],p.prototype,"uv",void 0),t([n("uv")],p.prototype,"castUv",null),t([s({json:{write:l}})],p.prototype,"normal",void 0),t([n("normal")],p.prototype,"castNormal",null),t([s({json:{write:l}})],p.prototype,"tangent",void 0),t([n("tangent")],p.prototype,"castTangent",null),p=g=t([a("esri.geometry.support.MeshVertexAttributes")],p);export{p as MeshVertexAttributes};
|
package/interfaces.d.ts
CHANGED
|
@@ -1491,6 +1491,124 @@ declare namespace __esri {
|
|
|
1491
1491
|
|
|
1492
1492
|
export const mediaUtils: mediaUtils;
|
|
1493
1493
|
|
|
1494
|
+
/**
|
|
1495
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1496
|
+
*
|
|
1497
|
+
* Table template utilities for the map viewer application.
|
|
1498
|
+
*/
|
|
1499
|
+
interface templateUtils {
|
|
1500
|
+
/**
|
|
1501
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1502
|
+
*
|
|
1503
|
+
* Generates an AttributeTableTemplate based on the default layer fields.
|
|
1504
|
+
*/
|
|
1505
|
+
createDefaultAttributeTableTemplateFromLayer(options: templateUtilsCreateDefaultAttributeTableTemplateFromLayerOptions): Promise<AttributeTableTemplate>;
|
|
1506
|
+
/**
|
|
1507
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1508
|
+
*
|
|
1509
|
+
* Generates a TableTemplate based on the default layer fields.
|
|
1510
|
+
*/
|
|
1511
|
+
createDefaultTableTemplateFromLayer(options: templateUtilsCreateDefaultTableTemplateFromLayerOptions): Promise<TableTemplate>;
|
|
1512
|
+
/**
|
|
1513
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1514
|
+
*
|
|
1515
|
+
* Generates a TableTemplate based on a pre-existing AttributeTableTemplate.
|
|
1516
|
+
*/
|
|
1517
|
+
createTableTemplateFromAttributeTableTemplate(options: templateUtilsCreateTableTemplateFromAttributeTableTemplateOptions): Promise<TableTemplate>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1520
|
+
*
|
|
1521
|
+
* Syncs a provided AttributeTableTemplate with the current state of a provided FeatureTable, using the 'columns' Collection on FeatureTable specifically.
|
|
1522
|
+
*/
|
|
1523
|
+
syncAttributeTableTemplate(table: FeatureTable, template: AttributeTableTemplate, includeHiddenColumns?: AttributeTableTemplate): AttributeTableTemplate;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
export const templateUtils: templateUtils;
|
|
1527
|
+
|
|
1528
|
+
export interface templateUtilsCreateDefaultAttributeTableTemplateFromLayerOptions {
|
|
1529
|
+
/**
|
|
1530
|
+
* Layer from which to generate a default template.
|
|
1531
|
+
*
|
|
1532
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createDefaultAttributeTableTemplateFromLayer)
|
|
1533
|
+
*/
|
|
1534
|
+
layer: | CatalogFootprintLayer
|
|
1535
|
+
| CSVLayer
|
|
1536
|
+
| FeatureLayer
|
|
1537
|
+
| GeoJSONLayer
|
|
1538
|
+
| ImageryLayer
|
|
1539
|
+
| KnowledgeGraphSublayer
|
|
1540
|
+
| SceneLayer
|
|
1541
|
+
| WFSLayer;
|
|
1542
|
+
/**
|
|
1543
|
+
* Indicates 'attachment' columns should be excluded.
|
|
1544
|
+
*
|
|
1545
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createDefaultAttributeTableTemplateFromLayer)
|
|
1546
|
+
*/
|
|
1547
|
+
excludeAttachments?: boolean;
|
|
1548
|
+
/**
|
|
1549
|
+
* Indicates 'relationship' columns should be excluded.
|
|
1550
|
+
*
|
|
1551
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createDefaultAttributeTableTemplateFromLayer)
|
|
1552
|
+
*/
|
|
1553
|
+
excludeRelationships?: boolean;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
export interface templateUtilsCreateDefaultTableTemplateFromLayerOptions {
|
|
1557
|
+
/**
|
|
1558
|
+
* Layer from which to generate a default template.
|
|
1559
|
+
*
|
|
1560
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createDefaultTableTemplateFromLayer)
|
|
1561
|
+
*/
|
|
1562
|
+
layer: | CatalogFootprintLayer
|
|
1563
|
+
| CSVLayer
|
|
1564
|
+
| FeatureLayer
|
|
1565
|
+
| GeoJSONLayer
|
|
1566
|
+
| ImageryLayer
|
|
1567
|
+
| KnowledgeGraphSublayer
|
|
1568
|
+
| SceneLayer
|
|
1569
|
+
| WFSLayer;
|
|
1570
|
+
/**
|
|
1571
|
+
* Indicates 'attachment' columns should be excluded.
|
|
1572
|
+
*
|
|
1573
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createDefaultTableTemplateFromLayer)
|
|
1574
|
+
*/
|
|
1575
|
+
excludeAttachments?: boolean;
|
|
1576
|
+
/**
|
|
1577
|
+
* Indicates 'relationship' columns should be excluded.
|
|
1578
|
+
*
|
|
1579
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createDefaultTableTemplateFromLayer)
|
|
1580
|
+
*/
|
|
1581
|
+
excludeRelationships?: boolean;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
export interface templateUtilsCreateTableTemplateFromAttributeTableTemplateOptions {
|
|
1585
|
+
/**
|
|
1586
|
+
* Layer from which to generate a default template.
|
|
1587
|
+
*
|
|
1588
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createTableTemplateFromAttributeTableTemplate)
|
|
1589
|
+
*/
|
|
1590
|
+
layer: | CatalogFootprintLayer
|
|
1591
|
+
| CSVLayer
|
|
1592
|
+
| FeatureLayer
|
|
1593
|
+
| GeoJSONLayer
|
|
1594
|
+
| ImageryLayer
|
|
1595
|
+
| KnowledgeGraphSublayer
|
|
1596
|
+
| SceneLayer
|
|
1597
|
+
| WFSLayer;
|
|
1598
|
+
/**
|
|
1599
|
+
* Instance of an AttributeTableTemplate used to configure a new TableTemplate.
|
|
1600
|
+
*
|
|
1601
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createTableTemplateFromAttributeTableTemplate)
|
|
1602
|
+
*/
|
|
1603
|
+
template: AttributeTableTemplate;
|
|
1604
|
+
/**
|
|
1605
|
+
* Indicates columns should be generated for fields without associated elements.
|
|
1606
|
+
*
|
|
1607
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-applications-MapViewer-templateUtils.html#createTableTemplateFromAttributeTableTemplate)
|
|
1608
|
+
*/
|
|
1609
|
+
includeHiddenFields?: boolean;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1494
1612
|
/**
|
|
1495
1613
|
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1496
1614
|
*
|
|
@@ -74875,6 +74993,16 @@ declare namespace __esri {
|
|
|
74875
74993
|
isGrid?: boolean;
|
|
74876
74994
|
}
|
|
74877
74995
|
|
|
74996
|
+
/**
|
|
74997
|
+
* This module provides a function for regenerating renderers based on the current state of the layer and view.
|
|
74998
|
+
*
|
|
74999
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-renderers-support-rendererUtils.html)
|
|
75000
|
+
*/
|
|
75001
|
+
interface rendererUtils {
|
|
75002
|
+
}
|
|
75003
|
+
|
|
75004
|
+
export const rendererUtils: rendererUtils;
|
|
75005
|
+
|
|
74878
75006
|
/**
|
|
74879
75007
|
* This object contains helper methods for generating data-driven visualizations with unique types (or categories) based on a field value from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html).
|
|
74880
75008
|
*
|
|
@@ -119252,6 +119380,12 @@ declare namespace __esri {
|
|
|
119252
119380
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html)
|
|
119253
119381
|
*/
|
|
119254
119382
|
constructor(properties?: PrintViewModelProperties);
|
|
119383
|
+
/**
|
|
119384
|
+
* Returns a CustomTemplate with the specified `id`.
|
|
119385
|
+
*
|
|
119386
|
+
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#getLayoutTemplateById)
|
|
119387
|
+
*/
|
|
119388
|
+
getLayoutTemplateById(id: string): CustomTemplate;
|
|
119255
119389
|
/**
|
|
119256
119390
|
* This method should be called to load the view model's printing resources.
|
|
119257
119391
|
*
|
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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../core/Collection.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as s}from"../core/promiseUtils.js";import{watch as r,sync as l}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as u}from"../core/accessorSupport/PropertyOrigin.js";import p from"./Layer.js";import{convertFromGeometry as c}from"./graphics/featureConversionUtils.js";import y from"./graphics/OptimizedGeometry.js";import{IdealEdgeLengthTypeOptions as g}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as m}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import f from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{systemOidFieldName as L,systemOriginIdFieldName as C,systemDestinationIdFieldName as w,systemLayoutGeometryFieldName as M,systemAggregationCountFieldName as b,initializeLayersFromClientData as k}from"./knowledgeGraph/layerUtils.js";import T from"./knowledgeGraph/SessionMemoryStorage.js";import{getRelationshipEndNodeIds as E}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as N}from"./mixins/BlendLayer.js";import{OperationalLayer as I}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as D}from"./mixins/ScaleRangeLayer.js";import{LCChronologicalLayout as x,LCSimpleLayout as O,LCSmartTreeLayout as R,LCRadialTreeLayout as _,LCHierarchicalLayout as A,LCCommunityLayout as G,LCForceDirectedLayout as v,NodeFlag as S,load as j,LinkType as P}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as H}from"../rest/knowledgeGraphService.js";import F from"../geometry/Extent.js";import U from"../geometry/Point.js";import B from"../geometry/Polyline.js";let z=class extends(I(N(D(o(p))))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(t.ofType(f)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new F({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(t.ofType(f)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.inclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.inclusionModeDefinition)throw new a("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(r((()=>this.layers.concat(this.tables)),((e,t)=>this._handleSublayersChange(e,t)),l))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,defaultLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,defaultLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let n=[],o=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(n=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,s)=>{const r=this._graphTypeLookup.get(s);if(!r)return i.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),n.push(r)):(i.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))})):(n=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new m({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=n,this.memberRelationshipTypes=o,this.dataManager=s}load(e){const t=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),await k(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((a=>{H(this.url).then((async i=>{if(this._initializeLayerProperties({knowledgeGraph:i,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=T.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){n(this.dataManager.sublayerCaches,t,(()=>new Map)).set(i.id,a)}}await t()}else{const a="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,a,!0).then((async()=>{s(e),await t()})))}a(null)}))}))),Promise.resolve(this)}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await E(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));await this._handleNewRecords(i)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let i=[];for(const o of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(o.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(o.typeName)?.members?.has(o.id)&&i.push(o);if(t){const e=new Set,t=[];for(const a of i)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});i=i.concat(t)}this.dataManager.removeFromLayer(i);for(const o of i)this.sublayerIdsCache.get(o.typeName)?.delete(o.id),this.dataManager.relationshipTypeNames.has(o.typeName)?this.relationshipLinkChartDiagramLookup.delete(o.id):this.entityLinkChartDiagramLookup.delete(o.id);a&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const n=[];return this.layers.forEach((e=>{n.push(e.refreshCachedQueryEngine())})),await Promise.all(n),this._refreshNamedTypes(),i}async expand(e,t){const a=await this.dataManager.getConnectedRecordIds(e,t),i=a.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(a),{records:i}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===u.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===u.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{const a=n(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a=i instanceof y?i:c(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const n=[],o=[],s=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{n.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{o.push({typeName:t,feature:e})}))})),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,l=new Map,h=new Map,d=new Map,u=new Uint8Array(n.length),p=new Float64Array(n.length),y=new Float64Array(n.length),g=new Float64Array(n.length),m=new Float64Array(n.length),f=new Uint32Array(o.length),k=new Uint32Array(o.length),T=new Float64Array(o.length),E=new Float64Array(o.length),N=[],I="FORCE_DIRECTED",D=new F({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let H,z="FORCE_DIRECTED",W=0,Q=0;const $=x.apply;switch(z="GEOGRAPHIC"===e?I:e,z){case"FORCE_DIRECTED":H=v.apply;break;case"COMMUNITY":H=G.apply;break;case"HIERARCHICAL":H=A.apply;break;case"RADIAL_TREE":H=_.apply;break;case"SMART_TREE":H=R.apply;break;default:H=O.apply}let K=!1;n.forEach((({typeName:a,feature:i})=>{if("CHRONOLOGICAL_SINGLE"!==e&&"CHRONOLOGICAL_MULTIPLE"!==e&&t?.lockedNodeLocations?.has(i.attributes[L])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)?u[W]=S.IsGeographic:u[W]=S.None;const n=t.lockedNodeLocations.get(i.attributes[L]);p[W]=n.x,y[W]=n.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)){u[W]=S.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":p[W]=t?.x,y[W]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(p[W]=e.x,y[W]=e.y):u[W]=S.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(p[W]=e.x,y[W]=e.y):u[W]=S.IsMovable;break;default:u[W]=S.IsMovable}(null==p[W]||null==y[W]||Number.isNaN(p[W])||Number.isNaN(y[W]))&&(u[W]=S.IsMovable,p[W]=0,y[W]=0)}else if("CHRONOLOGICAL_SINGLE"===e||"CHRONOLOGICAL_MULTIPLE"===e){!K&&t?.lockedNodeLocations?.has(i.attributes[L])&&(K=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;g[W]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?i.attributes[s]:null;m[W]=r?new Date(r).getTime():NaN,p[W]=0,y[W]=0,u[W]=S.IsMovable}else u[W]=S.IsMovable,p[W]=0,y[W]=0;d.set(i.attributes[L],W),N[W]={feature:i,typeName:a},W++})),K&&i.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let Y=!1;const q=new Map;o.forEach((a=>{const i=a.feature.attributes[C],n=a.feature.attributes[w],o=d.get(i),r=d.get(n),l=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?l?.startField:null,u=h?a.feature.attributes[h]:null,p=l?.endField,c=p?a.feature.attributes[p]:null;if(void 0!==o&&void 0!==r){let t=i+"-"+n;"CHRONOLOGICAL_SINGLE"!==e&&"CHRONOLOGICAL_MULTIPLE"!==e||(t=t+"-"+u+"-"+c);const l=q.get(t),h=l?.has(a.typeName);h||(f[Q]=o,k[Q]=r,"CHRONOLOGICAL_SINGLE"!==e&&"CHRONOLOGICAL_MULTIPLE"!==e||(T[Q]=u?new Date(u).getTime():NaN,E[Q]=c?new Date(c).getTime():NaN),void 0===l?q.set(t,new Map([[a.typeName,Q]])):l.set(a.typeName,Q),Q++),s.push(a)}else Y=!0,this.relationshipLinkChartDiagramLookup.set(i,null)})),Y&&i.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 J=this._validateLayoutSettings(e,t),V=this._convertLayoutSettingsToCalculationSettings(J);await j();let X=!1,Z=null;if("CHRONOLOGICAL_SINGLE"===e||"CHRONOLOGICAL_MULTIPLE"===e){let a;({success:X,links:Z,graphics:a}=$(u,p,y,g,m,f.subarray(0,Q),k.subarray(0,Q),T.subarray(0,Q),E.subarray(0,Q),"CHRONOLOGICAL_MULTIPLE"===e,t?.chronologicalLayoutSettings??{})),X&&(this.chronologicalAuxiliaryGraphics=a)}else({success:X,links:Z}=H(u,p,y,f.subarray(0,Q),k.subarray(0,Q),V.computationBudgetTime,V.idealEdgeLengthMultiplier,V.repulsionRadiusMultiplier));if(!X)throw new a("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let a=0;a<N.length;a++){if(y[a]>84.9999?y[a]=84.9999:y[a]<-84.9999&&(y[a]=-84.9999),p[a]>179.9999?p[a]=179.9999:p[a]<-179.9999&&(p[a]=-179.9999),N[a].feature.attributes[M]=new U(p[a],y[a]),r.has(N[a].typeName)){const e=r.get(N[a].typeName);e?.set(N[a].feature.attributes[L],N[a].feature)}else{const e=new Map;e.set(N[a].feature.attributes[L],N[a].feature),r.set(N[a].typeName,e)}h.set(N[a].feature.attributes[L],N[a].feature);const e=c(N[a].feature.attributes[M]);this.entityLinkChartDiagramLookup.set(N[a].feature.attributes[L],N[a].feature.attributes[M]?e:null),N[a].feature.attributes[M].x<D.xmin&&(D.xmin=N[a].feature.attributes[M].x),N[a].feature.attributes[M].x>D.xmax&&(D.xmax=N[a].feature.attributes[M].x),N[a].feature.attributes[M].y<D.ymin&&(D.ymin=N[a].feature.attributes[M].y),N[a].feature.attributes[M].y>D.ymax&&(D.ymax=N[a].feature.attributes[M].y)}if(this.linkChartExtent.xmin=D.xmin,this.linkChartExtent.xmax=D.xmax,this.linkChartExtent.ymin=D.ymin,this.linkChartExtent.ymax=D.ymax,!Z)throw new a("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ee=new Map,te=new Map,ae=new Map,ie=new Set;for(let a=0;a<s.length;a++){const n=[],o=s[a],r=o.feature.attributes[C],u=o.feature.attributes[w];let p=r+"-"+u;if("CHRONOLOGICAL_SINGLE"===e||"CHRONOLOGICAL_MULTIPLE"===e){const e=t?.timeInfoByTypeName?.get(o.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?o.feature.attributes[a]:null,n=e?.endField;p+="-"+i+"-"+(n?o.feature.attributes[n]:null)}const y=q.get(p).get(o.typeName),g=0===y?0:Z?.vertexEndIndex[y-1];if(!ie.has(y)){if(ie.add(y),Z.types[y]===P.Recursive){const e=[Z.vertices[2*g],Z.vertices[2*g+1]],t=[Z.vertices[2*(g+1)],Z.vertices[2*(g+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],i=[a[0]-e[0],a[1]-e[1]],o=[a[0]+i[1],a[1]-i[0]],s=[a[0]-i[1],a[1]+i[0]];n.push(e),n.push(o),n.push(t),n.push(s),n.push(e)}else{if(Z.types[y]!==P.Regular){i.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<Z.vertexEndIndex[y];e++)n.push([Z.vertices[2*e],Z.vertices[2*e+1]])}if("CHRONOLOGICAL_SINGLE"!==e&&"CHRONOLOGICAL_MULTIPLE"!==e){const e=N[d.get(r)]?.feature.attributes[M],t=N[d.get(u)]?.feature.attributes[M];n[0][0]===e.x&&n[0][1]===e.y||(n[0]=[e.x,e.y]),n[n.length-1][0]===t.x&&n[n.length-1][1]===t.y||(n[n.length-1]=[t.x,t.y])}for(let e=1;e<n.length-1;e++)n[e][1]>85.5?n[e][1]=85.5:n[e][1]<-85.5&&(n[e][1]=-85.5),n[e][0]>179.9999?n[e][0]=179.9999:n[e][0]<-179.9999&&(n[e][0]=-179.9999);ee.has(p)?ee.get(p).push(n):ee.set(p,[n])}const m=ee.get(p);te.has(p)||(te.set(p,new Map),ae.set(p,new Map));const f=te.get(p),b=ae.get(p);f.has(o.typeName)||(f.set(o.typeName,m.shift()),b.set(o.typeName,0));const k=f.get(o.typeName);b.set(o.typeName,b.get(o.typeName)+1);const T=new B({paths:[k]});if(o.feature.attributes[M]=T,l.has(o.typeName)){const e=l.get(o.typeName);e?.set(o.feature.attributes[L],o.feature)}else{const e=new Map;e.set(o.feature.attributes[L],o.feature),l.set(o.typeName,e)}h.set(o.feature.attributes[L],o.feature);const E=c(o.feature.attributes[M]);this.relationshipLinkChartDiagramLookup.set(o.feature.attributes[L],o.feature.attributes[M]?E:null)}for(const a of s)a.feature.attributes[b]=ae.get(a.feature.attributes[C]+"-"+a.feature.attributes[w])?.get(a.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:J},{nodes:r,links:l,idMap:h}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.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 U({x:i.x,y:i.y})))}))})),e}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(t).keys()));Array.from(e.members.keys()).filter((e=>!a.has(e))).forEach((t=>{e.members?.delete(t)}))}})),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){if(!e.length)return{records:[]};let t=[];for(const i of this.dataManager.relationshipTypeNames){const e=this.sublayerIdsCache.get(i);e&&(t=t.concat(Array.from(e.keys())))}const a=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(a),{records:a}}async connectFromEntities(e){if(!e.length)return{records:[]};let t=[];for(const n of this.dataManager.relationshipTypeNames){const e=this.sublayerIdsCache.get(n);e&&(t=t.concat(Array.from(e.keys())))}let a=[];for(const n of this.dataManager.entityTypeNames){const e=this.sublayerIdsCache.get(n);e&&(a=a.concat(Array.from(e)))}const i=await this.dataManager.getRelationshipsFromNodes(e,a,t);return await this._handleNewRecords(i),{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const a=new Map;this.layers.forEach((e=>{a.set(e.objectType.name,e.timeInfo)})),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const e=this._graphTypeLookup.get(i);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.set(i,new Map)}}await k(this,t),await this.dataManager.refreshCacheContent(e.map((e=>e.id)));const a=Object.assign({},this._currentLinkChartConfig.layoutOptions);a.lockedNodeLocations=new Map;for(const[i,n]of this.entityLinkChartDiagramLookup.entries())n&&a.lockedNodeLocations.set(i,new U(n.coords[0],n.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,a)}_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(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.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=c(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[C]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[w]);if(t&&a){const i=c(new B({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[L],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[L],null)}))}))):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{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})}_validateLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),n=e=>a(e)&&e>=1,o=e=>a(e)&&e>=1,s=e=>Object.values(g).includes(e),r=e=>a(e)&&e>=0,l={organicLayoutSettings:{},chronologicalLayoutSettings:{}};if(!new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC","CHRONOLOGICAL_MULTIPLE","CHRONOLOGICAL_SINGLE"]).has(e)||!t)return l;t.organicLayoutSettings??={};const{computationBudgetTime:h,repulsionRadiusMultiplier:d,idealEdgeLength:u,idealEdgeLengthType:p}=t.organicLayoutSettings;o(h)?l.organicLayoutSettings.computationBudgetTime=h:void 0!==h&&i.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n(d)?l.organicLayoutSettings.repulsionRadiusMultiplier=d:void 0!==d&&i.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting");if("GEOGRAPHIC"===e&&(void 0!==u||void 0!==p)&&(s(p)?l.organicLayoutSettings.idealEdgeLengthType=p:void 0!==p&&i.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),r(u)?l.organicLayoutSettings.idealEdgeLength=u:void 0!==u&&i.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),("CHRONOLOGICAL_MULTIPLE"===e||"CHRONOLOGICAL_SINGLE"===e)&&t.chronologicalLayoutSettings){const e=t.chronologicalLayoutSettings;e.durationLineWidth&&e.durationLineWidth<0&&i.getLogger(this).warn("Invalid layout durationLineWidth setting, will revert to default setting")}return l}_convertLayoutSettingsToCalculationSettings(e){e.organicLayoutSettings??={};let t=e.organicLayoutSettings.idealEdgeLength;return e.organicLayoutSettings.idealEdgeLengthType===g.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.organicLayoutSettings.computationBudgetTime,repulsionRadiusMultiplier:e.organicLayoutSettings.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new f({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"))}};e([h()],z.prototype,"dataPreloadedInLocalCache",void 0),e([h()],z.prototype,"defaultLinkChartConfig",void 0),e([h()],z.prototype,"dataManager",void 0),e([h()],z.prototype,"knowledgeGraph",void 0),e([h({type:t.ofType(f),json:{write:{ignoreOrigin:!0}}})],z.prototype,"layers",void 0),e([h()],z.prototype,"entityLinkChartDiagramLookup",void 0),e([h()],z.prototype,"relationshipLinkChartDiagramLookup",void 0),e([h()],z.prototype,"linkChartExtent",void 0),e([h()],z.prototype,"memberEntityTypes",void 0),e([h()],z.prototype,"memberRelationshipTypes",void 0),e([h({type:["LinkChartLayer"]})],z.prototype,"operationalLayerType",void 0),e([h()],z.prototype,"sublayerIdsCache",void 0),e([h({type:t.ofType(f),json:{write:{ignoreOrigin:!0}}})],z.prototype,"tables",void 0),e([h({json:{read:!1}})],z.prototype,"type",void 0),e([h({json:{read:!1}})],z.prototype,"chronologicalAuxiliaryGraphics",void 0),z=e([d("esri.layers.LinkChartLayer")],z);const W=z;export{W as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../core/Collection.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as o}from"../core/promiseUtils.js";import{watch as r,sync as l}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as p}from"../core/accessorSupport/PropertyOrigin.js";import u from"./Layer.js";import{convertFromGeometry as y}from"./graphics/featureConversionUtils.js";import c from"./graphics/OptimizedGeometry.js";import{IdealEdgeLengthTypeOptions as g}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as m}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import f from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{systemOidFieldName as L,systemOriginIdFieldName as C,systemDestinationIdFieldName as b,systemLayoutGeometryFieldName as M,systemAggregationCountFieldName as w,initializeLayersFromClientData as k}from"./knowledgeGraph/layerUtils.js";import T from"./knowledgeGraph/SessionMemoryStorage.js";import{graphLayersSupportUtilsModuleWrapper as N,convertLayoutSettingsJSON as E,convertLayoutTypeJSON as I,getRelationshipEndNodeIds as D}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{OperationalLayer as x}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{LCChronologicalLayout as O,LCSimpleLayout as R,LCSmartTreeLayout as v,LCRadialTreeLayout as S,LCHierarchicalLayout as G,LCCommunityLayout as P,LCForceDirectedLayout as j,NodeFlag as H,load as U,LinkType as F}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as B}from"../rest/knowledgeGraphService.js";import z from"../geometry/Extent.js";import W from"../geometry/Point.js";import Q from"../geometry/Polyline.js";let $=class extends(x(_(A(s(u))))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(t.ofType(f)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new z({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(t.ofType(f)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.inclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.inclusionModeDefinition)throw new a("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(r((()=>this.layers.concat(this.tables)),((e,t)=>this._handleSublayersChange(e,t)),l))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,defaultLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,defaultLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let n=[],s=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(n=e.knowledgeGraph.dataModel.entityTypes??[],s=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,o)=>{const r=this._graphTypeLookup.get(o);if(!r)return i.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(o);"relationship"===r.type?t.has(o)||(t.add(o),s.push(r)):"entity"===r.type?t.has(o)||(t.add(o),n.push(r)):(i.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(o))})):(n=e.knowledgeGraph.dataModel.entityTypes??[],s=e.knowledgeGraph.dataModel.relationshipTypes??[]);const o=new m({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=n,this.memberRelationshipTypes=s,this.dataManager=o}load(e){const t=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),await k(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((a=>{B(this.url).then((async i=>{i.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),i.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}));const s=this.parent?.linkChartProperties;if(s?.originIdOf("entitiesUrl")===p.LINK_CHART&&(this.membershipModified=!1,this._originalInclusionList=await N.fetchAndConvertSerializedLinkChart({entitiesUrl:this.parent.linkChartProperties.entitiesUrl,relationshipsUrl:this.parent.linkChartProperties.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(i.dataModel),this.defaultLinkChartConfig={layoutOptions:s?.layoutSettings?E(s.layoutSettings,void 0):void 0,layoutMode:s?.layoutType?I(s.layoutType):"RADIAL_TREE"}),this._initializeLayerProperties({knowledgeGraph:i,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=T.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){n(this.dataManager.sublayerCaches,t,(()=>new Map)).set(i.id,a)}}await t()}else{const a="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,a,!0).then((async()=>{o(e),await t()})))}a(null)}))}))),Promise.resolve(this)}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await D(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)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let i=[];for(const s of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(s.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(s.typeName)?.members?.has(s.id)&&i.push(s);if(t){const e=new Set,t=[];for(const a of i)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});i=i.concat(t)}this.dataManager.removeFromLayer(i);for(const s of i)this.sublayerIdsCache.get(s.typeName)?.delete(s.id),this.dataManager.relationshipTypeNames.has(s.typeName)?this.relationshipLinkChartDiagramLookup.delete(s.id):this.entityLinkChartDiagramLookup.delete(s.id);a&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions),i.length>0&&(this.membershipModified=!0);const n=[];return this.layers.forEach((e=>{n.push(e.refreshCachedQueryEngine())})),await Promise.all(n),this._refreshNamedTypes(),i}async expand(e,t){const a=await this.dataManager.getConnectedRecordIds(e,t),i=a.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(a),a.length>0&&(this.membershipModified=!0),{records:i}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===p.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===p.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{const a=n(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a=i instanceof c?i:y(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const s=[],o=[],r=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{s.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{o.push({typeName:t,feature:e})}))})),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const l=new Map,h=new Map,d=new Map,p=new Map,u=new Uint8Array(s.length),c=new Float64Array(s.length),g=new Float64Array(s.length),m=new Float64Array(s.length),f=new Float64Array(s.length),k=new Uint32Array(o.length),T=new Uint32Array(o.length),N=new Float64Array(o.length),E=new Float64Array(o.length),I=[],D="FORCE_DIRECTED",_=new z({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let x,A="FORCE_DIRECTED",B=0,$=0;const K=O.apply;switch(A="GEOGRAPHIC"===e?D:e,A){case"FORCE_DIRECTED":x=j.apply;break;case"COMMUNITY":x=P.apply;break;case"HIERARCHICAL":x=G.apply;break;case"RADIAL_TREE":x=S.apply;break;case"SMART_TREE":x=v.apply;break;default:x=R.apply}let Y=!1;s.forEach((({typeName:a,feature:i})=>{if("CHRONOLOGICAL_SINGLE"!==e&&"CHRONOLOGICAL_MULTIPLE"!==e&&t?.lockedNodeLocations?.has(i.attributes[L])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)?u[B]=H.IsGeographic:u[B]=H.None;const n=t.lockedNodeLocations.get(i.attributes[L]);c[B]=n.x,g[B]=n.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)){u[B]=H.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":c[B]=t?.x,g[B]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(c[B]=e.x,g[B]=e.y):u[B]=H.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(c[B]=e.x,g[B]=e.y):u[B]=H.IsMovable;break;default:u[B]=H.IsMovable}(null==c[B]||null==g[B]||Number.isNaN(c[B])||Number.isNaN(g[B]))&&(u[B]=H.IsMovable,c[B]=0,g[B]=0)}else if("CHRONOLOGICAL_SINGLE"===e||"CHRONOLOGICAL_MULTIPLE"===e){!Y&&t?.lockedNodeLocations?.has(i.attributes[L])&&(Y=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,s=n&&e?.startField?i.attributes[n]:null;m[B]=s?new Date(s).getTime():NaN;const o=e?.endField,r=o&&e?.endField?i.attributes[o]:null;f[B]=r?new Date(r).getTime():NaN,c[B]=0,g[B]=0,u[B]=H.IsMovable}else u[B]=H.IsMovable,c[B]=0,g[B]=0;p.set(i.attributes[L],B),I[B]={feature:i,typeName:a},B++})),Y&&i.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let q=!1;const J=new Map;o.forEach((a=>{const i=a.feature.attributes[C],n=a.feature.attributes[b],s=p.get(i),o=p.get(n),l=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?a.feature.attributes[h]:null,u=l?.endField,y=u?a.feature.attributes[u]:null;if(void 0!==s&&void 0!==o){let t=i+"-"+n;"CHRONOLOGICAL_SINGLE"!==e&&"CHRONOLOGICAL_MULTIPLE"!==e||(t=t+"-"+d+"-"+y);const l=J.get(t),h=l?.has(a.typeName);h||(k[$]=s,T[$]=o,"CHRONOLOGICAL_SINGLE"!==e&&"CHRONOLOGICAL_MULTIPLE"!==e||(N[$]=d?new Date(d).getTime():NaN,E[$]=y?new Date(y).getTime():NaN),void 0===l?J.set(t,new Map([[a.typeName,$]])):l.set(a.typeName,$),$++),r.push(a)}else q=!0,this.relationshipLinkChartDiagramLookup.set(i,null)})),q&&i.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 V=this._validateLayoutSettings(e,t),X=this._convertLayoutSettingsToCalculationSettings(V);await U();let Z=!1,ee=null;if("CHRONOLOGICAL_SINGLE"===e||"CHRONOLOGICAL_MULTIPLE"===e){let a;({success:Z,links:ee,graphics:a}=K(u,c,g,m,f,k.subarray(0,$),T.subarray(0,$),N.subarray(0,$),E.subarray(0,$),"CHRONOLOGICAL_MULTIPLE"===e,t?.chronologicalLayoutSettings??{})),Z&&(this.chronologicalAuxiliaryGraphics=a)}else({success:Z,links:ee}=x(u,c,g,k.subarray(0,$),T.subarray(0,$),X.computationBudgetTime,X.idealEdgeLengthMultiplier,X.repulsionRadiusMultiplier));if(!Z)throw new a("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let a=0;a<I.length;a++){if(g[a]>84.9999?g[a]=84.9999:g[a]<-84.9999&&(g[a]=-84.9999),c[a]>179.9999?c[a]=179.9999:c[a]<-179.9999&&(c[a]=-179.9999),I[a].feature.attributes[M]=new W(c[a],g[a]),l.has(I[a].typeName)){const e=l.get(I[a].typeName);e?.set(I[a].feature.attributes[L],I[a].feature)}else{const e=new Map;e.set(I[a].feature.attributes[L],I[a].feature),l.set(I[a].typeName,e)}d.set(I[a].feature.attributes[L],I[a].feature);const e=y(I[a].feature.attributes[M]);this.entityLinkChartDiagramLookup.set(I[a].feature.attributes[L],I[a].feature.attributes[M]?e:null);const t=n(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,I[a].typeName,(()=>({useAllData:!1,members:new Map})));n(t.members,I[a].feature.attributes[L],(()=>({id:I[a].feature.attributes[L],linkChartLocation:void 0}))).linkChartLocation=I[a].feature.attributes[M],I[a].feature.attributes[M].x<_.xmin&&(_.xmin=I[a].feature.attributes[M].x),I[a].feature.attributes[M].x>_.xmax&&(_.xmax=I[a].feature.attributes[M].x),I[a].feature.attributes[M].y<_.ymin&&(_.ymin=I[a].feature.attributes[M].y),I[a].feature.attributes[M].y>_.ymax&&(_.ymax=I[a].feature.attributes[M].y)}if(this.linkChartExtent.xmin=_.xmin,this.linkChartExtent.xmax=_.xmax,this.linkChartExtent.ymin=_.ymin,this.linkChartExtent.ymax=_.ymax,!ee)throw new a("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const te=new Map,ae=new Map,ie=new Map,ne=new Set;for(let a=0;a<r.length;a++){const s=[],o=r[a],l=o.feature.attributes[C],u=o.feature.attributes[b];let c=l+"-"+u;if("CHRONOLOGICAL_SINGLE"===e||"CHRONOLOGICAL_MULTIPLE"===e){const e=t?.timeInfoByTypeName?.get(o.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?o.feature.attributes[a]:null,n=e?.endField;c+="-"+i+"-"+(n?o.feature.attributes[n]:null)}const g=J.get(c).get(o.typeName),m=0===g?0:ee?.vertexEndIndex[g-1];if(!ne.has(g)){if(ne.add(g),ee.types[g]===F.Recursive){const e=[ee.vertices[2*m],ee.vertices[2*m+1]],t=[ee.vertices[2*(m+1)],ee.vertices[2*(m+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],i=[a[0]-e[0],a[1]-e[1]],n=[a[0]+i[1],a[1]-i[0]],o=[a[0]-i[1],a[1]+i[0]];s.push(e),s.push(n),s.push(t),s.push(o),s.push(e)}else{if(ee.types[g]!==F.Regular){i.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=m;e<ee.vertexEndIndex[g];e++)s.push([ee.vertices[2*e],ee.vertices[2*e+1]])}if("CHRONOLOGICAL_SINGLE"!==e&&"CHRONOLOGICAL_MULTIPLE"!==e){const e=I[p.get(l)]?.feature.attributes[M],t=I[p.get(u)]?.feature.attributes[M];s[0][0]===e.x&&s[0][1]===e.y||(s[0]=[e.x,e.y]),s[s.length-1][0]===t.x&&s[s.length-1][1]===t.y||(s[s.length-1]=[t.x,t.y])}for(let e=1;e<s.length-1;e++)s[e][1]>85.5?s[e][1]=85.5:s[e][1]<-85.5&&(s[e][1]=-85.5),s[e][0]>179.9999?s[e][0]=179.9999:s[e][0]<-179.9999&&(s[e][0]=-179.9999);te.has(c)?te.get(c).push(s):te.set(c,[s])}const f=te.get(c);ae.has(c)||(ae.set(c,new Map),ie.set(c,new Map));const w=ae.get(c),k=ie.get(c);w.has(o.typeName)||(w.set(o.typeName,f.shift()),k.set(o.typeName,0));const T=w.get(o.typeName);k.set(o.typeName,k.get(o.typeName)+1);const N=new Q({paths:[T]});if(o.feature.attributes[M]=N,h.has(o.typeName)){const e=h.get(o.typeName);e?.set(o.feature.attributes[L],o.feature)}else{const e=new Map;e.set(o.feature.attributes[L],o.feature),h.set(o.typeName,e)}d.set(o.feature.attributes[L],o.feature);const E=y(o.feature.attributes[M]);this.relationshipLinkChartDiagramLookup.set(o.feature.attributes[L],o.feature.attributes[M]?E:null);const D=n(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,o.typeName,(()=>({useAllData:!1,members:new Map})));n(D.members,o.feature.attributes[L],(()=>({id:o.feature.attributes[L],linkChartLocation:void 0}))).linkChartLocation=o.feature.attributes[M]}for(const a of r)a.feature.attributes[w]=ie.get(a.feature.attributes[C]+"-"+a.feature.attributes[b])?.get(a.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:V},{nodes:l,links:h,idMap:d}}async applyNewLinkChartLayout(e="RADIAL_TREE",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 W({x:i.x,y:i.y})))}));return e}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(t).keys()));Array.from(e.members.keys()).filter((e=>!a.has(e))).forEach((t=>{e.members?.delete(t)}))}})),this.membershipModified=!0,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){if(!e.length)return{records:[]};let t=[];for(const i of this.dataManager.relationshipTypeNames){const e=this.sublayerIdsCache.get(i);e&&(t=t.concat(Array.from(e.keys())))}const a=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(a),{records:a}}async connectFromEntities(e){if(!e.length)return{records:[]};let t=[];for(const n of this.dataManager.relationshipTypeNames){const e=this.sublayerIdsCache.get(n);e&&(t=t.concat(Array.from(e.keys())))}let a=[];for(const n of this.dataManager.entityTypeNames){const e=this.sublayerIdsCache.get(n);e&&(a=a.concat(Array.from(e)))}const i=await this.dataManager.getRelationshipsFromNodes(e,a,t);return await this._handleNewRecords(i),i.length>0&&(this.membershipModified=!0),{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const a=new Map;this.layers.forEach((e=>{a.set(e.objectType.name,e.timeInfo)})),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const e=this._graphTypeLookup.get(i);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.set(i,new Map)}}await k(this,t),await this.dataManager.refreshCacheContent(e.map((e=>e.id)));const a=Object.assign({},this._currentLinkChartConfig.layoutOptions);a.lockedNodeLocations=new Map;for(const[i,n]of this.entityLinkChartDiagramLookup.entries())n&&a.lockedNodeLocations.set(i,new W(n.coords[0],n.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,a)}_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(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.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 s=y(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,s):this.entityLinkChartDiagramLookup.set(n,s),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[C]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[b]);if(t&&a){const i=y(new Q({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[L],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[L],null)}))}))):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{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})}_validateLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),n=e=>a(e)&&e>=1,s=e=>a(e)&&e>=1,o=e=>Object.values(g).includes(e),r=e=>a(e)&&e>=0,l={organicLayoutSettings:{},chronologicalLayoutSettings:{}};if(!new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC","CHRONOLOGICAL_MULTIPLE","CHRONOLOGICAL_SINGLE"]).has(e)||!t)return l;t.organicLayoutSettings??={};const{computationBudgetTime:h,repulsionRadiusMultiplier:d,idealEdgeLength:p,idealEdgeLengthType:u}=t.organicLayoutSettings;s(h)?l.organicLayoutSettings.computationBudgetTime=h:void 0!==h&&i.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n(d)?l.organicLayoutSettings.repulsionRadiusMultiplier=d:void 0!==d&&i.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting");if("GEOGRAPHIC"===e&&(void 0!==p||void 0!==u)&&(o(u)?l.organicLayoutSettings.idealEdgeLengthType=u:void 0!==u&&i.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),r(p)?l.organicLayoutSettings.idealEdgeLength=p:void 0!==p&&i.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),("CHRONOLOGICAL_MULTIPLE"===e||"CHRONOLOGICAL_SINGLE"===e)&&t.chronologicalLayoutSettings){const e=t.chronologicalLayoutSettings;e.durationLineWidth&&e.durationLineWidth<0&&i.getLogger(this).warn("Invalid layout durationLineWidth setting, will revert to default setting")}return l}_convertLayoutSettingsToCalculationSettings(e){e.organicLayoutSettings??={};let t=e.organicLayoutSettings.idealEdgeLength;return e.organicLayoutSettings.idealEdgeLengthType===g.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.organicLayoutSettings.computationBudgetTime,repulsionRadiusMultiplier:e.organicLayoutSettings.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new f({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 a=new Set((e.entityTypes??[]).map((e=>e.name)).concat((e.relationshipTypes??[]).map((e=>e.name)))),n=new Set((e.entityTypes??[]).map((e=>e.name))),s=new Set((e.relationshipTypes??[]).map((e=>e.name)));if(this.layers){for(const e of this.layers)!e.graphType&&a.has(e.graphTypeName)&&(e.graphType=n.has(e.graphTypeName)?"entity":"relationship");this.layers=this.layers.filter((e=>a.has(e.graphTypeName)&&("entity"===e.graphType?n.has(e.graphTypeName):s.has(e.graphTypeName))))}else this.layers=new t;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 i of a)e.has(i)||this._originalInclusionList.namedTypeDefinitions.set(i,{useAllData:!1,members:new Map});const n=[];for(const s of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(s)||(i.getLogger(this).warn(`A named type, ${s}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),n.push(s));for(const i of n)this._originalInclusionList.namedTypeDefinitions.delete(i)}}};e([h()],$.prototype,"dataPreloadedInLocalCache",void 0),e([h()],$.prototype,"defaultLinkChartConfig",void 0),e([h()],$.prototype,"membershipModified",void 0),e([h()],$.prototype,"dataManager",void 0),e([h()],$.prototype,"knowledgeGraph",void 0),e([h({type:t.ofType(f),json:{write:{ignoreOrigin:!0}}})],$.prototype,"layers",void 0),e([h()],$.prototype,"entityLinkChartDiagramLookup",void 0),e([h()],$.prototype,"relationshipLinkChartDiagramLookup",void 0),e([h()],$.prototype,"linkChartExtent",void 0),e([h()],$.prototype,"memberEntityTypes",void 0),e([h()],$.prototype,"memberRelationshipTypes",void 0),e([h({type:["LinkChartLayer"]})],$.prototype,"operationalLayerType",void 0),e([h()],$.prototype,"sublayerIdsCache",void 0),e([h({type:t.ofType(f),json:{write:{ignoreOrigin:!0}}})],$.prototype,"tables",void 0),e([h({json:{read:!1}})],$.prototype,"type",void 0),e([h({json:{read:!1}})],$.prototype,"chronologicalAuxiliaryGraphics",void 0),$=e([d("esri.layers.LinkChartLayer")],$);const K=$;export{K as default};
|