@arcgis/core 5.0.0-next.67 → 5.0.0-next.68

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.
Files changed (313) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +9 -6
  2. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.js +1 -1
  3. package/arcade/arcadeAsyncRuntime.js +1 -1
  4. package/arcade/arcadeCompiler.js +1 -1
  5. package/arcade/arcadeRuntime.js +1 -1
  6. package/arcade/batchExec.js +1 -1
  7. package/arcade/compilerUtils.js +1 -1
  8. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  9. package/arcade/geometry/unitConversion.js +1 -1
  10. package/arcade/treeAnalysis.js +1 -1
  11. package/arcade.js +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/{251eb6e00f99a816d55c.js → 0326314947734b8e640a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/04176244b0a3539c9681.js +1 -0
  15. package/assets/esri/core/workers/chunks/{942fad4ec96295672ce8.js → 10e474d664b20adcd917.js} +1 -1
  16. package/assets/esri/core/workers/chunks/12f9a55253084a910b2e.js +1 -0
  17. package/assets/esri/core/workers/chunks/{0629087bd5bb8048493e.js → 14dedd80fb797303f91f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{81d89107ff82604a3ea0.js → 1b445981fbc8373f4dd8.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{6ba3c2b9f699d94d62b8.js → 1ec1a1997b5577619040.js} +1 -1
  20. package/assets/esri/core/workers/chunks/2085084324cd5a81783f.js +1 -0
  21. package/assets/esri/core/workers/chunks/2c2c0f66cffc521df736.js +1 -0
  22. package/assets/esri/core/workers/chunks/2dd347aa2a061d536e69.js +1 -0
  23. package/assets/esri/core/workers/chunks/2dfa7abf2d39fa5a3874.js +1 -0
  24. package/assets/esri/core/workers/chunks/322085d63719da6e443c.js +1 -0
  25. package/assets/esri/core/workers/chunks/{76086517591d0eb35156.js → 34a2e0462eb05986cdd1.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{a6dcd13c792b6538ac50.js → 35593a9790818b689455.js} +1 -1
  27. package/assets/esri/core/workers/chunks/3a04153ca9d8e4f01185.js +1 -0
  28. package/assets/esri/core/workers/chunks/{4e9a8fce55cad841c731.js → 3b25f5d9c8f78bb6e011.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3e7ea06b342e33bc48a5.js +1 -0
  30. package/assets/esri/core/workers/chunks/3ed317900f0edf635508.js +1 -0
  31. package/assets/esri/core/workers/chunks/401ce5cb98fa14c1a725.js +1 -0
  32. package/assets/esri/core/workers/chunks/4319b89cfa02894a8cae.js +1 -0
  33. package/assets/esri/core/workers/chunks/4a060147d25929680ec8.js +1 -0
  34. package/assets/esri/core/workers/chunks/{7bed14d9bcd7fc5e2eec.js → 4bcd74951477e8977ba1.js} +1 -1
  35. package/assets/esri/core/workers/chunks/4d0eaeb4cd6cd55e25fd.js +1 -0
  36. package/assets/esri/core/workers/chunks/{687d2b761dc5b5cf0c31.js → 4d4d71d24c1a9cb342b8.js} +1 -1
  37. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +1 -0
  38. package/assets/esri/core/workers/chunks/50f03813fba4b752ca9f.js +1 -0
  39. package/assets/esri/core/workers/chunks/{abc236e99b52be1c83b9.js → 52a14266fe239b95c5ce.js} +1 -1
  40. package/assets/esri/core/workers/chunks/53b5c77832df7df4d4e3.js +1 -0
  41. package/assets/esri/core/workers/chunks/{34178ace79e8dea3567d.js → 562cddaf63985e53ee6e.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{6599cc702a46f81a5634.js → 5dd5be91038df8902dc4.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{49a1b7f700b8a42de817.js → 60c7f896f2246a8aa6d7.js} +19 -19
  44. package/assets/esri/core/workers/chunks/60f363ee2add089e8f0b.js +1 -0
  45. package/assets/esri/core/workers/chunks/61801bb8c7be8fe77086.js +1 -0
  46. package/assets/esri/core/workers/chunks/68074a484d7f9bc713c0.js +1 -0
  47. package/assets/esri/core/workers/chunks/6acfa51b81e6f4255118.js +1 -0
  48. package/assets/esri/core/workers/chunks/{3fe7be535affae31de7e.js → 6b85a8776ec2beff63cb.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6df484faf54e90a6cc77.js +1 -0
  50. package/assets/esri/core/workers/chunks/6ea6ad894ac634aa4391.js +1 -0
  51. package/assets/esri/core/workers/chunks/6f8098f9fe233833245a.js +1 -0
  52. package/assets/esri/core/workers/chunks/75fd2ef1236a9364ca7f.js +1 -0
  53. package/assets/esri/core/workers/chunks/7be9bbae23895d1cfa92.js +1 -0
  54. package/assets/esri/core/workers/chunks/7ea48661f1087d06aa41.js +1 -0
  55. package/assets/esri/core/workers/chunks/{47e5149765beee46f208.js → 7ee68f67f9cc48a328f0.js} +1 -1
  56. package/assets/esri/core/workers/chunks/866477acdf03b8a40bc9.js +1 -0
  57. package/assets/esri/core/workers/chunks/8e83c133b201b9b61e70.js +1 -0
  58. package/assets/esri/core/workers/chunks/9086a4933d3d3d9ffa72.js +1 -0
  59. package/assets/esri/core/workers/chunks/94174d40de39dbe7d0bf.js +1 -0
  60. package/assets/esri/core/workers/chunks/98f4b44eca91c42ca08e.js +1 -0
  61. package/assets/esri/core/workers/chunks/{dd99b77a7c0a052507bb.js → 9d88b4ba8e511da64583.js} +3 -3
  62. package/assets/esri/core/workers/chunks/a808be466812db51813d.js +1 -0
  63. package/assets/esri/core/workers/chunks/{6b4a24248182245167ca.js → a931515a2569713e743b.js} +1 -1
  64. package/assets/esri/core/workers/chunks/a95e28ade258b144cbb5.js +1 -0
  65. package/assets/esri/core/workers/chunks/adc68e2c6d2698a52bfe.js +1 -0
  66. package/assets/esri/core/workers/chunks/b2a1e5e9182b643909eb.js +316 -0
  67. package/assets/esri/core/workers/chunks/bb4574a87ca21e719f0d.js +1 -0
  68. package/assets/esri/core/workers/chunks/{07639f406b71bb49ffd6.js → bdbb5b33f0f49661bf6d.js} +1 -1
  69. package/assets/esri/core/workers/chunks/c042269586921e337be9.js +1 -0
  70. package/assets/esri/core/workers/chunks/c623918e289a09905cd1.js +1 -0
  71. package/assets/esri/core/workers/chunks/c7391b0b5a9c916a53f7.js +1 -0
  72. package/assets/esri/core/workers/chunks/{43d28c6509c21b8917a8.js → ca7523c14d81c470e92e.js} +1 -1
  73. package/assets/esri/core/workers/chunks/cd2708fb7636b3ace229.js +1 -0
  74. package/assets/esri/core/workers/chunks/d445e9399fe4ca3d2a50.js +1 -0
  75. package/assets/esri/core/workers/chunks/d7683a95775c9f401a7e.js +1 -0
  76. package/assets/esri/core/workers/chunks/{9d6945cda99d14af83ac.js → d7d9656b990ce8be2152.js} +1 -1
  77. package/assets/esri/core/workers/chunks/df4a0af329ce94a47a7b.js +1 -0
  78. package/assets/esri/core/workers/chunks/e10d6e511921394474ca.js +1 -0
  79. package/assets/esri/core/workers/chunks/e4b6aa8f67c2bd285020.js +1 -0
  80. package/assets/esri/core/workers/chunks/e6ca02f98f855024f74b.js +1 -0
  81. package/assets/esri/core/workers/chunks/{892157696e8f9e38c472.js → e6e837e43b9348050832.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{d3325ed8d224e2350db7.js → e8a3ad00936f2ccaf362.js} +1 -1
  83. package/assets/esri/core/workers/chunks/ef7063ee790d2d64d4b2.js +1 -0
  84. package/assets/esri/core/workers/chunks/{b65fcfde62d49de1fa54.js → ef977be20a647aeded0a.js} +1 -1
  85. package/assets/esri/core/workers/chunks/efb631371b6bb3f043bb.js +1 -0
  86. package/assets/esri/core/workers/chunks/{0f5693541111fcae0c2f.js → f0914715e90e43466f8c.js} +1 -1
  87. package/assets/esri/core/workers/chunks/f95e488d2b86e320624f.js +1 -0
  88. package/assets/esri/core/workers/chunks/{bfc063d4431bfa162160.js → fd09f38fb4d99bf34988.js} +1 -1
  89. package/chunks/boundedPlane.js +1 -1
  90. package/config.js +1 -1
  91. package/core/accessorSupport/ensureType.js +1 -1
  92. package/core/compilerUtils.js +1 -1
  93. package/core/typedArrayUtil.js +1 -1
  94. package/core/units.js +1 -1
  95. package/core/workers/loaderConfig.js +1 -1
  96. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  97. package/geometry/support/MeshTexture.js +1 -1
  98. package/geometry/support/aaBoundingRect.js +1 -1
  99. package/geometry/support/boundedPlane.js +1 -1
  100. package/geometry/support/heightModelInfoUtils.js +1 -1
  101. package/geometry/support/meshUtils/External.js +1 -1
  102. package/geometry/support/meshUtils/exporters/gltf/imageutils.js +1 -1
  103. package/geometry/support/meshUtils/loadExternal.js +1 -1
  104. package/geometry/support/rotate.js +1 -1
  105. package/interfaces.d.ts +0 -1
  106. package/kernel.js +1 -1
  107. package/layers/BuildingSceneLayer.d.ts +1 -1
  108. package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +1 -1
  109. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  110. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  111. package/layers/graphics/dehydratedFeatureComparison.js +1 -1
  112. package/layers/graphics/dehydratedFeatures.js +1 -1
  113. package/layers/graphics/hydratedFeatures.js +1 -1
  114. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  115. package/layers/raster/functions/changeDetectionUtils.js +1 -1
  116. package/layers/raster/functions/customBandIndexUtils.js +1 -1
  117. package/layers/raster/functions/focalStatUtils.js +1 -1
  118. package/layers/raster/functions/pixelTransformUtils.js +1 -1
  119. package/layers/save/featureLayerUtils.js +1 -1
  120. package/layers/support/ElevationSampler.js +1 -1
  121. package/layers/support/SubtypeSublayer.js +1 -1
  122. package/layers/support/domains.js +1 -1
  123. package/networks/support/TopologyValidationJobInfo.js +1 -1
  124. package/networks/support/TraceJobInfo.js +1 -1
  125. package/package.json +2 -2
  126. package/renderers/support/RasterSymbolizer.js +1 -1
  127. package/renderers/support/rendererConversion.js +1 -1
  128. package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
  129. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  130. package/rest/support/JobInfo.js +1 -1
  131. package/rest/support/ServiceAreaParameters.js +1 -1
  132. package/smartMapping/heuristics/sizeRange.js +1 -1
  133. package/smartMapping/renderers/support/utils.js +1 -1
  134. package/smartMapping/statistics/support/statsWorker.js +1 -1
  135. package/smartMapping/statistics/support/utils.js +1 -1
  136. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  137. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  138. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  139. package/smartMapping/support/utils.js +1 -1
  140. package/support/revision.js +1 -1
  141. package/symbols/support/ElevationInfo.d.ts +2 -2
  142. package/symbols/support/IconSymbol3DLayerResource.d.ts +1 -1
  143. package/symbols/support/defaults.js +1 -1
  144. package/symbols/support/defaults3D.js +1 -1
  145. package/symbols/support/previewSymbol3D.js +1 -1
  146. package/symbols/support/symbolLayerUtils3D.js +1 -1
  147. package/symbols/support/symbolUtils.js +1 -1
  148. package/symbols/support/utils.js +1 -1
  149. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  150. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +16 -11
  151. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  152. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  153. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  154. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  155. package/views/2d/engine/webgl/TextureUploadManager.js +1 -1
  156. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  157. package/views/2d/input/handlers/DoubleTapDragZoom.js +1 -1
  158. package/views/2d/input/handlers/KeyZoom.js +1 -1
  159. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  160. package/views/2d/layers/TileLayerView2D.js +1 -1
  161. package/views/3d/analysis/AreaMeasurement/support/utils.js +1 -1
  162. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  163. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  164. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +16 -11
  165. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  166. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  167. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  168. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  169. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  170. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  171. package/views/3d/environment/CloudsParameters.js +1 -1
  172. package/views/3d/environment/CloudsRenderer.js +1 -1
  173. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  174. package/views/3d/glTF/internal/Resource.js +1 -1
  175. package/views/3d/glTF/internal/fillDefaults.js +1 -1
  176. package/views/3d/interactive/Manipulator3D.js +1 -1
  177. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  178. package/views/3d/interactive/editingTools/isSupportedObjectUtils.js +1 -1
  179. package/views/3d/interactive/editingTools/move/isSupportedObject.js +1 -1
  180. package/views/3d/interactive/editingTools/transform/isSupportedGraphic.js +1 -1
  181. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  182. package/views/3d/layers/I3SMeshView3D.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  184. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  185. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  186. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  187. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  188. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  189. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  190. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  191. package/views/3d/layers/graphics/lineUtils.js +1 -1
  192. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  193. package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
  194. package/views/3d/layers/graphics/primitiveObjectSymbolUtils.js +1 -1
  195. package/views/3d/layers/i3s/BuildingFilterUtil.js +1 -1
  196. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  197. package/views/3d/layers/i3s/I3SNode.js +1 -1
  198. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  199. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  200. package/views/3d/layers/i3s/SphereCone.js +5 -0
  201. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  202. package/views/3d/layers/support/edgeUtils.js +1 -1
  203. package/views/3d/layers/support/featureReference.js +1 -1
  204. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  205. package/views/3d/layers/support/patternUtils.js +1 -1
  206. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  207. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  208. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  209. package/views/3d/support/buffer/glUtil.js +1 -1
  210. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  211. package/views/3d/support/viewpointUtils.js +1 -1
  212. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  213. package/views/3d/webgl/RenderNode.js +1 -1
  214. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +8 -8
  215. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
  216. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  217. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +2 -2
  218. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -2
  219. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +6 -6
  220. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +1 -1
  221. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +5 -5
  222. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +3 -3
  223. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +1 -1
  224. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  225. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  226. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  227. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  228. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +4 -4
  229. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +8 -8
  230. package/views/VideoView.js +1 -1
  231. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  232. package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +5 -0
  233. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  234. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  235. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  236. package/views/analysis/ElevationProfile/constants.js +1 -1
  237. package/views/draw/Draw.js +1 -1
  238. package/views/input/ViewEvents.js +1 -1
  239. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  240. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  241. package/views/interactive/snapping/featureSources/snappingCandidateElevationFilter.js +1 -1
  242. package/views/interactive/snapping/featureSources/symbologySnappingCandidates.js +1 -1
  243. package/views/support/PromiseQueue.js +1 -1
  244. package/views/support/screenUtils.js +1 -1
  245. package/views/support/screenshotUtils.js +1 -1
  246. package/views/webgl/FramebufferObject.js +1 -1
  247. package/views/webgl/Uniform.js +1 -1
  248. package/views/webgl/Util.js +1 -1
  249. package/webscene/Slide.d.ts +2 -2
  250. package/webscene/spec-certification/api.js +1 -1
  251. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  252. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  253. package/widgets/BatchAttributeForm.js +1 -1
  254. package/widgets/Editor/workflowUtils.js +1 -1
  255. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  256. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  257. package/widgets/FeatureForm.js +1 -1
  258. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  259. package/widgets/Sketch/support/OperationHandle.js +1 -1
  260. package/widgets/TimeSlider.js +1 -1
  261. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  262. package/widgets/support/dateUtils.js +1 -1
  263. package/assets/esri/core/workers/chunks/055fdc5134d54174444d.js +0 -316
  264. package/assets/esri/core/workers/chunks/058fb2cd6387acfd458c.js +0 -1
  265. package/assets/esri/core/workers/chunks/08359ae020238a565955.js +0 -1
  266. package/assets/esri/core/workers/chunks/0ae018098906d6a88904.js +0 -1
  267. package/assets/esri/core/workers/chunks/0cd3acfbf9ee991bdab4.js +0 -1
  268. package/assets/esri/core/workers/chunks/0dc3a04ce717b7ddd957.js +0 -1
  269. package/assets/esri/core/workers/chunks/0e5cd0cf6ab7cb37d723.js +0 -1
  270. package/assets/esri/core/workers/chunks/0ee407b8db5c07a00d82.js +0 -1
  271. package/assets/esri/core/workers/chunks/10373885604655f673df.js +0 -1
  272. package/assets/esri/core/workers/chunks/119822a646834c1cebc0.js +0 -1
  273. package/assets/esri/core/workers/chunks/13d61d34e55c80e4ecdf.js +0 -1
  274. package/assets/esri/core/workers/chunks/17dea03fc4eb414f0022.js +0 -1
  275. package/assets/esri/core/workers/chunks/1967239713b58dccfd81.js +0 -1
  276. package/assets/esri/core/workers/chunks/1c350a2c4014146dbcd9.js +0 -1
  277. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +0 -1
  278. package/assets/esri/core/workers/chunks/226acd251ad7d7ee3b57.js +0 -1
  279. package/assets/esri/core/workers/chunks/22b07c54a5fcc27771b0.js +0 -1
  280. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +0 -1
  281. package/assets/esri/core/workers/chunks/2402d305a77fef4694a0.js +0 -1
  282. package/assets/esri/core/workers/chunks/27f096c434f049b8df01.js +0 -1
  283. package/assets/esri/core/workers/chunks/3371935a4fd6346d3a17.js +0 -1
  284. package/assets/esri/core/workers/chunks/3c4f8597f602779174f1.js +0 -1
  285. package/assets/esri/core/workers/chunks/3da53c017f9c5d2d778a.js +0 -1
  286. package/assets/esri/core/workers/chunks/4773a358832f87963766.js +0 -1
  287. package/assets/esri/core/workers/chunks/492515860198f38dd698.js +0 -1
  288. package/assets/esri/core/workers/chunks/4f33a2ecb154a2c2449c.js +0 -1
  289. package/assets/esri/core/workers/chunks/4f6f181ee83b4d484518.js +0 -1
  290. package/assets/esri/core/workers/chunks/52726458f590e726d52c.js +0 -1
  291. package/assets/esri/core/workers/chunks/536c492fdda30f2f1288.js +0 -1
  292. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +0 -1
  293. package/assets/esri/core/workers/chunks/63b8cd7d5cafbaeed894.js +0 -1
  294. package/assets/esri/core/workers/chunks/6cb44cd319cb6c2539c8.js +0 -1
  295. package/assets/esri/core/workers/chunks/7f4fa2f2e85863d3cfb9.js +0 -1
  296. package/assets/esri/core/workers/chunks/8f4c480c418eba299c2b.js +0 -1
  297. package/assets/esri/core/workers/chunks/a3836f6a93924ee4816e.js +0 -1
  298. package/assets/esri/core/workers/chunks/ab520fd1ae917daf07d8.js +0 -1
  299. package/assets/esri/core/workers/chunks/acc7ff44bfcb5c195114.js +0 -1
  300. package/assets/esri/core/workers/chunks/b25a131c04092c3ab75d.js +0 -1
  301. package/assets/esri/core/workers/chunks/b7960ab9a9da7f88184c.js +0 -1
  302. package/assets/esri/core/workers/chunks/b9909264cfea68d5f2a1.js +0 -1
  303. package/assets/esri/core/workers/chunks/bb08359610a41e304b55.js +0 -1
  304. package/assets/esri/core/workers/chunks/bfbbcaa1fb04f17fc869.js +0 -1
  305. package/assets/esri/core/workers/chunks/d30cfc5fa302cc08d862.js +0 -1
  306. package/assets/esri/core/workers/chunks/d75adfd4acb3c92accc9.js +0 -1
  307. package/assets/esri/core/workers/chunks/da99fd0d3106dd357743.js +0 -1
  308. package/assets/esri/core/workers/chunks/de71db3b0fb947b13c97.js +0 -1
  309. package/assets/esri/core/workers/chunks/dfbbead4c24d13682891.js +0 -1
  310. package/assets/esri/core/workers/chunks/e4ba850e8344ac2c5fc0.js +0 -1
  311. package/assets/esri/core/workers/chunks/e705d041f6c1632bfbcc.js +0 -1
  312. package/assets/esri/core/workers/chunks/f9370830051865a3435b.js +0 -1
  313. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import c from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as f}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as v}from"../../statistics/support/WorkerClient.js";import{getFieldsList as q,isAnyDateField as V,fieldDelimiter as x}from"../utils.js";import _ from"./LayerAdapter.js";import{getHistogramAttributeDefinition as z,getAttributeBinsQuery as T,processQueryAttributeBinsResult as N}from"./support/histogramUtils.js";import{ensureFeaturesJSON as M,getSummaryStatsQuery as L,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as E,getMissingFields as j,updateQueryWithFeatureFilter as b,getUVQuery as k,getUniqueValuesFromFeatureSet as I,getBins as O,getDomainsForFields as Q,getPredominantCategoriesFromUVInfos as J}from"./support/utils.js";import{processSummaryStatisticsResult as B,createUVResult as P,resolveCBResult as U}from"../../../statistics/utils.js";import{loadArcade as A}from"../../../support/loadArcade.js";const $=5;let G=null,R=class extends _{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n(()=>!e.updating,t.signal);await s(i,5e3,t).catch(e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e})}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?M(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?M(n.features):n.features}_fetchFeaturesForStats(e,t){return q({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression}).then(r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,signal:e.signal},t))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=L(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,V(t)||y(t));return B(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:c}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=E(r),n.timeZone=r.timeZone,n.fieldInfos=c),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const t=await import("../../../geometry/operators/intersectionOperator.js");r=e.filter(({geometry:e})=>!(!e||!t.execute(e,a)))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,layerViewFunc:u,signal:m}=e;let p=e.returnGeometry;if(null==p&&l){if(!G){const{arcadeUtils:e}=await A();G=e}const e=G.hasGeometryOperations(l);e&&await G.enableGeometryOperations(),p=e}let y=null,c=null,f=null,d=null,h=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;y=await a.whenLayerView(e),c=null!=u&&null!=y&&u in y&&"function"==typeof y[u]}catch{c=!1}if(c)try{await this._waitForLayerViewUpdate(y);const e=await q({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l});j(this,e,y).length?c=!1:(f=this.layer.createQuery(),f.outFields=e,f.returnGeometry=!1,b(f,r)),y.suspended&&(c=!1)}catch{c=!1}return c||(d=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,valueExpression:l,normalizationField:n,returnGeometry:p,filter:r,view:a,signal:m},"json"),h=(await q({valueExpression:l})).map(e=>this.getField(e)?.toJSON()).filter(Boolean)),{layerView:y,query:f,featuresJSON:d,fieldInfos:h}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await I(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:x,view:e.view,signal:e.signal});return P(o,t,e.returnAllCodedValues,x)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:x,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=E(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then(e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}}),t.then(t=>O(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=z(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await T(e,this,u,l);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const c=await n.queryAttributeBins(m,{signal:a});return N(c,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=z(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||$,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=U(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=E(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new c({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await Q(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n(()=>!o.updating,i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=f(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return J(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,filter:l,signal:u}=e,m=this.layer.createQuery(),p=1;if(m.outSpatialReference=i?.spatialReference,m.returnGeometry=!!n,m.outFields=o,b(m,l),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const y=await i.whenLayerView(this.layer);if(j(this,o,y).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(y,m,u,a),f=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,f,p)}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=v.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],R.prototype,"adapterName",void 0),e([l({constructOnly:!0})],R.prototype,"layer",void 0),R=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],R);export{R as default};
5
+ import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import f from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as c}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as q}from"../../statistics/support/WorkerClient.js";import{getFieldsList as v,isAnyDateField as x,getWhereClause as V,fieldDelimiter as _}from"../utils.js";import z from"./LayerAdapter.js";import{getHistogramAttributeDefinition as T,getAttributeBinsQuery as N,processQueryAttributeBinsResult as M}from"./support/histogramUtils.js";import{ensureFeaturesJSON as L,getSummaryStatsQuery as E,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as j,getMissingFields as b,updateQueryWithFeatureFilter as I,getUVQuery as k,getUniqueValuesFromFeatureSet as O,getBins as Q,getDomainsForFields as J,getPredominantCategoriesFromUVInfos as B}from"./support/utils.js";import{processSummaryStatisticsResult as P,createUVResult as U,resolveCBResult as A}from"../../../statistics/utils.js";import{loadArcade as $}from"../../../support/loadArcade.js";const G=5;let R=null,D=class extends z{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n(()=>!e.updating,t.signal);await s(i,5e3,t).catch(e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e})}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?L(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?L(n.features):n.features}_fetchFeaturesForStats(e,t){return v({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression,fields:e.fields}).then(r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,signal:e.signal},t))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=E(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,x(t)||y(t));return P(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:f}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=j(r),n.timeZone=r.timeZone,n.fieldInfos=f),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const t=await import("../../../geometry/operators/intersectionOperator.js");r=e.filter(({geometry:e})=>!(!e||!t.execute(e,a)))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,sqlExpression:u,layerViewFunc:m,signal:p}=e;let y=e.returnGeometry;if(null==y&&l){if(!R){const{arcadeUtils:e}=await $();R=e}const e=R.hasGeometryOperations(l);e&&await R.enableGeometryOperations(),y=e}let f=null,c=null,d=null,h=null,w=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;f=await a.whenLayerView(e),c=null!=m&&null!=f&&m in f&&"function"==typeof f[m]}catch{c=!1}if(c)try{await this._waitForLayerViewUpdate(f);const e=u?await V(u,this.layer.fieldsIndex):null,t=e?.fieldNames,a=await v({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,fields:t});b(this,a,f).length?c=!1:(d=this.layer.createQuery(),d.outFields=a,d.returnGeometry=!1,I(d,r)),f.suspended&&(c=!1)}catch{c=!1}if(!c){const e=u?await V(u,this.layer.fieldsIndex):null,t=e?.fieldNames;h=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,fields:t,valueExpression:l,normalizationField:n,returnGeometry:y,filter:r,view:a,signal:p},"json"),w=(await v({valueExpression:l})).map(e=>this.getField(e)?.toJSON()).filter(Boolean)}return{layerView:f,query:d,featuresJSON:h,fieldInfos:w}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await O(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:_,view:e.view,signal:e.signal});return U(o,t,e.returnAllCodedValues,_)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:_,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=j(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then(e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}}),t.then(t=>Q(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=T(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await N(e,this,u,l);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const f=await n.queryAttributeBins(m,{signal:a});return M(f,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=T(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||G,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=A(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=j(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new f({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await J(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n(()=>!o.updating,i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=c(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return B(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,filter:l,signal:u}=e,m=this.layer.createQuery(),p=1;if(m.outSpatialReference=i?.spatialReference,m.returnGeometry=!!n,m.outFields=o,I(m,l),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const y=await i.whenLayerView(this.layer);if(b(this,o,y).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const f=await this._fetchFeaturesFromMemory(y,m,u,a),c=null!=s&&s>0&&s<=f.length?s:f.length;return t(f,c,p)}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=q.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],D.prototype,"adapterName",void 0),e([l({constructOnly:!0})],D.prototype,"layer",void 0),D=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],D);export{D as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{resolveTimeZone as i}from"../../../../intl/date.js";import{isTimeOnlyField as n,isDateField as t,isTimestampOffsetField as a,isDateOnlyField as r}from"../../../../layers/support/fieldUtils.js";import o from"../../../../rest/support/AttributeBinsQuery.js";import l from"../../../../rest/support/AutoIntervalBinParameters.js";import s from"../../../../rest/support/DateBinParameters.js";import m from"../../../../rest/support/FixedBoundariesBinParameters.js";import u from"../../../../rest/support/FixedIntervalBinParameters.js";import d from"../../../../rest/support/GenerateRendererParameters.js";import p from"../../../../rest/support/StatisticDefinition.js";import{getSQLFilterForNormalization as f,mergeWhereClauses as c,getRangeExpr as y}from"../../../statistics/support/utils.js";import{isAnyDateField as z}from"../../utils.js";import{getSQLExpressionForDateOrTimeField as x,getFieldExpr as v,updateQueryWithFeatureFilter as w,defaultNumBins as T,generateBinParams as h,getViewInfoParams as F}from"./utils.js";import{createClassBreaksDefinition as B}from"../../../../statistics/utils.js";const V="countOFExpr",j="lowerBoundary",E="upperBoundary";function q(e,i,t){const a=e.valueExpression||e.sqlExpression,r=e.signal;if(!a){const{field:a,normalizationType:o,normalizationField:l}=e,s=a?i.getField(a):null,m=z(s)||n(s),u={field:a,normalizationType:o,normalizationField:l,normalizationTotal:t,layer:i};return{sqlExpression:m?x(i,s):v(u),sqlWhere:m?null:e.sqlWhere||f({field:a,normalizationType:o,normalizationField:l}),filter:e.filter,signal:r}}return{valueExpression:e.valueExpression,sqlExpression:e.sqlExpression,sqlWhere:e.sqlWhere,filter:e.filter,signal:r}}async function I(e,i,n){const{field:t,normalizationType:a,normalizationField:r,signal:o}=e,l=f({field:t,normalizationType:a,normalizationField:r}),s=new d({classificationDefinition:B({field:t,normalizationType:a,normalizationField:r,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,definedInterval:e.definedInterval,breakCount:e.numBins||T}),where:c(l,n)});return i.generateRenderer(s,o).then(e=>{const{normalizationTotal:n,classBreaks:o}=e;return h({field:t,normalizationType:a,normalizationField:r,normalizationTotal:n,classBreaks:o,where:l,layer:i})})}async function M(i,t,a,o,d){const{field:p,sqlExpression:f,normalizationField:c,classificationMethod:z,normalizationType:x}=i,w=p?t.getField(p):null,h=n(w),F=r(w)||h,B=i.numBins||T;if(F){if(x||z)throw new e(`${t.adapterName}:not-supported`,"NormalizationType and classificationMethod are not supported for date-only and time-only fields");const i=(o-a)/B/1e3,n=i/86400;return new s({field:p,expression:f,interval:{unit:h?"seconds":"days",value:Math.ceil(h?i:n)},start:a,end:o})}if("defined-interval"===z)return new u({field:p,expression:f,normalizationField:c,normalizationTotal:d,normalizationType:x,interval:i.definedInterval??Math.ceil((o-a)/B),start:x?null:a,end:x?null:o,normalizationMinValue:x?a:null,normalizationMaxValue:x?o:null});if("manual"===z)throw new e(`${t.adapterName}:not-supported`,"Layer does not support manual classificationMethod");if("natural-breaks"===z||"quantile"===z||"standard-deviation"===z){const n=v({field:p,normalizationField:c,normalizationTotal:d,normalizationType:x,layer:t}),r=null!==i.minValue&&null!==i.maxValue?y(n,i.minValue,i.maxValue):void 0,o=await I(i,t,r);if(!o.intervals)throw new e(`${t.adapterName}:invalid`,"Invalid intervals returned from generate renderer");const l=[a,...o.intervals.map(e=>e[1])];return new m({field:x?null:p,expression:x?n:f,boundaries:l})}return new l({field:p,normalizationField:c,normalizationTotal:d,normalizationType:x,expression:f,numBins:B,start:x?null:a,end:x?null:o,normalizationMinValue:x?a:null,normalizationMaxValue:x?o:null})}function g(e,i,n,t){return null!=n&&null!=t?Promise.resolve({min:n,max:t}):i.summaryStatistics({...e,outStatisticTypes:{include:["min","max"]}}).then(e=>({min:e.min,max:e.max}))}async function b(e,n,r,l){const{field:s,minValue:m,maxValue:u,filter:d,view:f}=e,y=s?n.getField(s):null,z=t(y)||a(y),x=q(e,n,r),{min:v,max:T}=await g(x,n,m,u);if(null==v||null==T)return{query:null,min:v,max:T};const h=new p({statisticType:"count",outStatisticFieldName:V,onStatisticField:"1"}),{where:F,timeExtent:B}=l||{},j=c(F,x.sqlWhere),E="lowerBoundary",I="upperBoundary",b=new o({binParameters:await M(e,n,v,T,r),outStatistics:[h],binOrder:e.sortOrder,where:j,timeExtent:B,lowerBoundaryAlias:E,upperBoundaryAlias:I,outTimeZone:f?.timeZone&&z?i(f.timeZone):null});return w(b,d),{query:b,min:v,max:T}}function D(e,i=!1){if("string"!=typeof e)return e;return(i?new Date(`1970-01-01T${e}Z`):new Date(e)).getTime()}function P(e,i,t){const a=n(i);return{...t,bins:e.features.map(e=>({minValue:D(e.attributes[j],a),maxValue:D(e.attributes[E],a),count:e.attributes[V]}))}}function S(e,i,n){const{valueExpression:t,view:a}=e,{featuresJSON:r,graphics:o,fieldInfos:l}=i,s={field:e.field,valueExpression:t,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:n,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numBins:e.numBins};return t&&a&&(r||o)&&(s.viewInfoParams=F(a),s.timeZone=a.timeZone,s.fieldInfos=l),s}export{I as binParamsFromGenRend,D as formatHistogramBinValue,b as getAttributeBinsQuery,g as getDataRange,S as getHistogramAttributeDefinition,q as getQueryParamsForExpr,P as processQueryAttributeBinsResult};
5
+ import e from"../../../../core/Error.js";import{resolveTimeZone as i}from"../../../../intl/date.js";import{isTimeOnlyField as n,isDateField as t,isTimestampOffsetField as a,isDateOnlyField as r}from"../../../../layers/support/fieldUtils.js";import o from"../../../../rest/support/AttributeBinsQuery.js";import l from"../../../../rest/support/AutoIntervalBinParameters.js";import s from"../../../../rest/support/DateBinParameters.js";import u from"../../../../rest/support/FixedBoundariesBinParameters.js";import m from"../../../../rest/support/FixedIntervalBinParameters.js";import d from"../../../../rest/support/GenerateRendererParameters.js";import p from"../../../../rest/support/StatisticDefinition.js";import{getSQLFilterForNormalization as f,mergeWhereClauses as c,getRangeExpr as y}from"../../../statistics/support/utils.js";import{isAnyDateField as x}from"../../utils.js";import{getSQLExpressionForDateOrTimeField as z,getFieldExpr as v,updateQueryWithFeatureFilter as T,defaultNumBins as w,generateBinParams as h,getViewInfoParams as F}from"./utils.js";import{createClassBreaksDefinition as V}from"../../../../statistics/utils.js";const B="countOFExpr",E="lowerBoundary",q="upperBoundary";function b(e,i,t){const a=e.valueExpression||e.sqlExpression,r=e.signal;if(!a){const{field:a,normalizationType:o,normalizationField:l}=e,s=a?i.getField(a):null,u=x(s)||n(s),m={field:a,normalizationType:o,normalizationField:l,normalizationTotal:t,layer:i};return{sqlExpression:u?z(i,s):v(m),sqlWhere:u?null:e.sqlWhere||f({field:a,normalizationType:o,normalizationField:l}),filter:e.filter,signal:r}}return{valueExpression:e.valueExpression,sqlExpression:e.sqlExpression,sqlWhere:e.sqlWhere,filter:e.filter,signal:r}}async function j(e,i,n){const{field:t,normalizationType:a,normalizationField:r,signal:o}=e,l=f({field:t,normalizationType:a,normalizationField:r}),s=new d({classificationDefinition:V({field:t,normalizationType:a,normalizationField:r,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,definedInterval:e.definedInterval,breakCount:e.numBins||w}),where:c(l,n)});return i.generateRenderer(s,o).then(e=>{const{normalizationTotal:n,classBreaks:o}=e;return h({field:t,normalizationType:a,normalizationField:r,normalizationTotal:n,classBreaks:o,where:l,layer:i})})}async function I(i,t,a,o,d){const{field:p,sqlExpression:f,normalizationField:c,classificationMethod:x,normalizationType:z}=i,T=p?t.getField(p):null,h=n(T),F=r(T)||h,V=i.numBins||w;if(F){if(z||x)throw new e(`${t.adapterName}:not-supported`,"NormalizationType and classificationMethod are not supported for date-only and time-only fields");const i=(o-a)/V/1e3,n=i/86400;return new s({field:p,expression:f,expressionValueType:f?"double":void 0,interval:{unit:h?"seconds":"days",value:Math.ceil(h?i:n)},start:a,end:o})}if("defined-interval"===x)return new m({field:p,expression:f,expressionValueType:f?"double":void 0,normalizationField:c,normalizationTotal:d,normalizationType:z,interval:i.definedInterval??Math.ceil((o-a)/V),start:z?null:a,end:z?null:o,normalizationMinValue:z?a:null,normalizationMaxValue:z?o:null});if("manual"===x)throw new e(`${t.adapterName}:not-supported`,"Layer does not support manual classificationMethod");if("natural-breaks"===x||"quantile"===x||"standard-deviation"===x){const n=v({field:p,normalizationField:c,normalizationTotal:d,normalizationType:z,layer:t}),r=null!==i.minValue&&null!==i.maxValue?y(n,i.minValue,i.maxValue):void 0,o=await j(i,t,r);if(!o.intervals)throw new e(`${t.adapterName}:invalid`,"Invalid intervals returned from generate renderer");const l=[a,...o.intervals.map(e=>e[1])];return new u({field:z?null:p,expression:z?n:f,expressionValueType:f?"double":void 0,boundaries:l})}return new l({field:p,normalizationField:c,normalizationTotal:d,normalizationType:z,expression:f,expressionValueType:f?"double":void 0,numBins:V,start:z?null:a,end:z?null:o,normalizationMinValue:z?a:null,normalizationMaxValue:z?o:null})}function M(e,i,n,t){return null!=n&&null!=t?Promise.resolve({min:n,max:t}):i.summaryStatistics({...e,outStatisticTypes:{include:["min","max"]}}).then(e=>({min:e.min,max:e.max}))}async function g(e,n,r,l){const{field:s,minValue:u,maxValue:m,filter:d,view:f}=e,y=s?n.getField(s):null,x=t(y)||a(y),z=b(e,n,r),{min:v,max:w}=await M(z,n,u,m);if(null==v||null==w)return{query:null,min:v,max:w};const h=new p({statisticType:"count",outStatisticFieldName:B,onStatisticField:"1"}),{where:F,timeExtent:V}=l||{},E=c(F,z.sqlWhere),q="lowerBoundary",j="upperBoundary",g=new o({binParameters:await I(e,n,v,w,r),outStatistics:[h],binOrder:e.sortOrder,where:E,timeExtent:V,lowerBoundaryAlias:q,upperBoundaryAlias:j,outTimeZone:f?.timeZone&&x?i(f.timeZone):null});return T(g,d),{query:g,min:v,max:w}}function D(e,i=!1){if("string"!=typeof e)return e;return(i?new Date(`1970-01-01T${e}Z`):new Date(e)).getTime()}function P(e,i,t){const a=n(i);return{...t,bins:e.features.map(e=>({minValue:D(e.attributes[E],a),maxValue:D(e.attributes[q],a),count:e.attributes[B]}))}}function S(e,i,n){const{valueExpression:t,view:a}=e,{featuresJSON:r,graphics:o,fieldInfos:l}=i,s={field:e.field,valueExpression:t,sqlExpression:e.sqlExpression,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:n,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numBins:e.numBins};return t&&a&&(r||o)&&(s.viewInfoParams=F(a),s.timeZone=a.timeZone,s.fieldInfos=l),s}export{j as binParamsFromGenRend,D as formatHistogramBinValue,g as getAttributeBinsQuery,M as getDataRange,S as getHistogramAttributeDefinition,b as getQueryParamsForExpr,P as processQueryAttributeBinsResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{convertDateTimeFieldFormatToIntlOptions as t,formatDate as e,convertDateFormatToIntlOptions as n,formatTimestamp as o,formatTimeOnly as r,formatDateOnly as i}from"../../intl/date.js";import{isDateField as s,isDateOnlyField as a,isTimestampOffsetField as l}from"../../layers/support/fieldUtils.js";import{getWellKnownBasemapId as u}from"../../support/basemapUtils.js";import{loadArcade as d}from"../../support/loadArcade.js";import{utc as m}from"../../time/constants.js";import{getTimeZoneFormattingOptions as f}from"../../time/timeZoneUtils.js";const c=",",p={light:["streets","gray","topo","terrain","oceans","osm","gray-vector","streets-vector","topo-vector","streets-relief-vector","streets-navigation-vector","topo-3d","navigation-3d","streets-3d","osm-3d","gray-3d"],dark:["satellite","hybrid","dark-gray","dark-gray-vector","streets-night-vector","navigation-dark-3d","streets-dark-3d","dark-gray-3d"]},g="percent-of-total",y="field",h={exclude:["median"]},v={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864e5},T=new Set(["integer","small-integer"]);let Z=null;const $=["date","date-only","timestamp-offset"];function U(t){return s(t)||a(t)||l(t)}async function w(t){const{field:e,field2:n,field3:o,normalizationField:r,valueExpression:i,fields:s}=t;let a=[];if(i){if(!Z){const{arcadeUtils:t}=await d();Z=t}a=Z.extractFieldNames(i)}return e&&a.push(e),n&&a.push(n),o&&a.push(o),r&&a.push(r),s&&a.push(...s),a}function F(t){let e=t.normalizationType;return e||(t.normalizationField?e=y:null!=t.normalizationTotal&&(e=g)),e??void 0}function S(t){return String(t).padStart(2,"0")}function k(t,e,n){let o;if("date"===e||"number"===e){"number"===e&&(t=new Date(t));o=`TIMESTAMP'${n?t.getFullYear():t.getUTCFullYear()}-${S((n?t.getMonth():t.getUTCMonth())+1)}-${S(n?t.getDate():t.getUTCDate())} ${S(n?t.getHours():t.getUTCHours())}:${S(n?t.getMinutes():t.getUTCMinutes())}:${S(n?t.getSeconds():t.getUTCSeconds())}'`}else o=t;return o}function C(t,e,n,o){const{hasQueryEngine:r}=t,i=`(${k(n,D(t,n),r)} - ${k(e,D(t,e),r)})`;let s=v[o],a="/";s<1&&(s=1/s,a="*");return{sqlExpression:1===s?i:`(${i} ${a} ${s})`,sqlWhere:null}}function D(t,e){if(e instanceof Date)return"date";if("number"==typeof e)return"number";if("string"==typeof e){const n=t.getField(e);if("<now>"===e.toLowerCase())return;if(s(n))return"field"}}function b(t,e=p){for(const n in e)if(e[n].includes(t))return n}function j(t,e,n=!0){let o=null;return t&&("string"==typeof t?e.includes(t)&&(o=t):o=u(t)),n?o||"gray":o}function M(t,e){const n=e&&t.getField(e);return!!n&&T.has(n.type)}function N(t){return`cast(${t} as float)`}function x(s,a){const{format:l,fieldFormat:u,timeZoneOptions:d,fieldType:c}=a??{},p=u?t(u):null;let g,y;if(d&&({timeZone:g,timeZoneName:y}=f(d.layerTimeZone,d.datesInUnknownTimezone,d.viewTimeZone,p||n(l||"short-date-short-time"),c)),"string"==typeof s&&isNaN(Date.parse("time-only"===c?`1970-01-01T${s}Z`:s)))return s;switch(c){case"date-only":{const t=p||n(l||"short-date");return"string"==typeof s?i(s,{...t}):e(s,{...t,timeZone:m})}case"time-only":{const t=p||n(l||"short-time");return"string"==typeof s?r(s,t):e(s,{...t,timeZone:m})}case"timestamp-offset":{if(!g&&"string"==typeof s&&new Date(s).toISOString()!==s)return s;const t=l||p||d?p||n(l||"short-date-short-time"):void 0,r=t?{...t,timeZone:g,timeZoneName:y}:void 0;return"string"==typeof s?o(s,r):e(s,r)}default:{const t=l||p||d?p||n(l||"short-date-short-time"):void 0;return e("string"==typeof s?new Date(s):s,t?{...t,timeZone:g,timeZoneName:y}:void 0)}}}export{N as castIntegerFieldToFloat,$ as dateTypes,p as defaultBasemapGroups,h as defaultStatisticTypes,c as fieldDelimiter,x as formatAnyDate,b as getBasemapGroup,j as getBasemapId,C as getDateDiffSQL,D as getDateType,w as getFieldsList,F as getNormalizationType,U as isAnyDateField,M as isIntegerField,v as unitValueInDays};
5
+ import{convertDateTimeFieldFormatToIntlOptions as t,formatDate as e,convertDateFormatToIntlOptions as n,formatTimestamp as r,formatTimeOnly as o,formatDateOnly as i}from"../../intl/date.js";import{isDateField as s,isDateOnlyField as a,isTimestampOffsetField as l}from"../../layers/support/fieldUtils.js";import{getWellKnownBasemapId as u}from"../../support/basemapUtils.js";import{loadArcade as f}from"../../support/loadArcade.js";import{utc as m}from"../../time/constants.js";import{getTimeZoneFormattingOptions as d}from"../../time/timeZoneUtils.js";const c=",",p={light:["streets","gray","topo","terrain","oceans","osm","gray-vector","streets-vector","topo-vector","streets-relief-vector","streets-navigation-vector","topo-3d","navigation-3d","streets-3d","osm-3d","gray-3d"],dark:["satellite","hybrid","dark-gray","dark-gray-vector","streets-night-vector","navigation-dark-3d","streets-dark-3d","dark-gray-3d"]},g="percent-of-total",y="field",h={exclude:["median"]},v={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864e5},T=new Set(["integer","small-integer"]);let Z,$=null;const w=["date","date-only","timestamp-offset"];function C(t){return s(t)||a(t)||l(t)}async function U(t,e){if(!t)return null;if(!Z){const t=await import("../../core/sql/WhereClauseCache.js").then(t=>t.WhereClauseCache);Z=new t(50,500)}return Z.get(t,e)}async function F(t){const{field:e,field2:n,field3:r,normalizationField:o,valueExpression:i,fields:s}=t;let a=[];if(i){if(!$){const{arcadeUtils:t}=await f();$=t}a=$.extractFieldNames(i)}return e&&a.push(e),n&&a.push(n),r&&a.push(r),o&&a.push(o),s&&a.push(...s),a}function S(t){let e=t.normalizationType;return e||(t.normalizationField?e=y:null!=t.normalizationTotal&&(e=g)),e??void 0}function j(t){return String(t).padStart(2,"0")}function k(t,e,n){let r;if("date"===e||"number"===e){"number"===e&&(t=new Date(t));r=`TIMESTAMP'${n?t.getFullYear():t.getUTCFullYear()}-${j((n?t.getMonth():t.getUTCMonth())+1)}-${j(n?t.getDate():t.getUTCDate())} ${j(n?t.getHours():t.getUTCHours())}:${j(n?t.getMinutes():t.getUTCMinutes())}:${j(n?t.getSeconds():t.getUTCSeconds())}'`}else r=t;return r}function D(t,e,n,r){const{hasQueryEngine:o}=t,i=`(${k(n,b(t,n),o)} - ${k(e,b(t,e),o)})`;let s=v[r],a="/";s<1&&(s=1/s,a="*");return{sqlExpression:1===s?i:`(${i} ${a} ${s})`,sqlWhere:null}}function b(t,e){if(e instanceof Date)return"date";if("number"==typeof e)return"number";if("string"==typeof e){const n=t.getField(e);if("<now>"===e.toLowerCase())return;if(s(n))return"field"}}function M(t,e=p){for(const n in e)if(e[n].includes(t))return n}function N(t,e,n=!0){let r=null;return t&&("string"==typeof t?e.includes(t)&&(r=t):r=u(t)),n?r||"gray":r}function x(t,e){const n=e&&t.getField(e);return!!n&&T.has(n.type)}function z(t){return`cast(${t} as float)`}function E(s,a){const{format:l,fieldFormat:u,timeZoneOptions:f,fieldType:c}=a??{},p=u?t(u):null;let g,y;if(f&&({timeZone:g,timeZoneName:y}=d(f.layerTimeZone,f.datesInUnknownTimezone,f.viewTimeZone,p||n(l||"short-date-short-time"),c)),"string"==typeof s&&isNaN(Date.parse("time-only"===c?`1970-01-01T${s}Z`:s)))return s;switch(c){case"date-only":{const t=p||n(l||"short-date");return"string"==typeof s?i(s,{...t}):e(s,{...t,timeZone:m})}case"time-only":{const t=p||n(l||"short-time");return"string"==typeof s?o(s,t):e(s,{...t,timeZone:m})}case"timestamp-offset":{if(!g&&"string"==typeof s&&new Date(s).toISOString()!==s)return s;const t=l||p||f?p||n(l||"short-date-short-time"):void 0,o=t?{...t,timeZone:g,timeZoneName:y}:void 0;return"string"==typeof s?r(s,o):e(s,o)}default:{const t=l||p||f?p||n(l||"short-date-short-time"):void 0;return e("string"==typeof s?new Date(s):s,t?{...t,timeZone:g,timeZoneName:y}:void 0)}}}export{z as castIntegerFieldToFloat,w as dateTypes,p as defaultBasemapGroups,h as defaultStatisticTypes,c as fieldDelimiter,E as formatAnyDate,M as getBasemapGroup,N as getBasemapId,D as getDateDiffSQL,b as getDateType,F as getFieldsList,S as getNormalizationType,U as getWhereClause,C as isAnyDateField,x as isIntegerField,v as unitValueInDays};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- const d="20251216",e="48385fb8d2d1adb9f9ec2db030481daee90c3457";export{d as buildDate,e as commitHash};
5
+ const c="20251216",d="79236f30035e37d8557e89a8c608cdbf58c9d550";export{c as buildDate,d as commitHash};
@@ -18,7 +18,7 @@ export interface ElevationInfoProperties<Modes extends ElevationInfoMode = Eleva
18
18
  * Mode | Description
19
19
  * ------|------------
20
20
  * on-the-ground | Elements are aligned to the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). If the scene contains an [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html), then elements are aligned to the [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html). If elements have z-values, then the z-values are ignored in this mode. Elements with 2D symbols are draped on the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html). This is the default mode for layers without z-values containing [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) rendered with [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html).
21
- * absolute-height | Elements are placed at an absolute elevation (z-value) above sea level. This z-value is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry's z-value. This mode doesn't take the elevation of the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or any other layers into account. This is the default value of elements with any geometry type where {@link symbols/support/ElevationInfo#hasZ} is `true`.
21
+ * absolute-height | Elements are placed at an absolute elevation (z-value) above sea level. This z-value is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry's z-value. This mode doesn't take the elevation of the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or any other layers into account. This is the default value of elements with any geometry type where `hasZ = true`.
22
22
  * relative-to-ground | Elements are placed at an elevation relative to the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html). The element's elevation is determined by summing up the elevation of the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html) and the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry's z-value. If the geometries don't have z-values, `relative-to-ground` is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html).
23
23
  * relative-to-scene | Elements are aligned to [extruded polygons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html), [meshes](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html), 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [BuildingSceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html), depending on which one has higher elevation. If the element is not directly above a building or any other element, it is aligned to the elevation of the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or the [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html). If present, the geometry's z-value is added to the elevation. If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry's z-value.
24
24
  */
@@ -51,7 +51,7 @@ export default class ElevationInfo<Modes extends ElevationInfoMode = ElevationIn
51
51
  * Mode | Description
52
52
  * ------|------------
53
53
  * on-the-ground | Elements are aligned to the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). If the scene contains an [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html), then elements are aligned to the [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html). If elements have z-values, then the z-values are ignored in this mode. Elements with 2D symbols are draped on the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html). This is the default mode for layers without z-values containing [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) rendered with [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html).
54
- * absolute-height | Elements are placed at an absolute elevation (z-value) above sea level. This z-value is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry's z-value. This mode doesn't take the elevation of the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or any other layers into account. This is the default value of elements with any geometry type where {@link symbols/support/ElevationInfo#hasZ} is `true`.
54
+ * absolute-height | Elements are placed at an absolute elevation (z-value) above sea level. This z-value is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry's z-value. This mode doesn't take the elevation of the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or any other layers into account. This is the default value of elements with any geometry type where `hasZ = true`.
55
55
  * relative-to-ground | Elements are placed at an elevation relative to the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html). The element's elevation is determined by summing up the elevation of the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html) and the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry's z-value. If the geometries don't have z-values, `relative-to-ground` is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html).
56
56
  * relative-to-scene | Elements are aligned to [extruded polygons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html), [meshes](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html), 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [BuildingSceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html), depending on which one has higher elevation. If the element is not directly above a building or any other element, it is aligned to the elevation of the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) or the [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) or [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html). If present, the geometry's z-value is added to the elevation. If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry's z-value.
57
57
  */
@@ -12,7 +12,7 @@ export default class IconSymbol3DLayerResource extends JSONSupport {
12
12
  accessor href: string | null | undefined;
13
13
  /**
14
14
  * Uses a built-in shape.
15
- * Note that when using the `cross` or `x` primitive, the {@link symbols/support/IconSymbol3DLayerResource#outline} property has to be defined to make the symbol visible. See the table below for list of possible values.
15
+ * Note that when using the `cross` or `x` primitive, the [IconSymbol3DLayer.outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) property has to be defined to make the symbol visible. See the table below for list of possible values.
16
16
  *
17
17
  * Value | Description
18
18
  * ------|------------
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import r from"../SimpleFillSymbol.js";import o from"../SimpleLineSymbol.js";import m from"../SimpleMarkerSymbol.js";import e from"../TextSymbol.js";import{defaultPointSymbolJSON as t,defaultPolylineSymbolJSON as l,defaultPolygonSymbolJSON as n,defaultTextSymbolJSON as i,errorPointSymbolJSON as s,errorPolylineSymbolJSON as f,errorPolygonSymbolJSON as p}from"./defaultsJSON.js";const S=m.fromJSON(t),u=o.fromJSON(l),c=r.fromJSON(n),a=e.fromJSON(i);function J(r){if(null==r)return null;switch(r.type){case"mesh":return null;case"point":case"multipoint":return S;case"polyline":return u;case"polygon":case"extent":return c}return null}const N=m.fromJSON(s),O=o.fromJSON(f),y=r.fromJSON(p);export{S as defaultPointSymbol2D,c as defaultPolygonSymbol2D,u as defaultPolylineSymbol2D,a as defaultTextSymbol2D,N as errorPointSymbol2D,y as errorPolygonSymbol2D,O as errorPolylineSymbol2D,J as getDefaultSymbol2D};
5
+ import r from"../SimpleFillSymbol.js";import o from"../SimpleLineSymbol.js";import m from"../SimpleMarkerSymbol.js";import e from"../TextSymbol.js";import{defaultPointSymbolJSON as t,defaultPolylineSymbolJSON as l,defaultPolygonSymbolJSON as n,defaultTextSymbolJSON as i,errorPointSymbolJSON as s,errorPolylineSymbolJSON as f,errorPolygonSymbolJSON as S}from"./defaultsJSON.js";const p=m.fromJSON(t),u=o.fromJSON(l),c=r.fromJSON(n),a=e.fromJSON(i);function J(r){if(null==r)return null;switch(r.type){case"mesh":return null;case"point":case"multipoint":return p;case"polyline":return u;case"polygon":case"extent":return c}return null}const N=m.fromJSON(s),O=o.fromJSON(f),y=r.fromJSON(S);export{p as defaultPointSymbol2D,c as defaultPolygonSymbol2D,u as defaultPolylineSymbol2D,a as defaultTextSymbol2D,N as errorPointSymbol2D,y as errorPolygonSymbol2D,O as errorPolylineSymbol2D,J as getDefaultSymbol2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import o from"../../Color.js";import e from"../../core/Collection.js";import"../../core/has.js";import{px2pt as r}from"../../core/screenUtils.js";import m from"../FillSymbol3DLayer.js";import l from"../LineSymbol3D.js";import s from"../LineSymbol3DLayer.js";import i from"../MeshSymbol3D.js";import n from"../PointSymbol3D.js";import t from"../PolygonSymbol3D.js";import p from"../edges/SolidEdges3D.js";import{defaultPointSymbol2D as y,defaultPolylineSymbol2D as a,defaultPolygonSymbol2D as f}from"./defaults.js";import{defaultColor as c,defaultOutlineColor as u}from"./defaultsJSON.js";const w=n.fromSimpleMarkerSymbol(y),S=l.fromSimpleLineSymbol(a),j=t.fromSimpleFillSymbol(f),b=new i({symbolLayers:new e([new m({material:{color:c},edges:new p({size:r(1),color:new o(u)})})])}),L=new l({symbolLayers:new e([new s({material:{color:new o([0,0,0])},size:r(1)})])}),D=new t({symbolLayers:new e([new m({outline:{color:new o([0,0,0]),size:r(1)}})])});function d(o){if(null==o)return null;switch(o.type){case"mesh":return b;case"point":case"multipoint":return w;case"polyline":return S;case"polygon":case"extent":return j}return null}export{D as defaultRendererPolygonSymbol3D,L as defaultRendererPolylineSymbol3D,d as getDefaultSymbol3D};
5
+ import o from"../../Color.js";import e from"../../core/Collection.js";import{px2pt as r}from"../../core/screenUtils.js";import m from"../FillSymbol3DLayer.js";import l from"../LineSymbol3D.js";import n from"../LineSymbol3DLayer.js";import s from"../MeshSymbol3D.js";import i from"../PointSymbol3D.js";import t from"../PolygonSymbol3D.js";import p from"../edges/SolidEdges3D.js";import{defaultPointSymbol2D as y,defaultPolylineSymbol2D as f,defaultPolygonSymbol2D as a}from"./defaults.js";import{defaultColor as c,defaultOutlineColor as u}from"./defaultsJSON.js";const w=i.fromSimpleMarkerSymbol(y),S=l.fromSimpleLineSymbol(f),b=t.fromSimpleFillSymbol(a),j=new s({symbolLayers:new e([new m({material:{color:c},edges:new p({size:r(1),color:new o(u)})})])}),L=new l({symbolLayers:new e([new n({material:{color:new o([0,0,0])},size:r(1)})])}),D=new t({symbolLayers:new e([new m({outline:{color:new o([0,0,0]),size:r(1)}})])});function d(o){if(null==o)return null;switch(o.type){case"mesh":return j;case"point":case"multipoint":return w;case"polyline":return S;case"polygon":case"extent":return b}return null}export{D as defaultRendererPolygonSymbol3D,L as defaultRendererPolylineSymbol3D,d as getDefaultSymbol3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as e}from"../../assets.js";import{toHSV as t,toRGB as l}from"../../core/colorUtils.js";import"../../core/has.js";import a from"../../core/Error.js";import s from"../../core/Logger.js";import{pt2px as n}from"../../core/screenUtils.js";import{defaultThematicColor as r,dekebabifyLineStyle as o,getPatternUrlWithColor as i}from"./gfxUtils.js";import{adjustColorComponentBrightness as c,shapes as p,getTetrahedronShapes as u,getDiamondShapes as h,getCylinderShapes as m,getCubeShapes as f,getInvertedConeShapes as y,getConeShapes as d,getPathSymbolShapes as b,getWaterSymbolShapes as k,getExtrudeSymbolShapes as v}from"./previewUtils.js";import{defaultObjectPrimitive as g,defaultIconPrimitive as w}from"./primitives.js";import{renderSymbol as x,tintImageWithColor as M}from"./renderUtils.js";import{isVolumetricSymbol as L,getIconHref as j}from"./utils.js";import{resolveWebStyleSymbol as z}from"./webStyleSymbolUtils.js";const S=22,P=120,U=80,C=50,D=20;function O(e){const t=e.outline,l=null!=e.material?e.material.color:null,a=null!=l?l.toHex():null;if(null==t||"pattern"in t&&null!=t.pattern&&"style"===t.pattern.type&&"none"===t.pattern.style)return"fill"===e.type&&"#ffffff"===a?{color:"#bdc3c7",width:.75}:null;const s=n(t.size)||0;return{color:"rgba("+(null!=t.color?t.color.toRgba():"255,255,255,1")+")",width:Math.min(s,U),style:"pattern"in t&&null!=t.pattern&&"style"===t.pattern.type?o(t.pattern.style):null,join:"butt",cap:"patternCap"in t?t.patternCap:"butt"}}async function E(t,l){if(t.thumbnail?.url)return t.thumbnail.url;if("icon"===l.type){const e=l?.resource?.href;if(e)return j(l)}const a=e("esri/images/Legend/legend3dsymboldefault.png");if(t.styleOrigin&&(t.styleOrigin.styleName||t.styleOrigin.styleUrl)){const e=await z(t.styleOrigin,{portal:t.styleOrigin.portal}).catch(()=>null);if(e&&"thumbnail"in e&&e.thumbnail?.url)return e.thumbnail.url}return a}function q(e,a=1){const s=e.a,n=t(e),r=n.h,o=n.s/a,i=100-(100-n.v)/a,{r:c,g:p,b:u}=l({h:r,s:o,v:i});return[c,p,u,s]}function R(e){return"water"===e.type?null==e.color?null:e.color:null==e.material?.color?null:e.material.color}function Z(e,t=0){const l=R(e);if(!l){if("fill"===e.type)return null;const l=r.r,a=c(l,t);return[a,a,a,100]}const a=l.toRgba();for(let s=0;s<3;s++)a[s]=c(a[s],t);return a}async function H(t,l){const a=t.style;if("none"===a)return null;return{type:"pattern",x:0,y:0,src:await i(e(`esri/symbols/patterns/${a}.png`),l.toCss(!0)),width:5,height:5}}function I(e){return e.outline?O(e):{color:"rgba(0, 0, 0, 1)",width:1.5}}function N(e,t){const l=R(e);if(!l)return null;let a="rgba(";return a+=c(l.r,t)+",",a+=c(l.g,t)+",",a+=c(l.b,t)+",",a+l.a+");"}function T(e,t){const l=e.edges;if(!l||!l.color||!l.size)return null;return{color:l.color.toCss(!0),width:Math.min(n(l.size),t,U),join:"round"}}function F(e,t){const l=N(e,t);if(!l)return null;if("pattern"in e&&null!=e.pattern&&"style"===e.pattern.type&&"none"===e.pattern.style)return null;const a={color:l,width:Math.min(e.size?n(e.size):.75,U)};return"pattern"in e&&"style"===e.pattern?.type&&(a.style=o(e.pattern.style)),"cap"in e&&e.cap&&(a.cap=e.cap),"join"in e&&e.join&&(a.join="miter"===e.join?n(2):e.join),a}function $(e,t,l){const a=null!=l?.75*l:0;return{type:"linear",x1:a?.25*a:0,y1:a?.5*a:0,x2:a||4,y2:a?.5*a:4,colors:[{color:e,offset:0},{color:t,offset:1}]}}function A(e){const t=e.depth,l=e.height,a=e.width;return 0!==a&&0!==t&&0!==l&&a===t&&null!=a&&null!=l&&a<l}function B(e,t,l){const a=[];if(!e)return a;switch(e.type){case"icon":{const l=0,s=0,n=t,r=t;switch(e.resource?.primitive??w){case"circle":a.push({shape:{type:"circle",cx:0,cy:0,r:.5*t},fill:Z(e,0),stroke:O(e)});break;case"square":a.push({shape:{type:"path",path:[{command:"M",values:[l,r]},{command:"L",values:[l,s]},{command:"L",values:[n,s]},{command:"L",values:[n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:O(e)});break;case"triangle":a.push({shape:{type:"path",path:[{command:"M",values:[l,r]},{command:"L",values:[.5*n,s]},{command:"L",values:[n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:O(e)});break;case"cross":a.push({shape:{type:"path",path:[{command:"M",values:[.5*n,s]},{command:"L",values:[.5*n,r]},{command:"M",values:[l,.5*r]},{command:"L",values:[n,.5*r]}]},stroke:I(e)});break;case"x":a.push({shape:{type:"path",path:[{command:"M",values:[l,s]},{command:"L",values:[n,r]},{command:"M",values:[n,s]},{command:"L",values:[l,r]}]},stroke:I(e)});break;case"kite":a.push({shape:{type:"path",path:[{command:"M",values:[l,.5*r]},{command:"L",values:[.5*n,s]},{command:"L",values:[n,.5*r]},{command:"L",values:[.5*n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:O(e)})}break}case"object":switch(e.resource?.primitive??g){case"cone":{const s=$(Z(e,0),Z(e,-.6),l?D:t),n=d(t,l);a.push({shape:n[0],fill:s},{shape:n[1],fill:s});break}case"inverted-cone":{const l=Z(e,0),s=$(l,Z(e,-.6),t),n=y(t);a.push({shape:n[0],fill:s},{shape:n[1],fill:l});break}case"cube":{const s=f(t,l);a.push({shape:s[0],fill:Z(e,0)},{shape:s[1],fill:Z(e,-.3)},{shape:s[2],fill:Z(e,-.5)});break}case"cylinder":{const s=$(Z(e,0),Z(e,-.6),l?D:t),n=m(t,l);a.push({shape:n[0],fill:s},{shape:n[1],fill:s},{shape:n[2],fill:Z(e,0)});break}case"diamond":{const l=h(t);a.push({shape:l[0],fill:Z(e,-.3)},{shape:l[1],fill:Z(e,0)},{shape:l[2],fill:Z(e,-.3)},{shape:l[3],fill:Z(e,-.7)});break}case"sphere":{const l=$(Z(e,0),Z(e,-.6));l.x1=0,l.y1=0,l.x2=.25*t,l.y2=.25*t,a.push({shape:{type:"circle",cx:0,cy:0,r:.5*t},fill:l});break}case"tetrahedron":{const l=u(t);a.push({shape:l[0],fill:Z(e,-.3)},{shape:l[1],fill:Z(e,0)},{shape:l[2],fill:Z(e,-.6)});break}}break}return a}function G(e){const t="number"==typeof e?.size?e?.size:null;return t?n(t):null}function J(e){return"icon"===e.type?"multiply":"tint"}async function K(e,t){const l=G(t),a=t?.maxSize?n(t.maxSize):null,r=t?.disableUpsampling??!1,o=e.symbolLayers,i=[],c=[];let p=!1,u=0,h=0,m=0;o.forEach(s=>{if("icon"!==s.type&&"object"!==s.type)return;s&&"icon"===s.type&&(m=Math.max(s.size&&n(s.size),m));const o="icon"===s.type?s.size&&n(s.size):0,f=l||o?Math.ceil(Math.min(l||o,a||P)):S;let y="icon"===s.type?s.angle:null;if(null!=t?.rotation&&(y=(y??0)+t.rotation),c.push(y),s?.resource?.href){const t=E(e,s).then(e=>{const t=s?.material?.color,l=J(s);return M(e,f,t,l,r)}).then(e=>{const t=e.width,l=e.height;return u=Math.max(u,t),h=Math.max(h,l),y&&(p=!0),[{shape:{type:"image",x:0,y:0,width:t,height:l,src:e.url},fill:null,stroke:null}]});i.push(t)}else{let e=f;"icon"===s.type&&l&&(e=f*(o/m));const a="tall"===t?.symbolConfig||t?.symbolConfig?.isTall||"object"===s.type&&A(s);u=Math.max(u,a?D:e),h=Math.max(h,e),y&&s.resource?.primitive&&["square","triangle","x"].includes(s.resource?.primitive)&&(p=!0),i.push(Promise.resolve(B(s,e,a)))}});const f=await Promise.allSettled(i),y=[];return f.forEach(e=>{"fulfilled"===e.status?y.push(e.value):e.reason&&s.getLogger("esri.symbols.support.previewSymbol3D").warn("error while building swatchInfo!",e.reason)}),x(y,[u,h],{node:t?.node,scale:!1,opacity:t?.opacity,ariaLabel:t?.ariaLabel,rotations:c,useRotationSize:p})}function Q(e,t){const l=e.symbolLayers,a=[],s=L(e),r=G(t),o=(t?.maxSize?n(t.maxSize):null)||U;let i,c=0,u=0;return l.forEach((e,t)=>{if(!e)return;if("line"!==e.type&&"path"!==e.type)return;const l=[];switch(e.type){case"line":{const a=F(e,0);if(null==a)break;const s=a?.width||0;0===t&&(i=s);const n=Math.min(r||s,o),p=0===t?n:r?n*(s/i):n,h=p>C/2?2*p:C;u=Math.max(u,p),c=Math.max(c,h),a.width=p,l.push({shape:{type:"path",path:[{command:"M",values:[0,.5*u]},{command:"L",values:[c,.5*u]}]},stroke:a});break}case"path":{const t=Math.min(r||S,o),a=Z(e,0),s=Z(e,-.2),n=N(e,-.4),i=n?{color:n,width:1}:{};if("quad"===e.profile){const t=e.width,n=e.height,r=b(t&&n?t/n:1,0===n,0===t),o={...i,join:"bevel"};l.push({shape:r[0],fill:s,stroke:o},{shape:r[1],fill:s,stroke:o},{shape:r[2],fill:a,stroke:o})}else l.push({shape:p.pathSymbol3DLayer[0],fill:s,stroke:i},{shape:p.pathSymbol3DLayer[1],fill:a,stroke:i});u=Math.max(u,t),c=u}}a.push(l)}),Promise.resolve(x(a,[c,u],{node:t?.node,scale:s,opacity:t?.opacity,ariaLabel:t?.ariaLabel}))}async function V(e,t){const l="mesh-3d"===e.type,a=e.symbolLayers,s=G(t),r=t?.maxSize?n(t.maxSize):null,o=s||S,i=[];let c=0,u=0,h=!1;for(let n=0;n<a.length;n++){const e=a.at(n),t=[];if(!l||"fill"===e.type){switch(e.type){case"fill":{const a=Math.min(o,r||P);if(c=Math.max(c,a),u=Math.max(u,a),h=!0,l){const l=p.meshSymbol3DFill,s=N(e,-.4),n=T(e,.05*a)??(s?{join:"round",color:s,width:1}:null);t.push({shape:l[0],fill:Z(e,0),stroke:n},{shape:l[1],fill:Z(e,-.2),stroke:n},{shape:l[2],fill:Z(e,-.6),stroke:n})}else{let l=Z(e,0);const a="pattern"in e?e.pattern:null,s=O(e),n=R(e);null!=a&&"style"===a.type&&"solid"!==a.style&&n&&(l=await H(a,n)),t.push({shape:p.fill[0],fill:l,stroke:s})}break}case"line":{const l=F(e,0);if(null==l)break;const a={stroke:l,shape:p.fill[0]};c=Math.max(c,S),u=Math.max(u,S),t.push(a);break}case"extrude":{const l=Z(e,0),a=Z(e,-.2),s=Math.min(o,r||P),n=v(s),i=S,p=.7*S+.5*s,h=T(e,.1*Math.min(i,p))??{join:"round",...F(e,-.4),width:1};t.push({shape:n[0],fill:a,stroke:h},{shape:n[1],fill:a,stroke:h},{shape:n[2],fill:l,stroke:h}),c=Math.max(c,i),u=Math.max(u,p);break}case"water":{const l=R(e),a=q(l),s=q(l,2),n=q(l,3),i=k();h=!0,t.push({shape:i[0],fill:a},{shape:i[1],fill:s},{shape:i[2],fill:n});const p=Math.min(o,r||P);c=Math.max(c,p),u=Math.max(u,p);break}}i.push(t)}}return x(i,[c,u],{node:t?.node,scale:h,opacity:t?.opacity,ariaLabel:t?.ariaLabel})}function W(e,t){if(0===e.symbolLayers.length)return Promise.reject(new a("symbolPreview: renderPreviewHTML3D","No symbolLayers in the symbol."));switch(e.type){case"point-3d":return K(e,t);case"line-3d":return Q(e,t);case"polygon-3d":case"mesh-3d":return V(e,t)}return Promise.reject(new a("symbolPreview: swatchInfo3D","symbol not supported."))}export{H as getPatternDescriptor,G as getSizeFromOptions,Z as getSymbolLayerFill,W as previewSymbol3D};
5
+ import{getAssetUrl as e}from"../../assets.js";import{toHSV as t,toRGB as l}from"../../core/colorUtils.js";import a from"../../core/Error.js";import s from"../../core/Logger.js";import{pt2px as n}from"../../core/screenUtils.js";import{defaultThematicColor as r,dekebabifyLineStyle as o,getPatternUrlWithColor as i}from"./gfxUtils.js";import{adjustColorComponentBrightness as c,shapes as p,getTetrahedronShapes as u,getDiamondShapes as h,getCylinderShapes as m,getCubeShapes as f,getInvertedConeShapes as y,getConeShapes as d,getPathSymbolShapes as b,getWaterSymbolShapes as k,getExtrudeSymbolShapes as v}from"./previewUtils.js";import{defaultObjectPrimitive as g,defaultIconPrimitive as w}from"./primitives.js";import{renderSymbol as x,tintImageWithColor as M}from"./renderUtils.js";import{isVolumetricSymbol as L,getIconHref as j}from"./utils.js";import{resolveWebStyleSymbol as z}from"./webStyleSymbolUtils.js";const S=22,P=120,U=80,C=50,D=20;function O(e){const t=e.outline,l=null!=e.material?e.material.color:null,a=null!=l?l.toHex():null;if(null==t||"pattern"in t&&null!=t.pattern&&"style"===t.pattern.type&&"none"===t.pattern.style)return"fill"===e.type&&"#ffffff"===a?{color:"#bdc3c7",width:.75}:null;const s=n(t.size)||0;return{color:"rgba("+(null!=t.color?t.color.toRgba():"255,255,255,1")+")",width:Math.min(s,U),style:"pattern"in t&&null!=t.pattern&&"style"===t.pattern.type?o(t.pattern.style):null,join:"butt",cap:"patternCap"in t?t.patternCap:"butt"}}async function E(t,l){if(t.thumbnail?.url)return t.thumbnail.url;if("icon"===l.type){const e=l?.resource?.href;if(e)return j(l)}const a=e("esri/images/Legend/legend3dsymboldefault.png");if(t.styleOrigin&&(t.styleOrigin.styleName||t.styleOrigin.styleUrl)){const e=await z(t.styleOrigin,{portal:t.styleOrigin.portal}).catch(()=>null);if(e&&"thumbnail"in e&&e.thumbnail?.url)return e.thumbnail.url}return a}function q(e,a=1){const s=e.a,n=t(e),r=n.h,o=n.s/a,i=100-(100-n.v)/a,{r:c,g:p,b:u}=l({h:r,s:o,v:i});return[c,p,u,s]}function R(e){return"water"===e.type?null==e.color?null:e.color:null==e.material?.color?null:e.material.color}function Z(e,t=0){const l=R(e);if(!l){if("fill"===e.type)return null;const l=r.r,a=c(l,t);return[a,a,a,100]}const a=l.toRgba();for(let s=0;s<3;s++)a[s]=c(a[s],t);return a}async function H(t,l){const a=t.style;if("none"===a)return null;return{type:"pattern",x:0,y:0,src:await i(e(`esri/symbols/patterns/${a}.png`),l.toCss(!0)),width:5,height:5}}function I(e){return e.outline?O(e):{color:"rgba(0, 0, 0, 1)",width:1.5}}function N(e,t){const l=R(e);if(!l)return null;let a="rgba(";return a+=c(l.r,t)+",",a+=c(l.g,t)+",",a+=c(l.b,t)+",",a+l.a+");"}function T(e,t){const l=e.edges;if(!l||!l.color||!l.size)return null;return{color:l.color.toCss(!0),width:Math.min(n(l.size),t,U),join:"round"}}function F(e,t){const l=N(e,t);if(!l)return null;if("pattern"in e&&null!=e.pattern&&"style"===e.pattern.type&&"none"===e.pattern.style)return null;const a={color:l,width:Math.min(e.size?n(e.size):.75,U)};return"pattern"in e&&"style"===e.pattern?.type&&(a.style=o(e.pattern.style)),"cap"in e&&e.cap&&(a.cap=e.cap),"join"in e&&e.join&&(a.join="miter"===e.join?n(2):e.join),a}function $(e,t,l){const a=null!=l?.75*l:0;return{type:"linear",x1:a?.25*a:0,y1:a?.5*a:0,x2:a||4,y2:a?.5*a:4,colors:[{color:e,offset:0},{color:t,offset:1}]}}function A(e){const t=e.depth,l=e.height,a=e.width;return 0!==a&&0!==t&&0!==l&&a===t&&null!=a&&null!=l&&a<l}function B(e,t,l){const a=[];if(!e)return a;switch(e.type){case"icon":{const l=0,s=0,n=t,r=t;switch(e.resource?.primitive??w){case"circle":a.push({shape:{type:"circle",cx:0,cy:0,r:.5*t},fill:Z(e,0),stroke:O(e)});break;case"square":a.push({shape:{type:"path",path:[{command:"M",values:[l,r]},{command:"L",values:[l,s]},{command:"L",values:[n,s]},{command:"L",values:[n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:O(e)});break;case"triangle":a.push({shape:{type:"path",path:[{command:"M",values:[l,r]},{command:"L",values:[.5*n,s]},{command:"L",values:[n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:O(e)});break;case"cross":a.push({shape:{type:"path",path:[{command:"M",values:[.5*n,s]},{command:"L",values:[.5*n,r]},{command:"M",values:[l,.5*r]},{command:"L",values:[n,.5*r]}]},stroke:I(e)});break;case"x":a.push({shape:{type:"path",path:[{command:"M",values:[l,s]},{command:"L",values:[n,r]},{command:"M",values:[n,s]},{command:"L",values:[l,r]}]},stroke:I(e)});break;case"kite":a.push({shape:{type:"path",path:[{command:"M",values:[l,.5*r]},{command:"L",values:[.5*n,s]},{command:"L",values:[n,.5*r]},{command:"L",values:[.5*n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:O(e)})}break}case"object":switch(e.resource?.primitive??g){case"cone":{const s=$(Z(e,0),Z(e,-.6),l?D:t),n=d(t,l);a.push({shape:n[0],fill:s},{shape:n[1],fill:s});break}case"inverted-cone":{const l=Z(e,0),s=$(l,Z(e,-.6),t),n=y(t);a.push({shape:n[0],fill:s},{shape:n[1],fill:l});break}case"cube":{const s=f(t,l);a.push({shape:s[0],fill:Z(e,0)},{shape:s[1],fill:Z(e,-.3)},{shape:s[2],fill:Z(e,-.5)});break}case"cylinder":{const s=$(Z(e,0),Z(e,-.6),l?D:t),n=m(t,l);a.push({shape:n[0],fill:s},{shape:n[1],fill:s},{shape:n[2],fill:Z(e,0)});break}case"diamond":{const l=h(t);a.push({shape:l[0],fill:Z(e,-.3)},{shape:l[1],fill:Z(e,0)},{shape:l[2],fill:Z(e,-.3)},{shape:l[3],fill:Z(e,-.7)});break}case"sphere":{const l=$(Z(e,0),Z(e,-.6));l.x1=0,l.y1=0,l.x2=.25*t,l.y2=.25*t,a.push({shape:{type:"circle",cx:0,cy:0,r:.5*t},fill:l});break}case"tetrahedron":{const l=u(t);a.push({shape:l[0],fill:Z(e,-.3)},{shape:l[1],fill:Z(e,0)},{shape:l[2],fill:Z(e,-.6)});break}}break}return a}function G(e){const t="number"==typeof e?.size?e?.size:null;return t?n(t):null}function J(e){return"icon"===e.type?"multiply":"tint"}async function K(e,t){const l=G(t),a=t?.maxSize?n(t.maxSize):null,r=t?.disableUpsampling??!1,o=e.symbolLayers,i=[],c=[];let p=!1,u=0,h=0,m=0;o.forEach(s=>{if("icon"!==s.type&&"object"!==s.type)return;s&&"icon"===s.type&&(m=Math.max(s.size&&n(s.size),m));const o="icon"===s.type?s.size&&n(s.size):0,f=l||o?Math.ceil(Math.min(l||o,a||P)):S;let y="icon"===s.type?s.angle:null;if(null!=t?.rotation&&(y=(y??0)+t.rotation),c.push(y),s?.resource?.href){const t=E(e,s).then(e=>{const t=s?.material?.color,l=J(s);return M(e,f,t,l,r)}).then(e=>{const t=e.width,l=e.height;return u=Math.max(u,t),h=Math.max(h,l),y&&(p=!0),[{shape:{type:"image",x:0,y:0,width:t,height:l,src:e.url},fill:null,stroke:null}]});i.push(t)}else{let e=f;"icon"===s.type&&l&&(e=f*(o/m));const a="tall"===t?.symbolConfig||t?.symbolConfig?.isTall||"object"===s.type&&A(s);u=Math.max(u,a?D:e),h=Math.max(h,e),y&&s.resource?.primitive&&["square","triangle","x"].includes(s.resource?.primitive)&&(p=!0),i.push(Promise.resolve(B(s,e,a)))}});const f=await Promise.allSettled(i),y=[];return f.forEach(e=>{"fulfilled"===e.status?y.push(e.value):e.reason&&s.getLogger("esri.symbols.support.previewSymbol3D").warn("error while building swatchInfo!",e.reason)}),x(y,[u,h],{node:t?.node,scale:!1,opacity:t?.opacity,ariaLabel:t?.ariaLabel,rotations:c,useRotationSize:p})}function Q(e,t){const l=e.symbolLayers,a=[],s=L(e),r=G(t),o=(t?.maxSize?n(t.maxSize):null)||U;let i,c=0,u=0;return l.forEach((e,t)=>{if(!e)return;if("line"!==e.type&&"path"!==e.type)return;const l=[];switch(e.type){case"line":{const a=F(e,0);if(null==a)break;const s=a?.width||0;0===t&&(i=s);const n=Math.min(r||s,o),p=0===t?n:r?n*(s/i):n,h=p>C/2?2*p:C;u=Math.max(u,p),c=Math.max(c,h),a.width=p,l.push({shape:{type:"path",path:[{command:"M",values:[0,.5*u]},{command:"L",values:[c,.5*u]}]},stroke:a});break}case"path":{const t=Math.min(r||S,o),a=Z(e,0),s=Z(e,-.2),n=N(e,-.4),i=n?{color:n,width:1}:{};if("quad"===e.profile){const t=e.width,n=e.height,r=b(t&&n?t/n:1,0===n,0===t),o={...i,join:"bevel"};l.push({shape:r[0],fill:s,stroke:o},{shape:r[1],fill:s,stroke:o},{shape:r[2],fill:a,stroke:o})}else l.push({shape:p.pathSymbol3DLayer[0],fill:s,stroke:i},{shape:p.pathSymbol3DLayer[1],fill:a,stroke:i});u=Math.max(u,t),c=u}}a.push(l)}),Promise.resolve(x(a,[c,u],{node:t?.node,scale:s,opacity:t?.opacity,ariaLabel:t?.ariaLabel}))}async function V(e,t){const l="mesh-3d"===e.type,a=e.symbolLayers,s=G(t),r=t?.maxSize?n(t.maxSize):null,o=s||S,i=[];let c=0,u=0,h=!1;for(let n=0;n<a.length;n++){const e=a.at(n),t=[];if(!l||"fill"===e.type){switch(e.type){case"fill":{const a=Math.min(o,r||P);if(c=Math.max(c,a),u=Math.max(u,a),h=!0,l){const l=p.meshSymbol3DFill,s=N(e,-.4),n=T(e,.05*a)??(s?{join:"round",color:s,width:1}:null);t.push({shape:l[0],fill:Z(e,0),stroke:n},{shape:l[1],fill:Z(e,-.2),stroke:n},{shape:l[2],fill:Z(e,-.6),stroke:n})}else{let l=Z(e,0);const a="pattern"in e?e.pattern:null,s=O(e),n=R(e);null!=a&&"style"===a.type&&"solid"!==a.style&&n&&(l=await H(a,n)),t.push({shape:p.fill[0],fill:l,stroke:s})}break}case"line":{const l=F(e,0);if(null==l)break;const a={stroke:l,shape:p.fill[0]};c=Math.max(c,S),u=Math.max(u,S),t.push(a);break}case"extrude":{const l=Z(e,0),a=Z(e,-.2),s=Math.min(o,r||P),n=v(s),i=S,p=.7*S+.5*s,h=T(e,.1*Math.min(i,p))??{join:"round",...F(e,-.4),width:1};t.push({shape:n[0],fill:a,stroke:h},{shape:n[1],fill:a,stroke:h},{shape:n[2],fill:l,stroke:h}),c=Math.max(c,i),u=Math.max(u,p);break}case"water":{const l=R(e),a=q(l),s=q(l,2),n=q(l,3),i=k();h=!0,t.push({shape:i[0],fill:a},{shape:i[1],fill:s},{shape:i[2],fill:n});const p=Math.min(o,r||P);c=Math.max(c,p),u=Math.max(u,p);break}}i.push(t)}}return x(i,[c,u],{node:t?.node,scale:h,opacity:t?.opacity,ariaLabel:t?.ariaLabel})}function W(e,t){if(0===e.symbolLayers.length)return Promise.reject(new a("symbolPreview: renderPreviewHTML3D","No symbolLayers in the symbol."));switch(e.type){case"point-3d":return K(e,t);case"line-3d":return Q(e,t);case"polygon-3d":case"mesh-3d":return V(e,t)}return Promise.reject(new a("symbolPreview: swatchInfo3D","symbol not supported."))}export{H as getPatternDescriptor,G as getSizeFromOptions,Z as getSymbolLayerFill,W as previewSymbol3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{fromValues as e}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../geometry/support/aaBoundingBox.js";function t(r,{isPrimitive:t,width:n,depth:o,height:s}){const c=t?10:1;if(null==n&&null==s&&null==o)return[c*r[0],c*r[1],c*r[2]];const i=e(n,o,s);let u;for(let e=0;e<3;e++){const t=i[e];if(null!=t){u=t/r[e];break}}for(let e=0;e<3;e++)null==i[e]&&(i[e]=r[e]*u);return i}const n=r(-.5,-.5,-.5,.5,.5,.5),o=r(-.5,-.5,0,.5,.5,1),s=r(-.5,-.5,0,.5,.5,.5);function c(e){switch(e){case"sphere":case"cube":case"diamond":return n;case"cylinder":case"cone":case"inverted-cone":return o;case"tetrahedron":return s;default:return}}const i=["butt","square","round"],u=[...i,"none"],a=["miter","bevel","round"];export{i as lineCaps,a as lineJoins,s as objectSymbolLayerBoundingBoxTetrahedron,n as objectSymbolLayerBoundingBoxUnitCube,o as objectSymbolLayerBoundingBoxUnitCylinder,c as objectSymbolLayerPrimitiveBoundingBox,t as objectSymbolLayerSizeWithResourceSize,u as pathCaps};
5
+ import{fromValues as e}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../geometry/support/aaBoundingBox.js";function t(r,{isPrimitive:t,width:n,depth:o,height:s}){const c=t?10:1;if(null==n&&null==s&&null==o)return[c*r[0],c*r[1],c*r[2]];const u=e(n,o,s);let i;for(let e=0;e<3;e++){const t=u[e];if(null!=t){i=t/r[e];break}}for(let e=0;e<3;e++)null==u[e]&&(u[e]=r[e]*i);return u}const n=r(-.5,-.5,-.5,.5,.5,.5),o=r(-.5,-.5,0,.5,.5,1),s=r(-.5,-.5,0,.5,.5,.5);function c(e){switch(e){case"sphere":case"cube":case"diamond":return n;case"cylinder":case"cone":case"inverted-cone":return o;case"tetrahedron":return s;default:return}}const u=["butt","square","round"],i=[...u,"none"],l=["miter","bevel","round"];export{u as lineCaps,l as lineJoins,s as objectSymbolLayerBoundingBoxTetrahedron,n as objectSymbolLayerBoundingBoxUnitCube,o as objectSymbolLayerBoundingBoxUnitCylinder,c as objectSymbolLayerPrimitiveBoundingBox,t as objectSymbolLayerSizeWithResourceSize,i as pathCaps};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{pt2px as e,toPt as t,px2pt as l}from"../../core/screenUtils.js";import{isSubtypeGroupLayer as a}from"../../layers/support/layerUtils.js";import{loadArcade as i}from"../../support/loadArcade.js";import{getStroke as r}from"./gfxUtils.js";import{renderSymbol as s,renderOnce as o}from"./renderUtils.js";import{isSymbol3D as n}from"./typeUtils.js";import{applyColorToSymbol as c,applySizesToSymbol as u,applyRotationToSymbol as p,getColorFromSymbol as f,applyOpacityToColor as y}from"./utils.js";import{renderRelationshipRamp as h}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as d}from"../../widgets/Legend/support/relationshipRampUtils.js";let m=null;const b=[255,255,255];function g(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function w(e,t,l){const{backgroundColor:a,outline:i,dotSize:r}=e,s=l?.swatchSize||22,o=.8,n=Math.round(s*s/Math.max(r,.5)**2*o),c=window.devicePixelRatio,u=document.createElement("canvas"),p=s*c;u.width=p,u.height=p,u.style.width=u.width/c+"px",u.style.height=u.height/c+"px";const f=u.getContext("2d");if(a&&(f.fillStyle=a.toCss(!0),f.fillRect(0,0,p,p),f.fill()),f.fillStyle=t?.toCss(!0)??"",m&&m.length/2===n)for(let h=0;h<2*n;h+=2){const e=m[h],t=m[h+1];f.fillRect(e,t,r*c,r*c),f.fill()}else{m=[];for(let e=0;e<2*n;e+=2){const e=g(0,p),t=g(0,p);m.push(e,t),f.fillRect(e,t,r*c,r*c),f.fill()}}i&&(i.color&&(f.strokeStyle=i.color.toCss(!0)),f.lineWidth=i.width,f.strokeRect(0,0,p,p));const y=new Image(s,s);return y.src=u.toDataURL(),y.ariaLabel=l?.ariaLabel??null,y.alt=l?.ariaLabel??"",y}function S(e,t={}){const l=t.radius||40,a=2*Math.PI*l,i=e.length,o=a/i,n=[],c=r(t.outline);null!=c?.width&&(c.width*=2),(c||t.backgroundColor)&&n.push({shape:{type:"circle",cx:l,cy:l,r:l},fill:t.backgroundColor,stroke:c,offset:[0,0]});const u=t.values,p=u?.length===i&&100===u.reduce((e,t)=>e+t,0),f=[0];for(let r=0;r<i;r++){let t=null;p&&(t=u[r]*a/100,f.push(t+f[r])),n.push({shape:{type:"circle",cx:l,cy:l,r:l/2},fill:[0,0,0,0],stroke:{width:l,dashArray:`${(t??o)/2} ${a}`,dashoffset:"-"+(p?f[r]/2:r*(o/2)),color:e[r]},offset:[0,0]})}let y=null;const h=2*l+(c?.width||0),d=t.holePercentage;if(d){c&&n.push({shape:{type:"circle",cx:l,cy:l,r:l*d},fill:null,stroke:c,offset:[0,0]});const e=h/2;y=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:b,stroke:c?{...c,color:b}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:l*d},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return s([n],[h,h],{cssEffectFilter:t.cssEffectFilter,ignoreStrokeWidth:!0,masking:y,rotations:[-90],ariaLabel:t.ariaLabel})}function v(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:i}=l,r=d({focus:a,numClasses:i,infos:e.uniqueValueInfos}),s=t?.node||document.createElement("div");return o(s,()=>h(r,t.id||"relationship",{opacity:t.opacity||1,cssEffectFilter:t.cssEffectFilter,ariaLabel:t.ariaLabel})),s}function V(e,t={}){const l=24,a=75,i="horizontal"===t.align,r=i?a:l,s=i?l:a,o=t.width??r,n=t.height??s,c=t.gradient??!0,u=window.devicePixelRatio,p=o*u,f=n*u,y=document.createElement("canvas");y.width=p,y.height=f,y.ariaLabel=t.ariaLabel??null,y.style.width=`${o}px`,y.style.height=`${n}px`;const h=y.getContext("2d"),d=i?p:0,m=i?0:f;if(c){const t=h.createLinearGradient(0,0,d,m),l=e.length,a=1===l?0:1/(l-1);e.forEach((e,l)=>t.addColorStop(l*a,e.toString())),h.fillStyle=t,h.fillRect(0,0,p,f)}else{const t=i?p/e.length:p,l=i?f:f/e.length;let a=0,r=0;for(const s of e)h.fillStyle=s.toString(),h.fillRect(a,r,t,l),a=i?a+t:0,r=i?0:r+l}const b=document.createElement("div");return b.style.width=`${o}px`,b.style.height=`${n}px`,x(b,t?.cssEffectFilter),b.appendChild(y),b}function k(e){const t=e.match(/drop-shadow\(\s*([^\s]+)\s+[^\s]+\s+[^\s]+\s+.+?\)/);return t?t[1]:null}function x(l,a){if(!a)return;l.style.filter=a;const i=k(a);if(i){const a=e(t(i));a<0?l.style.marginLeft=`${Math.abs(a)}px`:l.style.marginRight=`${a}px`}}async function L(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,L,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function R(e){return e&&void 0!==e.opacity?e.opacity*("parent"in e?R(e.parent):1):1}async function F(e,t){if(!e)return;const l=e.sourceLayer,a=(null!=t&&t.useSourceLayer?l:e.layer)??l,r=t?.ignoreOpacity?1:R(a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):e.symbol.clone();return c(l,null,{add:r}),l}const s=t?.renderer??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!o)return;if(o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):o.clone(),!(s&&"visualVariables"in s&&s.visualVariables?.length&&j(o)))return c(o,null,{add:r}),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:n,getOpacity:f,getAllSizes:y,getRotationAngle:h}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),d=[],m=[],b=[],g=[];for(const i of s.visualVariables)switch(i.type){case"color":d.push(i);break;case"opacity":m.push(i);break;case"rotation":g.push(i);break;case"size":i.target||b.push(i)}const w=!!d.length&&d[d.length-1],S=w?n(w,e,t):null,v=!!t?.ignoreOpacity,V=!!m.length&&m[m.length-1],k=V?f(V,e,t):null;if(c(o,S,v?void 0:{override:k,add:r}),b.length&&!0!==t?.ignoreSizeVariables){const l=y(b,e,t);await u(o,l)}if(!0!==t?.ignoreRotationVariables)for(const i of g)p(o,h(i,e,t),i.axis);return o}async function C(e,t){if(!e)return;const{layer:l,sourceLayer:a}=e,r=R(l??a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):e.symbol.clone();return f(l,r)}const s=t?.renderer??I(l)??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):void 0;if(!o)return;o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):o.clone();const n=f(o,void 0);if(!s||!("visualVariables"in s)||"visualVariables"in s&&!s.visualVariables||"visualVariables"in s&&!s.visualVariables?.length||!j(o))return n?y(n,r):void 0;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:c,getOpacity:u}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),p=[],h=[];if(s.visualVariables)for(const i of s.visualVariables)switch(i.type){case"color":p.push(i);break;case"opacity":h.push(i)}const d=p.length>0?p[p.length-1]:null,m=(d?c(d,e,t):void 0)??n,b=h.length>0?h[h.length-1]:null,g=b?u(b,e,t):null;return null!=m&&null!=g&&(m.a=g),m?y(m,r):null}function j(e){return!n(e)||"water"!==e.symbolLayers.at(0)?.type}function I(e){if(e)return"renderer"in e?e.renderer:void 0}async function U(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,r=l?.renderer??I(a)??I(i);if(!r)return null;if("visualVariables"in r&&r.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:s}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getFormatOptionsForVisualVariable:o}=await import("../../widgets/Legend/support/utils.js");let n=null;for(const c of r.visualVariables){const u=t?o(a,c,t.timeZone):null;let p=null;switch(c.type){case"color":p=await i(c,null,u);break;case"opacity":p=await i(c);break;case"size":c.target||(p=await s(r,c,null,l?.scale||t?.scale,t,u))}if(p?.length){const t=p.find((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===p?.length-1?a<=t.value:t.value===a});if(t){n=t.label;break}}}if(n)return n}switch(r.type){case"class-breaks":{const t="getClassBreakInfo"in r?await r.getClassBreakInfo(e,l):null;return t?.label??(t&&r.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in r?await r.getUniqueValueInfo(e,l):null;return t?.label}}return null}async function z(e,t){e?.layer&&a(e.layer)&&((e=e.cloneShallow()).layer=e.layer.findSublayerForFeature(e)??null);const i=null===e?t?.fallbackSymbol??null:await F(e,{ignoreGraphicSymbol:!!e.layer,ignoreOpacity:t?.ignoreOpacity??!0,ignoreRotationVariables:t?.ignoreRotationVariables??!0,ignoreSizeVariables:t?.ignoreSizeVariables??!0})??t?.fallbackSymbol??null;if(!i)return null;const r=await L(i,{geometry:t.useGeometryForShape?e?.geometry??null:null,useMarkerSymbolSize:!1!==t.useMarkerSymbolSize,size:{width:l(t.widthInPixels??16),height:l(t.heightInPixels??16)},..."cim"===i?.type?{cimOptions:{feature:{attributes:e?.attributes??{}}}}:{}});if(!r)return null;return"element"===(t?.format??"element")?r:r.outerHTML}export{C as getDisplayedColor,F as getDisplayedSymbol,U as getLegendLabel,z as previewGraphic,V as renderColorRampPreviewHTML,w as renderDotDensityPreviewHTML,S as renderPieChartPreviewHTML,L as renderPreviewHTML,v as renderRelationshipRampPreviewHTML};
5
+ import{pt2px as e,toPt as t,px2pt as l}from"../../core/screenUtils.js";import{isSubtypeGroupLayer as a}from"../../layers/support/layerUtils.js";import{loadArcade as i}from"../../support/loadArcade.js";import{getStroke as r}from"./gfxUtils.js";import{renderSymbol as s,renderOnce as o}from"./renderUtils.js";import{isSymbol3D as n}from"./typeUtils.js";import{applyColorToSymbol as c,applySizesToSymbol as u,applyRotationToSymbol as p,getColorFromSymbol as f,applyOpacityToColor as y}from"./utils.js";import{renderRelationshipRamp as d}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as h}from"../../widgets/Legend/support/relationshipRampUtils.js";let m=null;const b=[255,255,255];function g(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function w(e,t,l){const{backgroundColor:a,outline:i,dotSize:r}=e,s=l?.swatchSize||22,o=.8,n=Math.round(s*s/Math.max(r,.5)**2*o),c=window.devicePixelRatio,u=document.createElement("canvas"),p=s*c;u.width=p,u.height=p,u.style.width=u.width/c+"px",u.style.height=u.height/c+"px";const f=u.getContext("2d");if(a&&(f.fillStyle=a.toCss(!0),f.fillRect(0,0,p,p),f.fill()),f.fillStyle=t?.toCss(!0)??"",m&&m.length/2===n)for(let d=0;d<2*n;d+=2){const e=m[d],t=m[d+1];f.fillRect(e,t,r*c,r*c),f.fill()}else{m=[];for(let e=0;e<2*n;e+=2){const e=g(0,p),t=g(0,p);m.push(e,t),f.fillRect(e,t,r*c,r*c),f.fill()}}i&&(i.color&&(f.strokeStyle=i.color.toCss(!0)),f.lineWidth=i.width,f.strokeRect(0,0,p,p));const y=new Image(s,s);return y.src=u.toDataURL(),y.ariaLabel=l?.ariaLabel??null,y.alt=l?.ariaLabel??"",y}function S(e,t={}){const l=t.radius||40,a=2*Math.PI*l,i=e.length,o=a/i,n=[],c=r(t.outline);null!=c?.width&&(c.width*=2),(c||t.backgroundColor)&&n.push({shape:{type:"circle",cx:l,cy:l,r:l},fill:t.backgroundColor,stroke:c,offset:[0,0]});const u=t.values,p=u?.length===i&&100===u.reduce((e,t)=>e+t,0),f=[0];for(let r=0;r<i;r++){let t=null;p&&(t=u[r]*a/100,f.push(t+f[r])),n.push({shape:{type:"circle",cx:l,cy:l,r:l/2},fill:[0,0,0,0],stroke:{width:l,dashArray:`${(t??o)/2} ${a}`,dashoffset:"-"+(p?f[r]/2:r*(o/2)),color:e[r]},offset:[0,0]})}let y=null;const d=2*l+(c?.width||0),h=t.holePercentage;if(h){c&&n.push({shape:{type:"circle",cx:l,cy:l,r:l*h},fill:null,stroke:c,offset:[0,0]});const e=d/2;y=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:b,stroke:c?{...c,color:b}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:l*h},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return s([n],[d,d],{cssEffectFilter:t.cssEffectFilter,ignoreStrokeWidth:!0,masking:y,rotations:[-90],ariaLabel:t.ariaLabel})}function v(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:i}=l,r=h({focus:a,numClasses:i,infos:e.uniqueValueInfos}),s=t?.node||document.createElement("div");return o(s,()=>d(r,t.id||"relationship",{opacity:t.opacity||1,cssEffectFilter:t.cssEffectFilter,ariaLabel:t.ariaLabel})),s}function V(e,t={}){const l=24,a=75,i="horizontal"===t.align,r=i?a:l,s=i?l:a,o=t.width??r,n=t.height??s,c=t.gradient??!0,u=window.devicePixelRatio,p=o*u,f=n*u,y=document.createElement("canvas");y.width=p,y.height=f,y.ariaLabel=t.ariaLabel??null,y.style.width=`${o}px`,y.style.height=`${n}px`;const d=y.getContext("2d"),h=i?p:0,m=i?0:f;if(c){const t=d.createLinearGradient(0,0,h,m),l=e.length,a=1===l?0:1/(l-1);e.forEach((e,l)=>t.addColorStop(l*a,e.toString())),d.fillStyle=t,d.fillRect(0,0,p,f)}else{const t=i?p/e.length:p,l=i?f:f/e.length;let a=0,r=0;for(const s of e)d.fillStyle=s.toString(),d.fillRect(a,r,t,l),a=i?a+t:0,r=i?0:r+l}const b=document.createElement("div");return b.style.width=`${o}px`,b.style.height=`${n}px`,x(b,t?.cssEffectFilter),b.appendChild(y),b}function k(e){const t=e.match(/drop-shadow\(\s*([^\s]+)\s+[^\s]+\s+[^\s]+\s+.+?\)/);return t?t[1]:null}function x(l,a){if(!a)return;l.style.filter=a;const i=k(a);if(i){const a=e(t(i));a<0?l.style.marginLeft=`${Math.abs(a)}px`:l.style.marginRight=`${a}px`}}async function L(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,L,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function R(e){return e&&void 0!==e.opacity?e.opacity*("parent"in e?R(e.parent):1):1}async function F(e,t){if(!e)return;const l=e.sourceLayer,a=(null!=t&&t.useSourceLayer?l:e.layer)??l,r=t?.ignoreOpacity?1:R(a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):e.symbol.clone();return c(l,null,{add:r}),l}const s=t?.renderer??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!o)return;if(o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):o.clone(),!(s&&"visualVariables"in s&&s.visualVariables?.length&&j(o)))return c(o,null,{add:r}),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:n,getOpacity:f,getAllSizes:y,getRotationAngle:d}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),h=[],m=[],b=[],g=[];for(const i of s.visualVariables)switch(i.type){case"color":h.push(i);break;case"opacity":m.push(i);break;case"rotation":g.push(i);break;case"size":i.target||b.push(i)}const w=!!h.length&&h[h.length-1],S=w?n(w,e,t):null,v=!!t?.ignoreOpacity,V=!!m.length&&m[m.length-1],k=V?f(V,e,t):null;if(c(o,S,v?void 0:{override:k,add:r}),b.length&&!0!==t?.ignoreSizeVariables){const l=y(b,e,t);await u(o,l)}if(!0!==t?.ignoreRotationVariables)for(const i of g)p(o,d(i,e,t),i.axis);return o}async function C(e,t){if(!e)return;const{layer:l,sourceLayer:a}=e,r=R(l??a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):e.symbol.clone();return f(l,r)}const s=t?.renderer??I(l)??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):void 0;if(!o)return;o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):o.clone();const n=f(o,void 0);if(!s||!("visualVariables"in s)||"visualVariables"in s&&!s.visualVariables||"visualVariables"in s&&!s.visualVariables?.length||!j(o))return n?y(n,r):void 0;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:c,getOpacity:u}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),p=[],d=[];if(s.visualVariables)for(const i of s.visualVariables)switch(i.type){case"color":p.push(i);break;case"opacity":d.push(i)}const h=p.length>0?p[p.length-1]:null,m=(h?c(h,e,t):void 0)??n,b=d.length>0?d[d.length-1]:null,g=b?u(b,e,t):null;return null!=m&&null!=g&&(m.a=g),m?y(m,r):null}function j(e){return!n(e)||"water"!==e.symbolLayers.at(0)?.type}function I(e){if(e)return"renderer"in e?e.renderer:void 0}async function U(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,r=l?.renderer??I(a)??I(i);if(!r)return null;if("visualVariables"in r&&r.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:s}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getFormatOptionsForVisualVariable:o}=await import("../../widgets/Legend/support/utils.js");let n=null;for(const c of r.visualVariables){const u=t?o(a,c,t.timeZone):null;let p=null;switch(c.type){case"color":p=await i(c,null,u);break;case"opacity":p=await i(c);break;case"size":c.target||(p=await s(r,c,null,l?.scale||t?.scale,t,u))}if(p?.length){const t=p.find((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===p?.length-1?a<=t.value:t.value===a});if(t){n=t.label;break}}}if(n)return n}switch(r.type){case"class-breaks":{const t="getClassBreakInfo"in r?await r.getClassBreakInfo(e,l):null;return t?.label??(t&&r.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in r?await r.getUniqueValueInfo(e,l):null;return t?.label}}return null}async function z(e,t){e?.layer&&a(e.layer)&&((e=e.cloneShallow()).layer=e.layer.findSublayerForFeature(e)??null);const i=null===e?t?.fallbackSymbol??null:await F(e,{ignoreGraphicSymbol:!!e.layer,ignoreOpacity:t?.ignoreOpacity??!0,ignoreRotationVariables:t?.ignoreRotationVariables??!0,ignoreSizeVariables:t?.ignoreSizeVariables??!0})??t?.fallbackSymbol??null;if(!i)return null;const r=await L(i,{geometry:t.useGeometryForShape?e?.geometry??null:null,useMarkerSymbolSize:!1!==t.useMarkerSymbolSize,size:{width:l(t.widthInPixels??16),height:l(t.heightInPixels??16)},..."cim"===i?.type?{cimOptions:{feature:{attributes:e?.attributes??{}}}}:{}});if(!r)return null;return"element"===(t?.format??"element")?r:r.outerHTML}export{C as getDisplayedColor,F as getDisplayedSymbol,U as getLegendLabel,z as previewGraphic,V as renderColorRampPreviewHTML,w as renderDotDensityPreviewHTML,S as renderPieChartPreviewHTML,L as renderPreviewHTML,v as renderRelationshipRampPreviewHTML};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import{forEach as t}from"../../core/asyncUtils.js";import"../../core/has.js";import{px2pt as r}from"../../core/screenUtils.js";import{ONES as o}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{effectFunctionsFromJSON as n}from"../../layers/effects/jsonUtils.js";import{applyCIMSymbolRotation as l,getCIMSymbolColor as i}from"./cimSymbolUtils.js";import{getStroke as c}from"./gfxUtils.js";import s from"./Symbol3DMaterial.js";import{isSymbol3D as u,isSymbol2D as a}from"./typeUtils.js";function f(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.size}function m(e){if(!e)return 0;if(u(e)){const t=f(e);return null!=t?t:0}return r(c(e)?.width)}function y(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.color}function p(t){if(!t)return null;if(u(t))return y(t);const r=c(t)?.color;return r?new e(r):null}function h(e){if(null==e||!("symbolLayers"in e)||null==e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some(e=>"object"===e.type);case"line-3d":return e.symbolLayers.some(e=>"path"===e.type);case"polygon-3d":return e.symbolLayers.some(e=>"object"===e.type||"extrude"===e.type);default:return!1}}function d(e){return e.resource?.href??""}function b(t,r){if(!t)return null;let o=null;return u(t)?o=w(t):a(t)&&(o="cim"===t.type?i(t):t.color?new e(t.color):null),o?k(o,r):null}function w(t){const r=t.symbolLayers;if(!r)return null;let o=null;return r.forEach(e=>{"object"===e.type&&e.resource?.href||(o="water"===e.type?e.color:e.material?e.material.color:null)}),o?new e(o):null}function k(t,r){if(null==r||null==t)return t;const o=t.toRgba();return o[3]=o[3]*r,new e(o)}function j(t,r,o){const n=t.symbolLayers;if(!n)return;const l=(t,n=!1)=>{let l=r??t??null;return null!=o?.override&&(!l&&n&&(l=new e([255,255,255])),l&&(l.a=o.override)),k(l,o?.add)};n.forEach(e=>{if("water"===e.type)return void(e.color=k(e.color,o?.add));const t=null!=e.material?e.material.color:null,r=l(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new s({color:r}):e.material.color=r,"outline"in e&&e.outline?.color&&null!=o?.add&&(e.outline.color=k(e.outline.color,o.add)),"marker"in e&&null!=e.marker&&(e.marker.color=l(e.marker.color))})}function g(e,t,r){t=t??e.color,null!=r?.override&&t&&(t.a=r.override),t&&(e.color=k(t,r?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=k(e.outline.color,r?.add))}function L(t,r,o){t&&(r||null!=o)&&(r&&(r=new e(r)),u(t)?j(t,r,o):a(t)&&g(t,r,o))}async function v(e,r){const o=e.symbolLayers;o&&await t(o,async e=>z(e,r))}async function z(e,t){switch(e.type){case"extrude":U(e,t);break;case"icon":case"line":case"text":x(e,t);break;case"path":O(e,t);break;case"object":await E(e,t)}}function x(e,t){const r=S(t);null!=r&&(e.size=r)}function S(e){for(const t of e)if("number"==typeof t)return t;return null}function U(e,t){const r=t[2];"number"==typeof r&&(e.size=r)}async function E(e,t){const{resourceSize:r,symbolSize:o}=await C(e),n=R(t,r,o);null!=n&&(e.width=D(t[0],o[0],r[0],n),e.depth=D(t[1],o[1],r[1],n),e.height=D(t[2],o[2],r[2],n))}function O(e,t){const r=R(t,o,[e.width,void 0,e.height]);null!=r&&(e.width=D(t[0],e.width,1,r),e.height=D(t[2],e.height,1,r))}function R(e,t,r){for(let o=0;o<3;o++){const n=e[o];switch(n){case"symbol-value":{const e=r[o];return null!=e?e/t[o]:1}case"proportional":break;default:if(n&&t[o])return n/t[o]}}return null}async function C(e){const{computeObjectLayerResourceSize:t}=await import("./symbolLayerUtils.js"),r=await t(e,10),{width:o,height:n,depth:l}=e,i=[o,l,n];let c=1;for(let s=0;s<3;s++){const e=i[s];if(null!=e){c=e/r[s];break}}for(let s=0;s<3;s++)null==i[s]&&(i[s]=r[s]*c);return{resourceSize:r,symbolSize:i}}function D(e,t,r,o){switch(e){case"proportional":return r*o;case"symbol-value":return null!=t?t:r;default:return e}}function J(e,t){const r=S(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r}}async function M(e,t){if(e&&t)return u(e)?v(e,t):void(a(e)&&J(e,t))}function N(e,t,r){if(e&&null!=t)if(u(e)){const o=e.symbolLayers;o&&o.forEach(e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else if(a(e))switch(e.type){case"simple-marker":case"picture-marker":case"text":e.angle+=t;break;case"cim":l(e,t,!0)}}function q(e,t){if(!e)return null;const r=(t?e.effects:e.effects.filter(e=>"bloom"!==e.type)).map(e=>e.toJSON());return n(r)}function A(e){return null!=e&&"polygon-3d"===e.type&&e.symbolLayers.some(e=>"extrude"===e.type)}export{L as applyColorToSymbol,k as applyOpacityToColor,N as applyRotationToSymbol,M as applySizesToSymbol,q as getCSSFilterFromEffectList,b as getColorFromSymbol,d as getIconHref,p as getSymbolOutlineColor,m as getSymbolOutlineSize,h as isVolumetricSymbol,A as symbolHasExtrudeSymbolLayer};
5
+ import e from"../../Color.js";import{forEach as t}from"../../core/asyncUtils.js";import{px2pt as r}from"../../core/screenUtils.js";import{ONES as o}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{effectFunctionsFromJSON as n}from"../../layers/effects/jsonUtils.js";import{applyCIMSymbolRotation as l,getCIMSymbolColor as i}from"./cimSymbolUtils.js";import{getStroke as c}from"./gfxUtils.js";import s from"./Symbol3DMaterial.js";import{isSymbol3D as u,isSymbol2D as a}from"./typeUtils.js";function f(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.size}function m(e){if(!e)return 0;if(u(e)){const t=f(e);return null!=t?t:0}return r(c(e)?.width)}function y(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.color}function p(t){if(!t)return null;if(u(t))return y(t);const r=c(t)?.color;return r?new e(r):null}function h(e){if(null==e||!("symbolLayers"in e)||null==e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some(e=>"object"===e.type);case"line-3d":return e.symbolLayers.some(e=>"path"===e.type);case"polygon-3d":return e.symbolLayers.some(e=>"object"===e.type||"extrude"===e.type);default:return!1}}function d(e){return e.resource?.href??""}function b(t,r){if(!t)return null;let o=null;return u(t)?o=w(t):a(t)&&(o="cim"===t.type?i(t):t.color?new e(t.color):null),o?k(o,r):null}function w(t){const r=t.symbolLayers;if(!r)return null;let o=null;return r.forEach(e=>{"object"===e.type&&e.resource?.href||(o="water"===e.type?e.color:e.material?e.material.color:null)}),o?new e(o):null}function k(t,r){if(null==r||null==t)return t;const o=t.toRgba();return o[3]=o[3]*r,new e(o)}function g(t,r,o){const n=t.symbolLayers;if(!n)return;const l=(t,n=!1)=>{let l=r??t??null;return null!=o?.override&&(!l&&n&&(l=new e([255,255,255])),l&&(l.a=o.override)),k(l,o?.add)};n.forEach(e=>{if("water"===e.type)return void(e.color=k(e.color,o?.add));const t=null!=e.material?e.material.color:null,r=l(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new s({color:r}):e.material.color=r,"outline"in e&&e.outline?.color&&null!=o?.add&&(e.outline.color=k(e.outline.color,o.add)),"marker"in e&&null!=e.marker&&(e.marker.color=l(e.marker.color))})}function j(e,t,r){t=t??e.color,null!=r?.override&&t&&(t.a=r.override),t&&(e.color=k(t,r?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=k(e.outline.color,r?.add))}function L(t,r,o){t&&(r||null!=o)&&(r&&(r=new e(r)),u(t)?g(t,r,o):a(t)&&j(t,r,o))}async function v(e,r){const o=e.symbolLayers;o&&await t(o,async e=>z(e,r))}async function z(e,t){switch(e.type){case"extrude":U(e,t);break;case"icon":case"line":case"text":x(e,t);break;case"path":O(e,t);break;case"object":await E(e,t)}}function x(e,t){const r=S(t);null!=r&&(e.size=r)}function S(e){for(const t of e)if("number"==typeof t)return t;return null}function U(e,t){const r=t[2];"number"==typeof r&&(e.size=r)}async function E(e,t){const{resourceSize:r,symbolSize:o}=await C(e),n=R(t,r,o);null!=n&&(e.width=D(t[0],o[0],r[0],n),e.depth=D(t[1],o[1],r[1],n),e.height=D(t[2],o[2],r[2],n))}function O(e,t){const r=R(t,o,[e.width,void 0,e.height]);null!=r&&(e.width=D(t[0],e.width,1,r),e.height=D(t[2],e.height,1,r))}function R(e,t,r){for(let o=0;o<3;o++){const n=e[o];switch(n){case"symbol-value":{const e=r[o];return null!=e?e/t[o]:1}case"proportional":break;default:if(n&&t[o])return n/t[o]}}return null}async function C(e){const{computeObjectLayerResourceSize:t}=await import("./symbolLayerUtils.js"),r=await t(e,10),{width:o,height:n,depth:l}=e,i=[o,l,n];let c=1;for(let s=0;s<3;s++){const e=i[s];if(null!=e){c=e/r[s];break}}for(let s=0;s<3;s++)null==i[s]&&(i[s]=r[s]*c);return{resourceSize:r,symbolSize:i}}function D(e,t,r,o){switch(e){case"proportional":return r*o;case"symbol-value":return null!=t?t:r;default:return e}}function J(e,t){const r=S(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r}}async function M(e,t){if(e&&t)return u(e)?v(e,t):void(a(e)&&J(e,t))}function N(e,t,r){if(e&&null!=t)if(u(e)){const o=e.symbolLayers;o&&o.forEach(e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else if(a(e))switch(e.type){case"simple-marker":case"picture-marker":case"text":e.angle+=t;break;case"cim":l(e,t,!0)}}function q(e,t){if(!e)return null;const r=(t?e.effects:e.effects.filter(e=>"bloom"!==e.type)).map(e=>e.toJSON());return n(r)}function A(e){return null!=e&&"polygon-3d"===e.type&&e.symbolLayers.some(e=>"extrude"===e.type)}export{L as applyColorToSymbol,k as applyOpacityToColor,N as applyRotationToSymbol,M as applySizesToSymbol,q as getCSSFilterFromEffectList,b as getColorFromSymbol,d as getIconHref,p as getSymbolOutlineColor,m as getSymbolOutlineSize,h as isVolumetricSymbol,A as symbolHasExtrudeSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import{getContrast as o}from"../../../../core/colorUtils.js";import{watch as s,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{throttle as a}from"../../../../core/throttle.js";import{property as l,subclass as n}from"../../../../core/accessorSupport/decorators.js";import p from"../../../../symbols/CIMSymbol.js";import{getConfig as c}from"../../../analysis/ElevationProfile/constants.js";import{ElevationProfileHoveredPointVisualization as h}from"../../../analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js";import{createLineGeometry as y}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let d=class extends i{constructor(e){super(e),this._graphic=new t,this._updateGeometryThrottled=a(e=>{e&&(this._graphic.geometry=y(e.samples,e.spatialReference))},c().profileLinesUpdateThrottleMillis)}initialize(){this.addGraphic(this._graphic),this._indicatorVisualization=new h({analysisViewData:this.analysisViewData,line:this.line,view:this.view}),this.addHandles([s(()=>this._effectiveLineVisible,e=>{this._graphic.visible=e},r),s(()=>this._effectiveIndicatorVisible,e=>{this._indicatorVisualization.visible=e},r),s(()=>this._colorUpdateParameters,e=>this._updateColor(e),r),s(()=>this.analysisViewData.analysis.geometry,()=>{this._graphic.geometry=null},r),s(()=>this._geometryUpdateParameters,e=>this._updateGeometryThrottled(e),r),this._updateGeometryThrottled])}destroy(){this._graphic.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.analysisViewData.results.find(e=>e.computation.profile===this.line)}get _effectiveLineVisible(){return this.getEffectiveVisible("lineVisible")}get _effectiveIndicatorVisible(){const e=this.getEffectiveVisible("hoveredPointVisible");return this._effectiveLineVisible?e&&!!this._graphic.geometry:e}getEffectiveVisible(e){const{analysisViewData:t,_result:i}=this;return t.visible&&!!i?.available&&i.computation.profile.viewOptions[e]}get _geometryUpdateParameters(){const e={samples:this._result?.samples,spatialReference:this.view.spatialReference};return e.samples&&this._effectiveLineVisible&&1!==this.analysisViewData.progress?null:e}get _colorUpdateParameters(){const e=this._result?.computation.profile.color;return e?{color:e.toArray(),contrastColor:o(e).toArray()}:null}_updateColor(e){e&&(this._graphic.symbol=new p({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",capStyle:"Butt",color:e.color,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],joinStyle:"Round",width:1.5},{type:"CIMSolidStroke",capStyle:"Butt",color:e.contrastColor,joinStyle:"Round",width:1.5}]}}}))}};e([l({constructOnly:!0})],d.prototype,"addGraphic",void 0),e([l({constructOnly:!0})],d.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],d.prototype,"line",void 0),e([l({constructOnly:!0})],d.prototype,"view",void 0),e([l()],d.prototype,"updating",null),e([l()],d.prototype,"_result",null),e([l()],d.prototype,"_effectiveLineVisible",null),e([l()],d.prototype,"_effectiveIndicatorVisible",null),e([l()],d.prototype,"_geometryUpdateParameters",null),e([l()],d.prototype,"_colorUpdateParameters",null),d=e([n("esri.views.2d.analysis.ElevationProfile.ElevationProfileLineVisualization2D")],d);export{d as ElevationProfileLineVisualization2D};
5
+ import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import{getContrast as o}from"../../../../core/colorUtils.js";import{watch as s,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{throttle as a}from"../../../../core/throttle.js";import{property as l,subclass as n}from"../../../../core/accessorSupport/decorators.js";import p from"../../../../symbols/CIMSymbol.js";import{getConfig as c}from"../../../analysis/ElevationProfile/constants.js";import{ElevationProfileIndicatorPointVisualization as h}from"../../../analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js";import{createLineGeometry as y}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let d=class extends i{constructor(t){super(t),this._graphic=new e,this._updateGeometryThrottled=a(t=>{t&&(this._graphic.geometry=y(t.samples,t.spatialReference))},c().profileLinesUpdateThrottleMillis)}initialize(){this.addGraphic(this._graphic),this._indicatorVisualization=new h({analysisViewData:this.analysisViewData,line:this.line,view:this.view}),this.addHandles([s(()=>this._effectiveLineVisible,t=>{this._graphic.visible=t},r),s(()=>this._effectiveIndicatorVisible,t=>{this._indicatorVisualization.visible=t},r),s(()=>this._colorUpdateParameters,t=>this._updateColor(t),r),s(()=>this.analysisViewData.analysis.geometry,()=>{this._graphic.geometry=null},r),s(()=>this._geometryUpdateParameters,t=>this._updateGeometryThrottled(t),r),this._updateGeometryThrottled])}destroy(){this._graphic.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.analysisViewData.results.find(t=>t.computation.profile===this.line)}get _effectiveLineVisible(){return this.getEffectiveVisible("lineVisible")}get _effectiveIndicatorVisible(){const t=this.getEffectiveVisible("indicatorPointVisible");return this._effectiveLineVisible?t&&!!this._graphic.geometry:t}getEffectiveVisible(t){const{analysisViewData:e,_result:i}=this;return e.visible&&!!i?.available&&i.computation.profile.viewOptions[t]}get _geometryUpdateParameters(){const t={samples:this._result?.samples,spatialReference:this.view.spatialReference};return t.samples&&this._effectiveLineVisible&&1!==this.analysisViewData.progress?null:t}get _colorUpdateParameters(){const t=this._result?.computation.profile.color;return t?{color:t.toArray(),contrastColor:o(t).toArray()}:null}_updateColor(t){t&&(this._graphic.symbol=new p({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",capStyle:"Butt",color:t.color,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],joinStyle:"Round",width:1.5},{type:"CIMSolidStroke",capStyle:"Butt",color:t.contrastColor,joinStyle:"Round",width:1.5}]}}}))}};t([l({constructOnly:!0})],d.prototype,"addGraphic",void 0),t([l({constructOnly:!0})],d.prototype,"analysisViewData",void 0),t([l({constructOnly:!0})],d.prototype,"line",void 0),t([l({constructOnly:!0})],d.prototype,"view",void 0),t([l()],d.prototype,"updating",null),t([l()],d.prototype,"_result",null),t([l()],d.prototype,"_effectiveLineVisible",null),t([l()],d.prototype,"_effectiveIndicatorVisible",null),t([l()],d.prototype,"_geometryUpdateParameters",null),t([l()],d.prototype,"_colorUpdateParameters",null),d=t([n("esri.views.2d.analysis.ElevationProfile.ElevationProfileLineVisualization2D")],d);export{d as ElevationProfileLineVisualization2D};
@@ -51,22 +51,27 @@ export default abstract class ElevationProfileAnalysisView2D extends AnalysisVie
51
51
  */
52
52
  get error(): ElevationProfileError | null | undefined;
53
53
  /**
54
- * Points in the view that are computed from the [hoveredPosition](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#hoveredPosition) property (in the view's spatial reference).
54
+ * Points in the view that are computed from the [indicatorRelativePosition](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#indicatorRelativePosition)
55
+ * property (in the view's spatial reference).
55
56
  * There is one point for each [profile line](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html#profiles).
56
- * When a [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-ElevationProfileResult.html) of a profile line
57
- * is not available or no [sample](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-ElevationProfileResult.html#samples)
58
- * exists for the hovered position, the point is `undefined`.
57
+ * When a [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-ElevationProfileResult.html) of a profile line is not available or
58
+ * no [sample](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-ElevationProfileResult.html#samples) exists for the specified indicator
59
+ * position, the point is `undefined`.
59
60
  *
60
- * Whenever the [hoveredPosition](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#hoveredPosition) property has a value, the points are calculated, and by default, rendered in the view. The points in the view
61
- * can be hidden using the [viewOptions.hoveredPointVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfile-ElevationProfileLine.html#viewOptions)
62
- * setting on any of the [profile lines](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html#profiles).
61
+ * Whenever the [indicatorRelativePosition](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#indicatorRelativePosition) property has a
62
+ * value, the points are calculated and, by default, rendered in the view. The points in the view can be hidden using
63
+ * the [viewOptions.indicatorPointVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfile-ElevationProfileLine.html#viewOptions) setting on
64
+ * any of the [profile lines](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html#profiles).
63
65
  */
64
- get hoveredPoints(): Array<Point | null | undefined>;
66
+ get indicatorPoints(): Array<Point | null | undefined>;
65
67
  /**
66
- * Property that indicates a relative position along a [result's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-ElevationProfileResult.html) profile line, in [0, 1].
67
- * This can be used to track a hovered position in an elevation profile chart and display the corresponding points in the view using [hoveredPoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#hoveredPoints).
68
+ * Relative position along a [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-analysis-ElevationProfile-ElevationProfileResult.html)'s profile line, in
69
+ * [0, 1]. Set this (e.g., when hovering a chart) to compute locations along each configured profile line and expose
70
+ * them via [indicatorPoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#indicatorPoints). The view shows points at these
71
+ * locations unless a line's [viewOptions.indicatorPointVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfile-ElevationProfileLine.html#viewOptions)
72
+ * disables them.
68
73
  */
69
- accessor hoveredPosition: number | null | undefined;
74
+ accessor indicatorRelativePosition: number | null | undefined;
70
75
  /**
71
76
  * Enables interactivity for the [analysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-analysis-ElevationProfileAnalysisView2D.html#analysis). When set to `true` the input geometry can be edited
72
77
  * interactively.
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as o,subclass as i}from"../../../core/accessorSupport/decorators.js";import r from"./AnalysisView2D.js";import{ElevationProfileVisualization2D as s}from"./ElevationProfile/ElevationProfileVisualization2D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as n}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as u}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let c=class extends r{constructor(t){super(t),this.type="elevation-profile-view-2d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:o}=this;this._controller=new l({analysis:t,analysisViewData:this,view:o,computationFactory:{create:t=>{switch(t.profile.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":throw new e("elevation-profile-analysis-view-2d:unsupported","The scene profile line type is not supported in 2D views.")}}}}),this._visualization=new s({view:o,analysisViewData:this}),this._sketchTool=new u({view:o,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:"meters",elevation:"meters"}}get error(){return this._controller?.error}get hoveredPoints(){return this._controller?.hoveredPoints??[]}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return!0===this._controller?.updating||!0===this._visualization?.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickFeature(t){return this._sketchTool.pickFeature(t)}};t([o({readOnly:!0})],c.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),t([o({readOnly:!0})],c.prototype,"effectiveDisplayUnits",null),t([o({readOnly:!0})],c.prototype,"error",null),t([o()],c.prototype,"hoveredPosition",void 0),t([o()],c.prototype,"hoveredPoints",null),t([o({readOnly:!0})],c.prototype,"progress",null),t([o({readOnly:!0})],c.prototype,"results",null),t([o({readOnly:!0})],c.prototype,"statistics",null),t([o({readOnly:!0})],c.prototype,"updating",null),t([o()],c.prototype,"sketchGraphic",null),t([o()],c.prototype,"toolState",null),t([o()],c.prototype,"_controller",void 0),t([o()],c.prototype,"_visualization",void 0),t([o()],c.prototype,"_sketchTool",void 0),c=t([i("esri.views.2d.analysis.ElevationProfileAnalysisView2D")],c);const y=c;export{y as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as i,subclass as o}from"../../../core/accessorSupport/decorators.js";import r from"./AnalysisView2D.js";import{ElevationProfileVisualization2D as s}from"./ElevationProfile/ElevationProfileVisualization2D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as n}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends r{constructor(t){super(t),this.type="elevation-profile-view-2d",this.analysis=null,this.indicatorRelativePosition=null}initialize(){const{analysis:t,view:i}=this;this._controller=new l({analysis:t,analysisViewData:this,view:i,computationFactory:{create:t=>{switch(t.profile.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":throw new e("elevation-profile-analysis-view-2d:unsupported","The scene profile line type is not supported in 2D views.")}}}}),this._visualization=new s({view:i,analysisViewData:this}),this._sketchTool=new c({view:i,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:"meters",elevation:"meters"}}get error(){return this._controller?.error}get indicatorPoints(){return this._controller?.indicatorPoints??[]}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return!0===this._controller?.updating||!0===this._visualization?.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickFeature(t){return this._sketchTool.pickFeature(t)}};t([i({readOnly:!0})],u.prototype,"type",void 0),t([i({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([i({readOnly:!0})],u.prototype,"effectiveDisplayUnits",null),t([i({readOnly:!0})],u.prototype,"error",null),t([i()],u.prototype,"indicatorRelativePosition",void 0),t([i()],u.prototype,"indicatorPoints",null),t([i({readOnly:!0})],u.prototype,"progress",null),t([i({readOnly:!0})],u.prototype,"results",null),t([i({readOnly:!0})],u.prototype,"statistics",null),t([i({readOnly:!0})],u.prototype,"updating",null),t([i()],u.prototype,"sketchGraphic",null),t([i()],u.prototype,"toolState",null),t([i()],u.prototype,"_controller",void 0),t([i()],u.prototype,"_visualization",void 0),t([i()],u.prototype,"_sketchTool",void 0),u=t([o("esri.views.2d.analysis.ElevationProfileAnalysisView2D")],u);const y=u;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{identity as t,translate as e,rotate as a,scaleByVec2 as s,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{createVFMesh as l,createVFMeshScalar as n}from"../../../../layers/raster/functions/vectorFieldUtils.js";import{DisplayObject as c}from"../DisplayObject.js";import{createProgramDescriptor as h}from"../webgl/Utils.js";import{BufferObject as m}from"../../../webgl/BufferObject.js";import{DataType as u}from"../../../webgl/enums.js";import{VertexArrayObject as d}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as f}from"../../../webgl/VertexBuffer.js";class v extends c{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){super.destroy(),null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||null==this.vaoData||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,null!=this.source&&null==this.vaoData){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const e=l(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e);this.vaoData={magdir:a}}break;case"simple_scalar":{const e=n(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e);this.vaoData={scalar:a}}break;case"wind_speed":{const e=l(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e),s=n(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:a,scalar:i}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:r()}}setTransform(r){const l=t(this.transforms.displayViewScreenMat3),[n,c]=r.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/r.resolution,m=h*this.width,u=h*this.height,d=Math.PI*this.rotation/180;e(l,l,o(n,c)),e(l,l,o(m/2,u/2)),a(l,l,-d),e(l,l,o(-m/2,-u/2)),s(l,l,o(m,u)),i(this.transforms.displayViewScreenMat3,r.displayViewMat3,l)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:a,indexData:s}=e,i=m.createIndex(t,35044,new Uint32Array(s)),r=h("vector-field",[{location:0,name:"a_pos",count:2,type:u.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:u.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:u.FLOAT,normalized:!1}]),o=new f(t,r.bufferLayout,new Float32Array(a));return{vao:new d(t,o,i),elementCount:s.length}}}export{v as RasterVFDisplayObject};
5
+ import{identity as t,translate as e,rotate as a,scaleByVec2 as s,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{createVFMesh as l,createVFMeshScalar as n}from"../../../../layers/raster/functions/vectorFieldUtils.js";import{DisplayObject as c}from"../DisplayObject.js";import{createProgramDescriptor as h}from"../webgl/Utils.js";import{BufferObject as m}from"../../../webgl/BufferObject.js";import{DataType as u}from"../../../webgl/enums.js";import{VertexArrayObject as d}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as f}from"../../../webgl/VertexBuffer.js";class v extends c{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){super.destroy(),null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||null==this.vaoData||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,null!=this.source&&null==this.vaoData){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const e=l(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e);this.vaoData={magdir:a}}break;case"simple_scalar":{const e=n(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e);this.vaoData={scalar:a}}break;case"wind_speed":{const e=l(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e),s=n(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:a,scalar:i}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:r()}}setTransform(r){const l=t(this.transforms.displayViewScreenMat3),[n,c]=r.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/r.resolution,m=h*this.width,u=h*this.height,d=Math.PI*this.rotation/180;e(l,l,o(n,c)),e(l,l,o(m/2,u/2)),a(l,l,-d),e(l,l,o(-m/2,-u/2)),s(l,l,o(m,u)),i(this.transforms.displayViewScreenMat3,r.displayViewMat3,l)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:a,indexData:s}=e,i=m.createIndex(t,35044,new Uint32Array(s)),r=h("vector-field",[{location:0,name:"a_pos",count:2,type:u.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:u.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:u.FLOAT,normalized:!1}]),o=new f(t,r.bufferLayout,new Float32Array(a));return{vao:new d(t,o,i),elementCount:s.length}}}export{v as RasterVFDisplayObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileCoordSize as i}from"./constants.js";import{CircleRenderBucket as o,SymbolRenderBucket as h,LineRenderBucket as n,FillRenderBucket as l}from"./RenderBucket.js";import{fadeDuration as c}from"./decluttering/config.js";import{TiledDisplayObject as d}from"../webgl/TiledDisplayObject.js";const u=null;class y extends d{constructor(e,t,s,r,a,o,h,n=null){super(e,t,s,r,a,o,i,i),this.styleRepository=h,this._owner=n,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<c}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<c)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,3===e.type&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._owner?.updateTileSize(this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(y._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0===--this._referenced&&(this._owner?.onDisposeTile(this),this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),3===i.type&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._owner?.updateTileSize(this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())3===s.type&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case 1:s=new l(e,this.styleRepository);break;case 2:s=new n(e,this.styleRepository);break;case 3:s=new h(e,this.styleRepository,this);break;case 4:s=new o(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{y as VectorTile,u as tracer};
5
+ import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileCoordSize as i}from"./constants.js";import{CircleRenderBucket as o,SymbolRenderBucket as h,LineRenderBucket as n,FillRenderBucket as l}from"./RenderBucket.js";import{fadeDuration as c}from"./decluttering/config.js";import{TiledDisplayObject as d}from"../webgl/TiledDisplayObject.js";const u=null;class y extends d{constructor(e,t,s,r,a,o,h,n=null){super(e,t,s,r,a,o,i,i),this.styleRepository=h,this._owner=n,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<c}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<c)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,3===e.type&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._owner?.updateTileSize(this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(y._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0===--this._referenced&&(this._owner?.onDisposeTile(this),this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),3===i.type&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._owner?.updateTileSize(this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())3===s.type&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case 1:s=new l(e,this.styleRepository);break;case 2:s=new n(e,this.styleRepository);break;case 3:s=new h(e,this.styleRepository,this);break;case 4:s=new o(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{y as VectorTile,u as tracer};