@arcgis/core 5.1.0-next.57 → 5.1.0-next.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/applications/Components/SelectionOperation.d.ts +2 -2
- package/applications/Components/SelectionOperation.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/04ea806b933d4dd41609.js +1 -0
- package/assets/esri/core/workers/chunks/{278eecd729bed2832702.js → 0622e238693c257abacb.js} +1 -1
- package/assets/esri/core/workers/chunks/{05bc675c029ed311427f.js → 155c741a9839d24f04a2.js} +1 -1
- package/assets/esri/core/workers/chunks/1ae4e43a399e1974f106.js +1 -0
- package/assets/esri/core/workers/chunks/1f8e22df08c2f5fbb8c8.js +1 -0
- package/assets/esri/core/workers/chunks/{2327b368673a974dee8b.js → 2339465190c9d5ede25f.js} +1 -1
- package/assets/esri/core/workers/chunks/23f6d24bf850bc3280ec.js +1 -0
- package/assets/esri/core/workers/chunks/2541ac6e0ed1184edc9b.js +1 -0
- package/assets/esri/core/workers/chunks/34207774bc371e95ba3c.js +1 -0
- package/assets/esri/core/workers/chunks/{01777e91cd4e0bf04fd0.js → 35217befc8f9882d139e.js} +1 -1
- package/assets/esri/core/workers/chunks/{40bcfc4f8efe7de7ec9d.js → 3de17e89973160b42923.js} +1 -1
- package/assets/esri/core/workers/chunks/{992e74570b76f3f9e52e.js → 48d289db3145ce6c02bb.js} +1 -1
- package/assets/esri/core/workers/chunks/4c73c2f4331351e2a50c.js +1 -0
- package/assets/esri/core/workers/chunks/{2757cf54656b5d318b11.js → 55a0b69cf034ac32fc25.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d54beab8ae5ff31e7b0.js → 5a9f5a49dc68b42762bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{7cec3252e3ee56424b9e.js → 5c6e5f22450dd0583074.js} +1 -1
- package/assets/esri/core/workers/chunks/{b39b4db86a1049f0b901.js → 6be9d00839002f24fafd.js} +1 -1
- package/assets/esri/core/workers/chunks/6c886f19875291d02407.js +1 -0
- package/assets/esri/core/workers/chunks/75e28458e08b0738b35a.js +2 -0
- package/assets/esri/core/workers/chunks/{c460ca93ed8e20d8b53a.js → 86a6dd19903fa5023cc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{4afddb66242438b38df0.js → 8ccf2f65d8ed3c48ffff.js} +1 -1
- package/assets/esri/core/workers/chunks/{fcfaaced184f8da3e28d.js → 9b53aa2429573f1b977f.js} +1 -1
- package/assets/esri/core/workers/chunks/9d580b5bcd59857a5702.js +1405 -0
- package/assets/esri/core/workers/chunks/a37697ef360e2425768a.js +1 -0
- package/assets/esri/core/workers/chunks/{a787fe09d3df9d4254ba.js → ab3183f2327ff26e2b45.js} +1 -1
- package/assets/esri/core/workers/chunks/b0f2ce61d3cad413898e.js +1 -0
- package/assets/esri/core/workers/chunks/{53c149bca42595b7dd1e.js → bbdf27bc34fadbe8e6fe.js} +1 -1
- package/assets/esri/core/workers/chunks/be42fe0b7ba0e27030b2.js +1 -0
- package/assets/esri/core/workers/chunks/d0c3ab70f390cd579fed.js +1 -0
- package/assets/esri/core/workers/chunks/{5a573fa1012092328b88.js → d816d1a4220d827faf63.js} +1 -1
- package/assets/esri/core/workers/chunks/e26894655823849947f4.js +1 -0
- package/assets/esri/core/workers/chunks/e59f5dc8c85bcea66e98.js +1 -0
- package/assets/esri/core/workers/chunks/{ccf845ac0ac354507a25.js → ec1b2eb05410848081c9.js} +1 -1
- package/assets/esri/core/workers/chunks/{851dd71d28681d4eccfd.js → f7af90c5f9d371eb7009.js} +1 -1
- package/assets/esri/core/workers/chunks/fa6e1ad099b43a6f5501.js +1 -0
- package/assets/esri/core/workers/chunks/{4a6186001323b47c23a4.js → fee1d873127dca02459f.js} +1 -1
- package/chunks/GlobalIllumination.glsl.js +101 -0
- package/chunks/GlobalIlluminationBlur.glsl.js +68 -0
- package/chunks/ScreenSpaceShadowHighlight.glsl.js +6 -0
- package/chunks/ShadowCastAccumulate.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +15 -8
- package/config.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/polygonUtils.js +1 -1
- package/geometry/support/{triangulationUtils.js → triangulationUtilsDeprecated.js} +1 -1
- package/kernel.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/networks/support/jsonTypes.d.ts +6 -0
- package/package.json +2 -2
- package/renderers/ClassBreaksRenderer.js +1 -1
- package/renderers/DictionaryRenderer.js +1 -1
- package/renderers/DotDensityRenderer.js +1 -1
- package/renderers/HeatmapRenderer.js +1 -1
- package/renderers/PieChartRenderer.js +1 -1
- package/renderers/Renderer.js +1 -1
- package/renderers/SimpleRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/AttributeColorInfo.js +1 -1
- package/renderers/support/ClassBreakInfo.d.ts +6 -0
- package/renderers/support/ClassBreakInfo.js +1 -1
- package/renderers/support/UniqueValueClass.d.ts +12 -0
- package/renderers/support/UniqueValueClass.js +1 -1
- package/renderers/support/UniqueValueInfo.d.ts +12 -0
- package/renderers/support/UniqueValueInfo.js +1 -1
- package/renderers/visualVariables/ColorVariable.js +1 -1
- package/renderers/visualVariables/OpacityVariable.js +1 -1
- package/renderers/visualVariables/SizeVariable.js +1 -1
- package/renderers/visualVariables/VisualVariable.js +1 -1
- package/rest/networks/support/FunctionResult.d.ts +6 -0
- package/rest/networks/support/FunctionResult.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/GlyphSource.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
- package/views/2d/engine/webgl/util/MapMatcher.js +1 -1
- package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/extrudeUtils.js +1 -1
- package/views/3d/layers/graphics/extrudeUtilsDeprecated.js +2 -0
- package/views/3d/layers/graphics/tessellationUtils.js +2 -0
- package/views/3d/layers/i3s/PointCloudHighlights.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/i3s/PointCloudRendererNode.js +1 -1
- package/views/3d/layers/support/Tiles3DBVH.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/support/renderInfoUtils/line.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/support/renderInfoUtils/polygonDeprecated.js +2 -0
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js +6 -5
- package/views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js +4 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EncodingColor.glsl.js +7 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +93 -72
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +46 -22
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadGlobalIllumination.glsl.js +20 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +18 -13
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +23 -9
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/emissive/emissions.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/BlueNoise.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlurTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlight.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightRenderNode.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ReprojectionUniforms.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/GlobalIllumination.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/GlobalIlluminationBlur.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ReceiveShadowsConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/selection/SelectionOperation.d.ts +190 -0
- package/views/selection/SelectionOperation.js +2 -0
- package/views/selection/types.d.ts +146 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/009db7b459b18f6a668b.js +0 -1
- package/assets/esri/core/workers/chunks/0fc60b4c44c4e865b699.js +0 -2
- package/assets/esri/core/workers/chunks/34484afe767d60f85982.js +0 -1
- package/assets/esri/core/workers/chunks/55bb5b7817c2963c8bfa.js +0 -1
- package/assets/esri/core/workers/chunks/572fcd33ae3648ed4f9c.js +0 -1
- package/assets/esri/core/workers/chunks/66a4d764937918a2779f.js +0 -1
- package/assets/esri/core/workers/chunks/6b56c8ba978ec6edd6b8.js +0 -1
- package/assets/esri/core/workers/chunks/9806cc96414065ae0afe.js +0 -1
- package/assets/esri/core/workers/chunks/9b365a6242b0287f8727.js +0 -1
- package/assets/esri/core/workers/chunks/a029db48079af4b5cccd.js +0 -1
- package/assets/esri/core/workers/chunks/ea068f75397c3b3337ec.js +0 -1034
- package/assets/esri/core/workers/chunks/ec91d5081f423755cb07.js +0 -1
- package/assets/esri/core/workers/chunks/f9fe89ced41b49608667.js +0 -1
- package/assets/esri/core/workers/chunks/fce30184f354fb7d11af.js +0 -1
- package/widgets/support/Selector2D/SelectionOperation.js +0 -2
- /package/assets/esri/core/workers/chunks/{0fc60b4c44c4e865b699.js.LICENSE.txt → 75e28458e08b0738b35a.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as i}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{EncodeEmissionColors as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EncodingColor.glsl.js";import{addMainLightDirection as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceReflections as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import{CameraSpace as a}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as s,If as l}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as d}from"../views/webgl/NoParameters.js";import{ShaderBuilder as u}from"../views/webgl/ShaderBuilder.js";class p extends d{constructor(){super(...arguments),this.projScale=1,this.frameCount=0}}function g(d){const p=new u,g=p.fragment;return p.include(e),p.include(a),r(g),g.include(i),p.include(t,{highStepCount:!1,screenSpaceReflections:!0}),g.include(o),g.uniforms.add(new m("normalMap",e=>e.normalTexture),new m("depthMap",e=>e.depthTexture),new m("lastFrameDepthTexture",(e,i)=>i.reprojection.lastFrameDepth?.attachment),new m("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination),new c("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new c("view",e=>e.camera.viewMatrix),new n("frameCount",e=>e.frameCount),new m("blueNoiseTex",e=>e.noiseTexture)),d.hasEmission&&g.uniforms.add(new m("lastFrameEmissionTexture",(e,i)=>i.reprojection.lastFrameEmission?.attachment)),g.constants.add("timeSamplesSize","float",64),g.constants.add("blueNoiseGridSize","float",8),g.code.add(s`vec4 randomDirection(float index) {
|
|
3
|
+
vec2 textureOffset = vec2(mod(index, blueNoiseGridSize), floor(index / blueNoiseGridSize)) * timeSamplesSize;
|
|
4
|
+
ivec2 iuv = ivec2(textureOffset + mod(gl_FragCoord.xy, vec2(timeSamplesSize)));
|
|
5
|
+
vec4 blueNoiseValue = texelFetch(blueNoiseTex, iuv, 0);
|
|
6
|
+
return 2.0 * blueNoiseValue - 1.0;
|
|
7
|
+
}`),g.main.add(s`
|
|
8
|
+
float depth = depthFromTexture(depthMap, uv);
|
|
9
|
+
|
|
10
|
+
// Early out if depth is out of range, such as in the sky
|
|
11
|
+
if (depth >= 1.0 || depth <= 0.0) {
|
|
12
|
+
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Get the normal of current fragment
|
|
17
|
+
ivec2 iuv = ivec2(uv * vec2(textureSize(normalMap, 0)));
|
|
18
|
+
vec4 normal4 = texelFetch(normalMap, iuv, 0);
|
|
19
|
+
if(normal4.a != 1.0) {
|
|
20
|
+
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
vec3 normal = normalize(normal4.xyz * 2.0 - 1.0);
|
|
24
|
+
|
|
25
|
+
// Reconstruct view space position of current fragment
|
|
26
|
+
float currentPixelDepth = linearizeDepth(depth);
|
|
27
|
+
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
|
|
28
|
+
vec4 viewPos = vec4(currentPixelPos, 1.0);
|
|
29
|
+
|
|
30
|
+
// Reproject current view position to last frame
|
|
31
|
+
vec4 reprojectedViewPos = reprojectionViewMatrix * viewPos;
|
|
32
|
+
vec4 reprojectedCoordinate = applyProjectionMat(proj, reprojectedViewPos.xyz);
|
|
33
|
+
|
|
34
|
+
// Read last frame reprojected depth and GI value.
|
|
35
|
+
float lastFrameDepthViewPos = -linearDepthFromTextureLastFrame(lastFrameDepthTexture, reprojectedCoordinate.xy);
|
|
36
|
+
vec4 lastFrameGlobalIllumination = texture(lastFrameGlobalIlluminationTexture, reprojectedCoordinate.xy);
|
|
37
|
+
|
|
38
|
+
int steps;
|
|
39
|
+
float weightOcclusion;
|
|
40
|
+
float weightEmission;
|
|
41
|
+
|
|
42
|
+
// Heuristic to determine blending weights and number of steps for occlusion and emission
|
|
43
|
+
if (abs((lastFrameDepthViewPos + reprojectedViewPos.z)/max(lastFrameDepthViewPos, reprojectedViewPos.z)) > 0.01) {
|
|
44
|
+
steps = 6;
|
|
45
|
+
weightOcclusion = 1.0;
|
|
46
|
+
weightEmission = 1.0;
|
|
47
|
+
} else {
|
|
48
|
+
steps = 1;
|
|
49
|
+
if (lastFrameGlobalIllumination.b > 0.5) {
|
|
50
|
+
weightOcclusion = 0.15;
|
|
51
|
+
weightEmission = 0.008;
|
|
52
|
+
} else if (lastFrameGlobalIllumination.b > 0.02) {
|
|
53
|
+
weightOcclusion = lastFrameGlobalIllumination.b - 0.005;
|
|
54
|
+
weightEmission = 0.008;
|
|
55
|
+
} else {
|
|
56
|
+
weightOcclusion = 0.016;
|
|
57
|
+
weightEmission = 0.008;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
vec4 randomDirectionSample;
|
|
62
|
+
|
|
63
|
+
// For each ray determine if it hits geometry and calculate occlusion and emission values
|
|
64
|
+
float stepSize = 1.0 / float(steps);
|
|
65
|
+
for (int i = 0; i < steps; ++i) {
|
|
66
|
+
float index = float(i * min(64/steps, 6) + int(mod(frameCount, float(64/steps))));
|
|
67
|
+
randomDirectionSample = randomDirection(index);
|
|
68
|
+
vec3 rayDirection = normalize(normal + 0.95 * normalize(randomDirectionSample.xyz));
|
|
69
|
+
vec3 hit = screenSpaceIntersection(rayDirection, viewPos.xyz, normalize(viewPos.xyz), normal, randomDirectionSample.a * 0.5 + 0.5, true);
|
|
70
|
+
|
|
71
|
+
if (hit.z > 0.0) {
|
|
72
|
+
// Emission - reproject to get and accumulate emission from last frame
|
|
73
|
+
vec2 hitReprojectedCoordinate = reprojectionCoordinate(hit);
|
|
74
|
+
vec3 emissionColor = ${l(d.hasEmission,"texture(lastFrameEmissionTexture, hitReprojectedCoordinate).xyz","vec3(0.0)")};
|
|
75
|
+
fragColor += vec4(emissionColor * vec3(stepSize), 0.0);
|
|
76
|
+
} else {
|
|
77
|
+
// Occlusion - heuristic modulating sky intensity based on angle to main light
|
|
78
|
+
vec4 viewMainLightDirection = view * vec4(mainLightDirection, 0.0);
|
|
79
|
+
float skyModulation = pow(max(dot(rayDirection, viewMainLightDirection.xyz), 0.0), 3.0) * 5.5;
|
|
80
|
+
float weight = clamp(3.5 * dot(viewMainLightDirection.xyz, normal), 0.0, 1.0);
|
|
81
|
+
skyModulation = mix(1.0, skyModulation * 0.2 + 0.8, weight);
|
|
82
|
+
fragColor += skyModulation * vec4(vec3(0.0), stepSize);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Rendering trick add noise to reduce accumulation artifacts
|
|
87
|
+
float temporalNoise = weightOcclusion < 1. ? randomDirectionSample.r : 0.0;
|
|
88
|
+
|
|
89
|
+
// Accumulate occlusion
|
|
90
|
+
fragColor.a = mix(lastFrameGlobalIllumination.a + temporalNoise * 0.01, fragColor.a, weightOcclusion);
|
|
91
|
+
|
|
92
|
+
// Accumulate emission
|
|
93
|
+
vec3 lastFrameEmission = decodeVec2ToRGB(lastFrameGlobalIllumination.rg);
|
|
94
|
+
fragColor.rgb = mix(lastFrameEmission + temporalNoise * 0.01, fragColor.rgb, weightEmission);
|
|
95
|
+
|
|
96
|
+
// Encode emission and occlusion into output
|
|
97
|
+
vec2 encodedColor = encodeRGBtoVec2(fragColor.rgb);
|
|
98
|
+
fragColor.r = encodedColor.x;
|
|
99
|
+
fragColor.g = encodedColor.y;
|
|
100
|
+
fragColor.b = weightOcclusion;
|
|
101
|
+
`),p}const f=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:p,build:g},Symbol.toStringTag,{value:"Module"}));export{p as G,f as a,g as b};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as t}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{EncodeEmissionColors as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EncodingColor.glsl.js";import{CameraSpace as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{Float2DrawUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{FloatPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as r}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DDrawUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as m}from"../views/webgl/NoParameters.js";import{ShaderBuilder as u}from"../views/webgl/ShaderBuilder.js";const p=4;class f extends m{constructor(){super(...arguments),this.blurSize=e()}}function d(){const e=new u,m=e.fragment;e.include(o),e.include(s),m.include(l);const f=(p+3)/2,d=1/(2*f*f);m.include(t);const h=5e4;m.uniforms.add(new c("depthMap",e=>e.depthTexture),new c("normalMap",e=>e.normalTexture),new n("tex",e=>e.colorTexture),new i("blurSize",e=>e.blurSize),new a("projScale",(e,o)=>{const t=o.camera.distance;return t>h?Math.max(0,e.projScale-(t-h)):e.projScale}));const g=15.3,S=.1,v=.03,b=.08,w=1.5;m.code.add(r`
|
|
3
|
+
void accumulateBlurSample(
|
|
4
|
+
vec2 sampleUv,
|
|
5
|
+
float sampleOffset,
|
|
6
|
+
float centerDepth,
|
|
7
|
+
vec3 centerNormal,
|
|
8
|
+
float depthSharpness,
|
|
9
|
+
inout float emissionWeightSum,
|
|
10
|
+
inout vec3 emissionSum,
|
|
11
|
+
inout float occlusionWeightSum,
|
|
12
|
+
inout float occlusionSum,
|
|
13
|
+
float centerOcclusionWeight
|
|
14
|
+
) {
|
|
15
|
+
vec4 globalIllumination = texture(tex, sampleUv);
|
|
16
|
+
vec3 sampleNormal = texture(normalMap, sampleUv).rgb;
|
|
17
|
+
float sampleDepth = linearDepthFromTexture(depthMap, sampleUv);
|
|
18
|
+
|
|
19
|
+
float depthDelta = sampleDepth - centerDepth;
|
|
20
|
+
float normalWeight = clamp(1.0 - ${r.float(g)} * length(sampleNormal - centerNormal), 0.0, 1.0);
|
|
21
|
+
vec3 decodedEmission = decodeVec2ToRGB(globalIllumination.rg);
|
|
22
|
+
|
|
23
|
+
float emissionWeight = exp(-sampleOffset * sampleOffset * ${r.float(d)} * ${r.float(S)} - depthDelta * depthDelta * depthSharpness);
|
|
24
|
+
emissionWeight *= normalWeight;
|
|
25
|
+
emissionWeightSum += emissionWeight;
|
|
26
|
+
emissionSum += emissionWeight * decodedEmission;
|
|
27
|
+
|
|
28
|
+
float occlusionKernelScale = centerOcclusionWeight > ${r.float(v)}
|
|
29
|
+
? ${r.float(b)}
|
|
30
|
+
: ${r.float(w)};
|
|
31
|
+
float occlusionWeight = exp(-sampleOffset * sampleOffset * occlusionKernelScale - depthDelta * depthDelta * depthSharpness);
|
|
32
|
+
occlusionWeight *= normalWeight;
|
|
33
|
+
occlusionWeightSum += occlusionWeight;
|
|
34
|
+
occlusionSum += occlusionWeight * globalIllumination.a;
|
|
35
|
+
}
|
|
36
|
+
`);const W=-.05;return m.main.add(r`
|
|
37
|
+
vec3 emissionSum = vec3(0.0);
|
|
38
|
+
float emissionWeightSum = 0.0;
|
|
39
|
+
|
|
40
|
+
float centerDepth = linearDepthFromTexture(depthMap, uv);
|
|
41
|
+
vec3 centerNormal = texture(normalMap, uv).rgb;
|
|
42
|
+
float occlusionSum = 0.0;
|
|
43
|
+
float occlusionWeightSum = 0.0;
|
|
44
|
+
float centerOcclusionWeight = texture(tex, uv).b;
|
|
45
|
+
|
|
46
|
+
float depthSharpness = ${r.float(W)} * projScale / centerDepth;
|
|
47
|
+
for (int sampleOffset = -${r.int(p)}; sampleOffset <= ${r.int(p)}; ++sampleOffset) {
|
|
48
|
+
float sampleOffsetFloat = float(sampleOffset);
|
|
49
|
+
vec2 sampleUv = uv + sampleOffsetFloat * blurSize;
|
|
50
|
+
accumulateBlurSample(
|
|
51
|
+
sampleUv,
|
|
52
|
+
sampleOffsetFloat,
|
|
53
|
+
centerDepth,
|
|
54
|
+
centerNormal,
|
|
55
|
+
depthSharpness,
|
|
56
|
+
emissionWeightSum,
|
|
57
|
+
emissionSum,
|
|
58
|
+
occlusionWeightSum,
|
|
59
|
+
occlusionSum,
|
|
60
|
+
centerOcclusionWeight
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
vec3 blurredEmission = (emissionSum / emissionWeightSum).rgb;
|
|
65
|
+
vec2 encodedEmission = encodeRGBtoVec2(blurredEmission.rgb);
|
|
66
|
+
float occlusion = occlusionSum / occlusionWeightSum;
|
|
67
|
+
fragColor = vec4(vec3(encodedEmission.x, encodedEmission.y, centerOcclusionWeight), occlusion);
|
|
68
|
+
`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationBlurDrawParameters:f,build:d},Symbol.toStringTag,{value:"Module"}));export{f as G,h as a,d as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{calculateUVZShadowFromDepthPass as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import{ShadowmapFiltering as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import{glsl as o}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DShadowBindUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js";import{ShaderBuilder as t}from"../views/webgl/ShaderBuilder.js";function s(){const s=new t;return s.include(e),s.include(a),s.include(r),s.outputs.add("fragShadow","float"),s.fragment.uniforms.add(new i("shadowMapHighlight",({shadowMap:e})=>e.getOutput(6)),new d("depthMap",e=>e.depth?.attachment)).main.add(o`fragShadow = 0.0;
|
|
3
|
+
vec3 uvzShadow = calculateUVZShadowFromDepth(uv, textureSize(shadowMapHighlight, 0), depthMap);
|
|
4
|
+
if (uvzShadow.z >= 0.0) {
|
|
5
|
+
fragShadow = readShadowMapUVZ(uvzShadow, shadowMapHighlight);
|
|
6
|
+
}`),s}const n=Object.freeze(Object.defineProperty({__proto__:null,build:s},Symbol.toStringTag,{value:"Module"}));export{n as S,s as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{calculateUVZShadowFromDepthPass as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import{readShadowMaps as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ShadowmapFiltering as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import{glsl as d}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{ShaderBuilder as t}from"../views/webgl/ShaderBuilder.js";const n=255,l=1/n;function i(n){const i=new t,{fragment:m}=i;i.include(e),i.include(a),i.include(s),i.include(o),m.constants.add("sampleValue","float",l);const p=1===n.index?"vec2":"float";return i.outputs.add("sampleCount",p),m.uniforms.add(new r("depthMap",e=>e.depth?.attachment)).main.add(d`
|
|
2
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{calculateUVZShadowFromDepthPass as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import{readShadowMaps as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ShadowmapFiltering as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import{glsl as d}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{ShaderBuilder as t}from"../views/webgl/ShaderBuilder.js";const n=255,l=1/n;function i(n){const i=new t,{fragment:m}=i;i.include(e),i.include(a),i.include(s),i.include(o,!1),m.constants.add("sampleValue","float",l);const p=1===n.index?"vec2":"float";return i.outputs.add("sampleCount",p),m.uniforms.add(new r("depthMap",e=>e.depth?.attachment)).main.add(d`
|
|
3
3
|
sampleCount = ${p}(0.0);
|
|
4
4
|
|
|
5
5
|
vec3 uvzShadow = calculateUVZShadowFromDepth(uv, textureSize(shadowMap,0), depthMap);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{normalize as e,transformMat4 as i}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as
|
|
2
|
+
import{normalize as e,transformMat4 as i}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{NormalFromDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js";import{ScreenSpacePass as t}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{calculateUVZShadowFromDepthPass as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import{ShadowmapFiltering as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import{Float3BindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float4PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as d}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DShadowBindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js";import{Texture2DUintPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{ShaderBuilder as m}from"../views/webgl/ShaderBuilder.js";const w=.025;function p(r){const p=new m;p.include(a),p.include(l),p.include(t),p.include(o);const v=p.fragment;return v.uniforms.add(new c("shadowMapExcludingHighlight",({shadowMap:e})=>e.getOutput(7)),new s("screenSpaceShadowHighlight",({screenSpaceShadowHighlightFbo:e})=>e?.getTexture()),new s("depthMap",e=>e.mainDepth),new u("highlightTexture",e=>e.highlightTexture),new g("uColor",e=>e.shadowColor),new n("opacity",e=>e.shadowOpacity),new n("occludedOpacity",e=>e.occludedShadowOpacity),new n("terminationFactor",e=>e.opacityElevation*e.dayNightTerminator),new h("lightingMainDirectionView",({lighting:r,camera:o})=>e(f,i(f,r.mainLight.direction,o.viewInverseTransposeMatrix)))),v.main.add(d`
|
|
3
3
|
ivec2 highlightTextureSize = textureSize(highlightTexture, 0);
|
|
4
4
|
ivec2 highlightIUV = ivec2(uv * vec2(highlightTextureSize));
|
|
5
5
|
uvec2 highlightInfo = texelFetch(highlightTexture, highlightIUV, 0).rg;
|
|
@@ -14,23 +14,30 @@ import{normalize as e,transformMat4 as i}from"../core/libs/gl-matrix-2/math/vec3
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
// screenSpaceShadowHighlight is rendered as a full-resolution screen-space buffer, so the current
|
|
18
|
+
// framebuffer pixel maps directly to the corresponding texel in the screen-space highlight texture.
|
|
19
|
+
float shadowHighlightFactor = texelFetch(screenSpaceShadowHighlight, ivec2(gl_FragCoord.xy), 0).r;
|
|
20
|
+
if (shadowHighlightFactor == 0.0) {
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
vec4 currentPixelPos;
|
|
25
|
+
vec3 uvzShadow = calculateUVZShadowAndPixelPosFromDepth(
|
|
26
|
+
uv,
|
|
27
|
+
textureSize(shadowMapExcludingHighlight, 0),
|
|
28
|
+
depthMap,
|
|
29
|
+
currentPixelPos
|
|
30
|
+
);
|
|
31
|
+
if (uvzShadow.z < 0.0) {
|
|
25
32
|
return;
|
|
26
33
|
}
|
|
27
34
|
|
|
28
35
|
float shadowExcludingHighlightFactor = readShadowMapUVZ(uvzShadow, shadowMapExcludingHighlight);
|
|
29
36
|
|
|
30
37
|
vec3 normal = normalFromDepth(depthMap, currentPixelPos.xyz, gl_FragCoord.xy, uv);
|
|
31
|
-
bool shaded = dot(normal, lightingMainDirectionView) < ${
|
|
38
|
+
bool shaded = dot(normal, lightingMainDirectionView) < ${d.float(w)};
|
|
32
39
|
|
|
33
40
|
float occludedFactor = max(shadowExcludingHighlightFactor, shaded ? 1.0 : 0.0);
|
|
34
41
|
float fragOpacity = mix(opacity, occludedOpacity, occludedFactor);
|
|
35
42
|
fragColor = vec4(uColor.rgb, uColor.a * fragOpacity * terminationFactor);
|
|
36
|
-
`),
|
|
43
|
+
`),p}const f=r(),v=Object.freeze(Object.defineProperty({__proto__:null,build:p},Symbol.toStringTag,{value:"Module"}));export{v as S,p as b};
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.
|
|
2
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.59";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
package/geometry/Mesh.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import r from"../core/Error.js";import{LoadableMixin as o}from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{throwIfAborted as i,whenOrAbort as a}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as c,subclass as l}from"../core/accessorSupport/decorators.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{create as d,fromBuffer as g,zero as x}from"./support/aaBoundingBox.js";import{composeAxes as y,create as v}from"./support/axisAngleDegrees.js";import j from"./support/MeshComponent.js";import{componentNotFoundMessage as w,meshNotLoadedMessage as S,invalidLocationMessage as b,invalidPolygonMessage as L,InvalidLocationError as A}from"./support/meshErrors.js";import C from"./support/MeshGeoreferencedVertexSpace.js";import M from"./support/MeshLocalVertexSpace.js";import U from"./support/MeshTransform.js";import R from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as F,selectVertexSpace as P}from"./support/meshVertexSpaceUtils.js";import{triangulate as E}from"./support/
|
|
2
|
+
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import r from"../core/Error.js";import{LoadableMixin as o}from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{throwIfAborted as i,whenOrAbort as a}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as c,subclass as l}from"../core/accessorSupport/decorators.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{create as d,fromBuffer as g,zero as x}from"./support/aaBoundingBox.js";import{composeAxes as y,create as v}from"./support/axisAngleDegrees.js";import j from"./support/MeshComponent.js";import{componentNotFoundMessage as w,meshNotLoadedMessage as S,invalidLocationMessage as b,invalidPolygonMessage as L,InvalidLocationError as A}from"./support/meshErrors.js";import C from"./support/MeshGeoreferencedVertexSpace.js";import M from"./support/MeshLocalVertexSpace.js";import U from"./support/MeshTransform.js";import R from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as F,selectVertexSpace as P}from"./support/meshVertexSpaceUtils.js";import{triangulate as E}from"./support/triangulationUtilsDeprecated.js";import{centerAt as B}from"./support/meshUtils/centerAt.js";import{computeMeshExtent as G}from"./support/meshUtils/extent.js";import{loadExternal as k}from"./support/meshUtils/loadExternal.js";import{addMeshMaterialCloneContext as I,addMeshTextureCloneContext as T,getMeshCloneContext as O}from"./support/meshUtils/meshCloneUtils.js";import{Metadata as z}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as D,createUnitSizeBox as V,extractSingleFaceOfBox as N,createUnitSizeSphere as Z,createUnitSizeCylinder as H,convertPlaneSizeParameter as K,createUnitSizePlane as W}from"./support/meshUtils/primitives.js";import{rotate as q}from"./support/meshUtils/rotate.js";import{scale as J}from"./support/meshUtils/scale.js";var Q;const X={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:C,local:M}};let Y=Q=class extends(t(o(n(h)))){constructor(e){super(e),this.components=null,this.vertexSpace=new C,this.transform=null,this.metadata=new z,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new R,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles(p(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,r=this;return G({get transform(){return r.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?d(x):g(e)}get origin(){const e=_(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(j.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}s.getLogger(this).error("removeComponent()",w)}}rotate(e,t,r,o){return y(e,t,r,$),q(this,$,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(F(o)){const[s,n,i]=o.origin;o.origin=m(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(J(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(B(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(k(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(e){return super.clone(I(T(e)))}cloneShallow(){return new Q({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([import("./support/meshUtils/exporters/gltf/gltfexport.js"),this.load(e)]);return i(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce((e,t)=>e+t.memoryUsage,this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(s.getLogger(this).error(e,S),!1)}static createBox(e,t){if(!(e instanceof u))return s.getLogger(this.prototype).error(".createBox()",b),null;const r=new Q(D(V(),e,t));return t?.imageFace&&"all"!==t.imageFace?N(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new Q(D(Z(t?.densificationFactor||0),e,t)):(s.getLogger(this.prototype).error(".createSphere()",b),null)}static createCylinder(e,t){return e instanceof u?new Q(D(H(t?.densificationFactor||0),e,t)):(s.getLogger(this.prototype).error(".createCylinder()",b),null)}static createPlane(e,t){if(!(e instanceof u))return s.getLogger(this.prototype).error(".createPlane()",b),null;const r=t?.facing??"up",o=K(r,t?.size);return new Q(D(W(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof f))return s.getLogger(this.prototype).error(".createFromPolygon()",L),null;const r=E(e);return new Q({vertexAttributes:new R({position:r.position}),components:[new j({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new C})}static async createFromGLTF(e,t,r){if(!(e instanceof u)){const e=new A;throw s.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:o}=await a(import("./support/meshUtils/loadGLTFMesh.js"),r);return new Q((await o(e,t,r)).mesh)}static createWithExternalSource(e,t,r){const o=r?.extent??null,{spatialReference:s}=e,n=r?.transform?.clone()??new U,i=P(e,r),a=r?.unitConversionDisabled,p={source:t,extent:o,unitConversionDisabled:a},c=new z;return c.externalSources.push(p),new Q({metadata:c,transform:n,vertexSpace:i,spatialReference:s})}static createIncomplete(e,t){const{spatialReference:o}=e,s=t?.transform?.clone()??new U,n=P(e,t),i=new Q({transform:s,vertexSpace:n,spatialReference:o});return i.addResolvingPromise(Promise.reject(new r("mesh-incomplete","Mesh resources are not complete"))),i}};e([c({type:[j],json:{write:!0}})],Y.prototype,"components",void 0),e([c({nonNullable:!0,types:X,constructOnly:!0,json:{write:!0},clonable:(e,t)=>O(t)?.vertexSpace??e.clone(t)})],Y.prototype,"vertexSpace",void 0),e([c({type:U,clonable:(e,t)=>{const r=O(t);return r&&"transform"in r?r.transform:e?.clone()??e},json:{write:!0}})],Y.prototype,"transform",void 0),e([c({constructOnly:!0,type:z,clonable:(e,t)=>O(t)?.metadata??e.clone()})],Y.prototype,"metadata",void 0),e([c()],Y.prototype,"hasExtent",null),e([c()],Y.prototype,"_transformedExtent",null),e([c()],Y.prototype,"_untransformedBounds",null),e([c()],Y.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],Y.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Y.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Y.prototype,"hasM",void 0),e([c({type:R,nonNullable:!0,json:{write:!0},clonable:(e,t)=>O(t)?.vertexAttributes??e.clone(t)})],Y.prototype,"vertexAttributes",void 0),Y=Q=e([l("esri.geometry.Mesh")],Y);const $=v();export{Y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{deg2rad as r}from"../../core/mathUtils.js";import{getMetersPerUnitForSR as t,getMetersPerVerticalUnitForSR as o}from"../../core/units.js";import{set as s}from"../../core/libs/gl-matrix-2/math/vec3.js";import{getNormal as a,fromManyPoints as i,create as m}from"./plane.js";function n(t,o,s){const i=c(e,t,o,s)?a(e):[0,0,1];return Math.abs(i[2])>Math.cos(r(80))?2:Math.abs(i[1])>Math.abs(i[0])?1:0}function c(r,a,m,n){const c=(r=>!Array.isArray(r[0]))(a)?(r,t)=>a[3*r+t]:(r,t)=>a[r][t],e=
|
|
2
|
+
import{deg2rad as r}from"../../core/mathUtils.js";import{getMetersPerUnitForSR as t,getMetersPerVerticalUnitForSR as o}from"../../core/units.js";import{set as s}from"../../core/libs/gl-matrix-2/math/vec3.js";import{getNormal as a,fromManyPoints as i,create as m}from"./plane.js";function n(t,o,s){const i=c(e,t,o,s)?a(e):[0,0,1];return Math.abs(i[2])>Math.cos(r(80))?2:Math.abs(i[1])>Math.abs(i[0])?1:0}function c(r,a,m,n){const c=(r=>!Array.isArray(r[0]))(a)?(r,t)=>a[3*r+t]:(r,t)=>a[r][t],e=t(n)/o(n);return i(r,(r,t)=>s(r,c(t,0)*e,c(t,1)*e,c(t,2)),m)}const e=m();export{c as fitPlane,n as leastSignificantAxis};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{e as n}from"../../chunks/earcut.js";import{isClockwise as t}from"./coordsUtils.js";import{doubleSubArray as e,doubleArrayFrom as o,newDoubleArray as r}from"./DoubleArray.js";import{compactMeshIndices as s}from"./Indices.js";import{leastSignificantAxis as i}from"./polygonUtils.js";import{deduplicate as l}from"./meshUtils/deduplicate.js";function c(t){const r=f(t.rings,t.hasZ,1,t.spatialReference),i=new Array;let c=0,a=0;for(const o of r.polygons){const t=o.count,l=o.index,h=e(r.position,3*l,3*t),f=o.holeIndices.map(n=>n-l),g=s(n(h,f,3));i.push({position:h,faces:g}),c+=h.length,a+=g.length}const g=h(i,c,a),u=Array.isArray(g.position)?l(g.position,3,{originalIndices:g.faces}):l(g.position.buffer,6,{originalIndices:g.faces});return g.position=o(new Float64Array(u.buffer)),g.faces=u.indices,g}function h(n,t,e){if(1===n.length)return n[0];const o=r(t),i=new Array(e);let l=0,c=0,h=0;for(const r of n){for(let n=0;n<r.position.length;n++)o[l++]=r.position[n];for(const n of r.faces)i[c++]=n+h;h=l/3}return{position:o,faces:s(i)}}function f(n,t,e,o){const s=n.length,i=new Array(s),l=new Array(s),c=new Array(s),h=n.reduce((n,t)=>n+t.length,0);let f=0,u=0,p=0;const d=r(3*h);let m=0;for(let r=s-1;r>=0;r--){const h=n[r],y=1===e&&g(h,t,o);if(y&&1!==s)i[f++]=h;else{let n=h.length;for(let t=0;t<f;++t)n+=i[t].length;const e={index:m,pathLengths:new Array(f+1),count:n,holeIndices:new Array(f)};e.pathLengths[0]=h.length,h.length>0&&(c[p++]={index:m,count:h.length}),m=y?a(h,h.length-1,-1,d,m,h.length,t):a(h,0,1,d,m,h.length,t);for(let o=0;o<f;++o){const n=i[o];e.holeIndices[o]=m,e.pathLengths[o+1]=n.length,n.length>0&&(c[p++]={index:m,count:n.length}),m=a(n,0,1,d,m,n.length,t)}f=0,e.count>0&&(l[u++]=e)}}for(let r=0;r<f;++r){const n=i[r];n.length>0&&(c[p++]={index:m,count:n.length}),m=a(n,0,1,d,m,n.length,t)}return l.length=u,c.length=p,{position:d,polygons:l,outlines:c}}function a(n,t,e,o,r,s,i){r*=3;for(let l=0;l<s;++l){const s=n[t];o[r++]=s[0],o[r++]=s[1],o[r++]=i&&s[2]?s[2]:0,t+=e}return r/3}function g(n,e,o){if(!e)return!t(n);const r=n.length-1;switch(i(n,r,o)){case 0:return!t(n,1,2);case 1:return!t(n,0,2);case 2:return!t(n,0,1)}}export{
|
|
2
|
+
import{e as n}from"../../chunks/earcut.js";import{isClockwise as t}from"./coordsUtils.js";import{doubleSubArray as e,doubleArrayFrom as o,newDoubleArray as r}from"./DoubleArray.js";import{compactMeshIndices as s}from"./Indices.js";import{leastSignificantAxis as i}from"./polygonUtils.js";import{deduplicate as l}from"./meshUtils/deduplicate.js";function c(t){const r=f(t.rings,t.hasZ,1,t.spatialReference),i=new Array;let c=0,a=0;for(const o of r.polygons){const t=o.count,l=o.index,h=e(r.position,3*l,3*t),f=o.holeIndices.map(n=>n-l),g=s(n(h,f,3));i.push({position:h,faces:g}),c+=h.length,a+=g.length}const g=h(i,c,a),u=Array.isArray(g.position)?l(g.position,3,{originalIndices:g.faces}):l(g.position.buffer,6,{originalIndices:g.faces});return g.position=o(new Float64Array(u.buffer)),g.faces=u.indices,g}function h(n,t,e){if(1===n.length)return n[0];const o=r(t),i=new Array(e);let l=0,c=0,h=0;for(const r of n){for(let n=0;n<r.position.length;n++)o[l++]=r.position[n];for(const n of r.faces)i[c++]=n+h;h=l/3}return{position:o,faces:s(i)}}function f(n,t,e,o){const s=n.length,i=new Array(s),l=new Array(s),c=new Array(s),h=n.reduce((n,t)=>n+t.length,0);let f=0,u=0,p=0;const d=r(3*h);let m=0;for(let r=s-1;r>=0;r--){const h=n[r],y=1===e&&g(h,t,o);if(y&&1!==s)i[f++]=h;else{let n=h.length;for(let t=0;t<f;++t)n+=i[t].length;const e={index:m,pathLengths:new Array(f+1),count:n,holeIndices:new Array(f)};e.pathLengths[0]=h.length,h.length>0&&(c[p++]={index:m,count:h.length}),m=y?a(h,h.length-1,-1,d,m,h.length,t):a(h,0,1,d,m,h.length,t);for(let o=0;o<f;++o){const n=i[o];e.holeIndices[o]=m,e.pathLengths[o+1]=n.length,n.length>0&&(c[p++]={index:m,count:n.length}),m=a(n,0,1,d,m,n.length,t)}f=0,e.count>0&&(l[u++]=e)}}for(let r=0;r<f;++r){const n=i[r];n.length>0&&(c[p++]={index:m,count:n.length}),m=a(n,0,1,d,m,n.length,t)}return l.length=u,c.length=p,{position:d,polygons:l,outlines:c}}function a(n,t,e,o,r,s,i){r*=3;for(let l=0;l<s;++l){const s=n[t];o[r++]=s[0],o[r++]=s[1],o[r++]=i&&s[2]?s[2]:0,t+=e}return r/3}function g(n,e,o){if(!e)return!t(n);const r=n.length-1;switch(i(n,r,o)){case 0:return!t(n,1,2);case 1:return!t(n,0,2);case 2:return!t(n,0,1)}}export{f as ringsToTriangulationInfo,c as triangulate};
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.
|
|
2
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.59",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Warning.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";import{persistable as a}from"../../core/accessorSupport/decorators/persistable.js";import c from"../../geometry/Polygon.js";import{canProjectWithoutEngine as n,projectPolygon as p}from"../../geometry/projectionUtils.js";import{isInitialized as l,switchMeshModificationPolygonVCSSync as m}from"../../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as f,fromWasmModification as y}from"../../views/3d/layers/SceneLayerWorkerHandle.js";import{writer as d}from"../../core/accessorSupport/decorators/writer.js";var u;let g=u=class extends t{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,i){if(i.layer?.spatialReference&&115700===i.layer?.spatialReference.vcsWkid)this._write3DTilesModificationGeometry(e,t,r,i);else if(i.layer?.spatialReference&&!i.layer.spatialReference.equals(this.geometry.spatialReference)){if(!n(e.spatialReference,i.layer.spatialReference))return void(i?.messages&&i.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:i.layer.spatialReference,context:i})));const s=new c;p(e,s,i.layer.spatialReference),t[r]=s.toJSON(i)}else t[r]=e.toJSON(i)}_write3DTilesModificationGeometry(e,t,r,i){if(i.layer?.spatialReference&&115700===i.layer?.spatialReference.vcsWkid){let e=!0;if(l()){const o=f(null,[this],i.layer?.spatialReference);if(o.length>1){const s=m({modifications:o,inVCS:5773});if(s.success&&s.modifications){const o=[this.clone()];y(s.modifications,o),1===o.length&&o[0].geometry&&(t[r]=o[0].geometry.toJSON(i),e=!1)}}}e&&i?.messages&&i.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:i.layer.spatialReference,context:i}))}}clone(){return new u({geometry:r(this.geometry),type:this.type})}};e([i({type:c}),a()],g.prototype,"geometry",void 0),e([d(["web-scene","portal-item"],"geometry")],g.prototype,"writeGeometry",null),e([i({type:["clip","mask","replace"],nonNullable:!0}),a()],g.prototype,"type",void 0),g=u=e([s("esri.layers.support.SceneModification")],g);export{g as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Warning.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";import{persistable as a}from"../../core/accessorSupport/decorators/persistable.js";import c from"../../geometry/Polygon.js";import{canProjectWithoutEngine as n,projectPolygon as p}from"../../geometry/projectionUtils.js";import{isInitialized as l,switchMeshModificationPolygonVCSSync as m}from"../../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as f,fromWasmModification as y}from"../../views/3d/layers/SceneLayerWorkerHandle.js";import{writer as d}from"../../core/accessorSupport/decorators/writer.js";var u;let g=u=class extends t{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,i){if(i.layer?.spatialReference&&115700===i.layer?.spatialReference.vcsWkid)this._write3DTilesModificationGeometry(e,t,r,i);else if(i.layer?.spatialReference&&!i.layer.spatialReference.equals(this.geometry.spatialReference)){if(!n(e.spatialReference,i.layer.spatialReference))return void(i?.messages&&i.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:i.layer.spatialReference,context:i})));const s=new c;p(e,s,i.layer.spatialReference),t[r]=s.toJSON(i)}else t[r]=e.toJSON(i)}_write3DTilesModificationGeometry(e,t,r,i){if(i.layer?.spatialReference&&115700===i.layer?.spatialReference.vcsWkid){let e=!0;if(l()){const o=f(null,[this],i.layer?.spatialReference);if(o.length>1){const s=m({modifications:o,inVCS:5773});if(s.success&&s.modifications){const o=[this.clone()];y(s.modifications,o),1===o.length&&o[0].geometry&&(o[0].geometry.spatialReference=i.layer?.spatialReference,t[r]=o[0].geometry.toJSON(i),e=!1)}}}e&&i?.messages&&i.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:i.layer.spatialReference,context:i}))}}clone(){return new u({geometry:r(this.geometry),type:this.type})}};e([i({type:c}),a()],g.prototype,"geometry",void 0),e([d(["web-scene","portal-item"],"geometry")],g.prototype,"writeGeometry",null),e([i({type:["clip","mask","replace"],nonNullable:!0}),a()],g.prototype,"type",void 0),g=u=e([s("esri.layers.support.SceneModification")],g);export{g as default};
|
|
@@ -630,6 +630,12 @@ export interface OutputConditionJSON {
|
|
|
630
630
|
* @since 5.0
|
|
631
631
|
*/
|
|
632
632
|
export interface FunctionJSON {
|
|
633
|
+
/**
|
|
634
|
+
* An alias to describe and provide context for the function output.
|
|
635
|
+
*
|
|
636
|
+
* @since 5.1
|
|
637
|
+
*/
|
|
638
|
+
functionName?: string | null;
|
|
633
639
|
/**
|
|
634
640
|
* The type of function used for the calculation.
|
|
635
641
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.59",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@amcharts/amcharts5": "~5.16.2",
|
|
22
|
-
"@arcgis/toolkit": "^5.1.0-next.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.60",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.0.2",
|
|
25
25
|
"@vaadin/grid": "~25.1.0",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONMap as s}from"../core/jsonMap.js";import{clone as t}from"../core/lang.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as s}from"../core/jsonMap.js";import{clone as t}from"../core/lang.js";import o from"../core/Logger.js";import{property as i,cast as r,subclass as l}from"../core/accessorSupport/decorators.js";import{ensureString as a,ensureType as n}from"../core/accessorSupport/ensureType.js";import{collectArcadeFieldNames as u,collectField as p}from"../layers/support/fieldUtils.js";import c from"./Renderer.js";import{VisualVariablesMixin as m}from"./mixins/VisualVariablesMixin.js";import d from"./support/ClassBreakInfo.js";import{rendererBackgroundFillSymbolProperty as f,rendererSymbolProperty as h}from"./support/commonProperties.js";import y from"./support/RendererLegendOptions.js";import{loadArcade as g}from"../support/loadArcade.js";import{ensureType as x}from"../symbols/support/typeUtils.js";import{reader as k}from"../core/accessorSupport/decorators/reader.js";import{writer as I}from"../core/accessorSupport/decorators/writer.js";import{enumeration as b}from"../core/accessorSupport/decorators/enumeration.js";var v;const B="log",V="percent-of-total",F="field",E=new s({esriNormalizeByLog:B,esriNormalizeByPercentOfTotal:V,esriNormalizeByField:F}),w=n(d);let S=v=class extends(m(c)){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,s,t){if(!Array.isArray(e))return;let o=s.minValue;return e.map(e=>{const s=new d;return s.read(e,t),null==s.minValue&&(s.minValue=o),null==s.maxValue&&(s.maxValue=s.minValue),o=s.maxValue,s})}writeClassBreakInfos(e,s,t,o){const i=e.map(e=>e.write({},o));this._areClassBreaksConsecutive()&&i.forEach(e=>delete e.classMinValue),s[t]=i}castField(e){return null==e?e:"function"==typeof e?(o.getLogger(this).error(".field: field must be a string value"),null):a(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const s=!!this.normalizationField,t=null!=this.normalizationTotal;return s||t?(e=s&&F||t&&V||null,s&&t&&o.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==F&&e!==V||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,s,o){let i=null;i="number"==typeof e?new d({minValue:e,maxValue:s,symbol:x(o)}):w(t(e)),this.classBreakInfos.push(i),1===this.classBreakInfos.length&&this.notifyChange("minValue")}removeClassBreakInfo(e,s){const t=this.classBreakInfos.length;for(let o=0;o<t;o++){const t=[this.classBreakInfos[o].minValue,this.classBreakInfos[o].maxValue];if(t[0]===e&&t[1]===s){this.classBreakInfos.splice(o,1);break}}}getBreakIndex(e,s){return this.valueExpression&&null==s?.arcade&&o.getLogger(this).warn(""),this.valueExpression?this._getBreakIndexForExpression(e,s):this._getBreakIndexForField(e)}async getClassBreakInfo(e,s){let t=s;this.valueExpression&&null==s?.arcade&&(t={...t,arcade:await g()});const o=this.getBreakIndex(e,t);return-1!==o?this.classBreakInfos[o]:null}getSymbol(e,s){if(this.valueExpression&&null==s?.arcade)return void o.getLogger(this).error("#getSymbol()","Please use getSymbolAsync if valueExpression is used");const t=this.getBreakIndex(e,s);return t>-1?this.classBreakInfos[t].symbol:this.defaultSymbol}async getSymbolAsync(e,s){let t=s;if(this.valueExpression&&null==s?.arcade){const e=await g(),{arcadeUtils:s}=e;s.hasGeometryOperations(this.valueExpression)&&await s.enableGeometryOperations(),t={...t,arcade:e}}const o=this.getBreakIndex(e,t);return o>-1?this.classBreakInfos[o].symbol:this.defaultSymbol}get symbols(){const e=[];return this.classBreakInfos.forEach(s=>{s.symbol&&e.push(s.symbol),e.push(...s.alternateSymbols??[])}),this.defaultSymbol&&e.push(this.defaultSymbol),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new v({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:t(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:t(this.visualVariables),legendOptions:t(this.legendOptions),authoringInfo:t(this.authoringInfo)})}async collectRequiredFields(e,s){const t=[this.collectVVRequiredFields(e,s),this.collectSymbolFields(e,s)];await Promise.all(t)}async collectSymbolFields(e,s){const t=[...this.symbols.map(t=>t.collectRequiredFields(e,s)),u(e,s,null,this.valueExpression)];p(e,s,this.field),p(e,s,this.normalizationField),await Promise.all(t)}_getBreakIndexForExpression(e,s){const{viewingMode:t,scale:o,spatialReference:i,arcade:r,timeZone:l}=s??{},{valueExpression:a}=this;let n=this._compiledValueExpression.valueExpression===a?this._compiledValueExpression.compiledFunction:null;const u=r.arcadeUtils;if(!n){const e=u.createSyntaxTree(a);n=u.createFunction(e),this._compiledValueExpression.compiledFunction=n}this._compiledValueExpression.valueExpression=a;const p=u.executeFunction(n,u.createExecContext(e,u.getViewInfo({viewingMode:t,scale:o,spatialReference:i}),l));return this._getBreakIndexfromInfos(p)}_getBreakIndexForField(e){const s=this.field,t=e.attributes,o=this.normalizationType;let i=parseFloat(t[s]);if(o){const e=this.normalizationTotal,s=parseFloat(this.normalizationField?t[this.normalizationField]:void 0);if(o===B)i=Math.log(i)*Math.LOG10E;else if(o!==V||null==e||isNaN(e)){if(o===F&&!isNaN(s)){if(isNaN(i)||isNaN(s))return-1;i/=s}}else i=i/e*100}return this._getBreakIndexfromInfos(i)}_getBreakIndexfromInfos(e){const s=this.isMaxInclusive;if(null!=e&&"number"==typeof e&&!isNaN(e))for(let t=0;t<this.classBreakInfos.length;t++){const o=[this.classBreakInfos[t].minValue,this.classBreakInfos[t].maxValue];if(o[0]<=e&&(s?e<=o[1]:e<o[1]))return t}return-1}_areClassBreaksConsecutive(){const e=this.classBreakInfos,s=e.length;for(let t=1;t<s;t++)if(e[t-1].maxValue!==e[t].minValue)return!1;return!0}};e([i(f)],S.prototype,"backgroundFillSymbol",void 0),e([i({type:[d],json:{write:{isRequired:!0}}})],S.prototype,"classBreakInfos",void 0),e([k("classBreakInfos")],S.prototype,"readClassBreakInfos",null),e([I("classBreakInfos")],S.prototype,"writeClassBreakInfos",null),e([i({type:String,json:{write:!0}})],S.prototype,"defaultLabel",void 0),e([i(h)],S.prototype,"defaultSymbol",void 0),e([i({type:String,json:{write:!0}})],S.prototype,"field",void 0),e([r("field")],S.prototype,"castField",null),e([i({type:Boolean})],S.prototype,"isMaxInclusive",void 0),e([i({type:y,json:{write:!0}})],S.prototype,"legendOptions",void 0),e([i({type:Number,readOnly:!0,value:null,json:{read:!1,write:{overridePolicy(){return 0!==this.classBreakInfos.length&&this._areClassBreaksConsecutive()?{enabled:!0}:{enabled:!1}}}}})],S.prototype,"minValue",null),e([i({type:String,json:{write:!0}})],S.prototype,"normalizationField",void 0),e([i({type:Number,json:{write:!0}})],S.prototype,"normalizationTotal",void 0),e([i({type:E.apiValues,value:null,json:{type:E.jsonValues,read:E.read,write:E.write}})],S.prototype,"normalizationType",null),e([b({classBreaks:"class-breaks"})],S.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],S.prototype,"valueExpression",void 0),e([i({type:String,json:{write:!0}})],S.prototype,"valueExpressionTitle",void 0),S=v=e([l("esri.renderers.ClassBreaksRenderer")],S);export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import{clone as s}from"../core/lang.js";import{property as i,subclass as r}from"../core/accessorSupport/decorators.js";import{collectArcadeFieldNames as o}from"../layers/support/fieldUtils.js";import l from"./Renderer.js";import{VisualVariablesMixin as n}from"./mixins/VisualVariablesMixin.js";import{DictionaryLoader as a}from"./support/DictionaryLoader.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";var p;let c=p=class extends(n(l)){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this._styleName=null,this._styleVersion=null,this._styleSymbolFields=null,this._styleTextFields=null,this._styleConfigProperties=null,this._styleUISchema=null,this.type="dictionary"}get _loader(){const e=this.getDictionaryInfo();return e.then(e=>{this._styleName=e.dictionary_name,this._styleVersion=e.dictionary_version,this._styleConfigProperties=e.authoringInfo.configuration,this._styleSymbolFields=e.authoringInfo.symbol,this._styleTextFields=e.authoringInfo.text,this._styleUISchema=e.dictionary_ui_schema?JSON.parse(e.dictionary_ui_schema):null}),new a(this.url,this.config,this.fieldMap??{},e)}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}get styleName(){return this._styleName}get styleVersion(){return this._styleVersion}get styleSymbolFields(){return this._styleSymbolFields}get styleTextFields(){return this._styleTextFields}get styleConfigProperties(){return this._styleConfigProperties}get styleUISchema(){return this._styleUISchema}writeVisualVariables(e,t,s,i){i?.origin||super.writeVisualVariables(e,t,s,i)}clone(){return new p({config:s(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:s(this.fieldMap),url:s(this.url),visualVariables:s(this.visualVariables)})}async getSymbolAsync(e,t,s=!0){return this._loader.getSymbolAsync(e,t,s)}async getSymbolForControlString(e,t,s){return this._loader.getSymbolForControlString(e,t,s)}getDictionaryInfo(){return this._dictionaryInfoPromise||(this._dictionaryInfoPromise=this._fetchDictionaryInfo()),this._dictionaryInfoPromise}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await o(e,t,null,this.scaleExpression);for(const s in this.fieldMap){const i=this.fieldMap[s];t.has(i)&&e.add(i)}}get arcadeRequired(){return!0}getSymbol(){return null}get symbols(){return[]}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import{clone as s}from"../core/lang.js";import{property as i,subclass as r}from"../core/accessorSupport/decorators.js";import{collectArcadeFieldNames as o}from"../layers/support/fieldUtils.js";import l from"./Renderer.js";import{VisualVariablesMixin as n}from"./mixins/VisualVariablesMixin.js";import{DictionaryLoader as a}from"./support/DictionaryLoader.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";var p;let c=p=class extends(n(l)){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this._styleName=null,this._styleVersion=null,this._styleSymbolFields=null,this._styleTextFields=null,this._styleConfigProperties=null,this._styleUISchema=null,this.type="dictionary"}get _loader(){const e=this.getDictionaryInfo();return e.then(e=>{this._styleName=e.dictionary_name,this._styleVersion=e.dictionary_version,this._styleConfigProperties=e.authoringInfo.configuration,this._styleSymbolFields=e.authoringInfo.symbol,this._styleTextFields=e.authoringInfo.text,this._styleUISchema=e.dictionary_ui_schema?JSON.parse(e.dictionary_ui_schema):null}),new a(this.url,this.config,this.fieldMap??{},e)}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}get styleName(){return this._styleName}get styleVersion(){return this._styleVersion}get styleSymbolFields(){return this._styleSymbolFields}get styleTextFields(){return this._styleTextFields}get styleConfigProperties(){return this._styleConfigProperties}get styleUISchema(){return this._styleUISchema}writeVisualVariables(e,t,s,i){i?.origin||super.writeVisualVariables(e,t,s,i)}clone(){return new p({config:s(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:s(this.fieldMap),url:s(this.url),visualVariables:s(this.visualVariables)})}async getSymbolAsync(e,t,s=!0){return this._loader.getSymbolAsync(e,t,s)}async getSymbolForControlString(e,t,s){return this._loader.getSymbolForControlString(e,t,s)}getDictionaryInfo(){return this._dictionaryInfoPromise||(this._dictionaryInfoPromise=this._fetchDictionaryInfo()),this._dictionaryInfoPromise}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await o(e,t,null,this.scaleExpression);for(const s in this.fieldMap){const i=this.fieldMap[s];t.has(i)&&e.add(i)}}get arcadeRequired(){return!0}getSymbol(){return null}get symbols(){return[]}async _fetchDictionaryInfo(){const{data:e}=await t(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"}});return e}};e([i({type:a})],c.prototype,"_loader",null),e([i({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],c.prototype,"config",void 0),e([i({type:Object,json:{write:!0}})],c.prototype,"fieldMap",void 0),e([i({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],c.prototype,"scaleExpression",void 0),e([y("scaleExpression")],c.prototype,"writeData",null),e([i({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],c.prototype,"scaleExpressionTitle",void 0),e([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),e([i({type:String})],c.prototype,"styleName",null),e([i({type:String})],c.prototype,"styleVersion",null),e([i({type:[String]})],c.prototype,"styleSymbolFields",null),e([i({type:[String]})],c.prototype,"styleTextFields",null),e([i({type:[Object]})],c.prototype,"styleConfigProperties",null),e([i({type:Object})],c.prototype,"styleUISchema",null),e([y("visualVariables")],c.prototype,"writeVisualVariables",null),c=p=e([r("esri.renderers.DictionaryRenderer")],c);export{c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{clone as o}from"../core/lang.js";import{property as i,subclass as r}from"../core/accessorSupport/decorators.js";import{collectArcadeFieldNames as s}from"../layers/support/fieldUtils.js";import l from"./Renderer.js";import{VisualVariablesMixin as n}from"./mixins/VisualVariablesMixin.js";import a from"./support/AttributeColorInfo.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{clone as o}from"../core/lang.js";import{property as i,subclass as r}from"../core/accessorSupport/decorators.js";import{collectArcadeFieldNames as s}from"../layers/support/fieldUtils.js";import l from"./Renderer.js";import{VisualVariablesMixin as n}from"./mixins/VisualVariablesMixin.js";import a from"./support/AttributeColorInfo.js";import p from"./support/DotDensityLegendOptions.js";import d from"../symbols/SimpleFillSymbol.js";import u from"../symbols/SimpleLineSymbol.js";import{enumeration as h}from"../core/accessorSupport/decorators/enumeration.js";var m;let y=m=class extends(n(l)){constructor(e){super(e),this.attributes=null,this.backgroundColor=new t([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new u,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(null==this.referenceScale)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new d({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}get symbols(){return[this.getSymbol()]}get visualVariables(){return super.visualVariables}set visualVariables(e){super.visualVariables=e}clone(){return new m({attributes:o(this.attributes),backgroundColor:o(this.backgroundColor),dotBlendingEnabled:o(this.dotBlendingEnabled),dotShape:o(this.dotShape),dotSize:o(this.dotSize),dotValue:o(this.dotValue),legendOptions:o(this.legendOptions),outline:o(this.outline),referenceScale:o(this.referenceScale),seed:o(this.seed),visualVariables:o(this.visualVariables),authoringInfo:o(this.authoringInfo)})}getControllerHash(){const e=this.attributes?.map(e=>e.field||e.valueExpression||"");return`${e}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const o of this.attributes??[])o.valueExpression&&await s(e,t,null,o.valueExpression),o.field&&e.add(o.field)}};e([i({type:[a],json:{write:!0}})],y.prototype,"attributes",void 0),e([i({type:t,json:{write:!0}})],y.prototype,"backgroundColor",void 0),e([i({type:Boolean,json:{write:!0}})],y.prototype,"dotBlendingEnabled",void 0),e([i({type:String,json:{write:!1}})],y.prototype,"dotShape",void 0),e([i({type:Number,json:{write:!0}})],y.prototype,"dotSize",void 0),e([i({type:p,json:{write:!0}})],y.prototype,"legendOptions",void 0),e([i({type:u,json:{default:null,write:!0}})],y.prototype,"outline",void 0),e([i({type:Number,json:{write:!0}})],y.prototype,"dotValue",void 0),e([i({type:Number,json:{write:!0}})],y.prototype,"referenceScale",void 0),e([i({type:Number,json:{write:!0}})],y.prototype,"seed",void 0),e([h({dotDensity:"dot-density"})],y.prototype,"type",void 0),y=m=e([r("esri.renderers.DotDensityRenderer")],y);export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../Color.js";import{clone as i}from"../core/lang.js";import{toPt as s}from"../core/screenUtils.js";import{property as r,subclass as n}from"../core/accessorSupport/decorators.js";import{collectField as o,collectArcadeFieldNames as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../Color.js";import{clone as i}from"../core/lang.js";import{toPt as s}from"../core/screenUtils.js";import{property as r,subclass as n}from"../core/accessorSupport/decorators.js";import{collectField as o,collectArcadeFieldNames as p}from"../layers/support/fieldUtils.js";import l from"./Renderer.js";import a from"./support/AuthoringInfo.js";import u from"./support/HeatmapColorStop.js";import y from"./support/HeatmapLegendOptions.js";import{kernelDensityRadiusPtToGaussianBlurRadiusPx as m,gaussianBlurRadiusPxToKernelDensityRadiusPt as h,magicKernelDensityRadiusInflationFactor as d}from"./support/heatmapUtils.js";import c from"../symbols/SimpleMarkerSymbol.js";import{enumeration as x}from"../core/accessorSupport/decorators/enumeration.js";var g;function f(t){if(null!=t){const{maxDensity:e,minDensity:i,radius:s}=t;if(null!=e||null!=i||null!=s){const{blurRadius:e,maxPixelIntensity:i,minPixelIntensity:s,...r}=t;return r}}return t}let w=g=class extends l{constructor(t){super(t),this.authoringInfo=null,this.colorStops=[new u({ratio:0,color:new e("rgba(255, 140, 0, 0)")}),new u({ratio:.75,color:new e("rgba(255, 140, 0, 1)")}),new u({ratio:.9,color:new e("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null}normalizeCtorArgs(t){return f(t)}get blurRadius(){return m(this.radius)}set blurRadius(t){const e=this.maxPixelIntensity,i=this.minPixelIntensity;this._set("radius",h(t)),this._set("maxDensity",e*this._pixelIntensityToDensity),this._set("minDensity",i*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(t){this._set("maxDensity",t*this._pixelIntensityToDensity)}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(t){this._set("minDensity",t*this._pixelIntensityToDensity)}get radius(){return this._get("radius")??18}set radius(t){this._set("radius",t)}get _pixelIntensityToDensity(){return 24/(d**2*this.blurRadius**4)}read(t,e){t=f(t),super.read(t,e)}getSymbol(){return new c}async getSymbolAsync(){return this.getSymbol()}get symbols(){return[this.getSymbol()]}async collectRequiredFields(t,e){const i=this.field,s=this.valueExpression;i&&"string"==typeof i&&o(t,e,i),s&&"string"==typeof s&&await p(t,e,null,s)}clone(){return new g({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:i(this.colorStops),field:this.field,legendOptions:i(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([r({type:a,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],w.prototype,"authoringInfo",void 0),t([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],w.prototype,"blurRadius",null),t([r({type:[u],json:{write:{isRequired:!0}}})],w.prototype,"colorStops",void 0),t([r({type:String,json:{write:!0}})],w.prototype,"field",void 0),t([r({type:y,json:{write:!0}})],w.prototype,"legendOptions",void 0),t([r({type:Number,json:{write:!0}})],w.prototype,"maxDensity",void 0),t([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],w.prototype,"maxPixelIntensity",null),t([r({type:Number,json:{write:!0}})],w.prototype,"minDensity",void 0),t([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],w.prototype,"minPixelIntensity",null),t([r({type:Number,cast:s,json:{write:!0}})],w.prototype,"radius",null),t([r({type:Number,range:{min:0},json:{default:0,write:!0}})],w.prototype,"referenceScale",void 0),t([x({heatmap:"heatmap"})],w.prototype,"type",void 0),t([r({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],w.prototype,"valueExpression",void 0),t([r({type:String})],w.prototype,"valueExpressionTitle",void 0),t([r({readOnly:!0})],w.prototype,"_pixelIntensityToDensity",null),w=g=t([n("esri.renderers.HeatmapRenderer")],w);export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{isSome as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{isSome as o}from"../core/arrayUtils.js";import{ClonableMixin as r}from"../core/Clonable.js";import{toPt as i}from"../core/screenUtils.js";import{property as s,subclass as l}from"../core/accessorSupport/decorators.js";import{collectArcadeFieldNames as p}from"../layers/support/fieldUtils.js";import a from"./Renderer.js";import{VisualVariablesMixin as n}from"./mixins/VisualVariablesMixin.js";import m from"./support/AttributeColorInfo.js";import{rendererBackgroundFillSymbolProperty as u}from"./support/commonProperties.js";import y from"./support/OthersCategory.js";import d from"./support/RendererLegendOptions.js";import b from"./visualVariables/OpacityVariable.js";import c from"./visualVariables/SizeVariable.js";import f from"./visualVariables/VisualVariable.js";import h from"../symbols/SimpleLineSymbol.js";import j from"../symbols/SimpleMarkerSymbol.js";import{enumeration as g}from"../core/accessorSupport/decorators/enumeration.js";const v={base:f,key:"type",typeMap:{size:c,opacity:b}};let S=class extends(n(r(a))){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new t([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new y,this.legendOptions=null,this.outline=null,this.type="pie-chart",this.visualVariables=null}get size(){return this._get("size")??12}set size(e){this._set("size",e)}getSymbol(){return new j({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}get symbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(o)}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const o of this.attributes)o.valueExpression&&await p(e,t,null,o.valueExpression),o.field&&e.add(o.field)}};e([s({type:[m],json:{write:!0}})],S.prototype,"attributes",void 0),e([s(u)],S.prototype,"backgroundFillSymbol",void 0),e([s({type:t,json:{write:!0}})],S.prototype,"defaultColor",void 0),e([s({type:String,json:{write:!0}})],S.prototype,"defaultLabel",void 0),e([s({type:Number,range:{min:0,max:1},json:{write:!0}})],S.prototype,"holePercentage",void 0),e([s({type:y,json:{write:!0}})],S.prototype,"othersCategory",void 0),e([s({type:d,json:{write:!0}})],S.prototype,"legendOptions",void 0),e([s({type:h,json:{default:null,write:!0}})],S.prototype,"outline",void 0),e([s({type:Number,cast:i,json:{write:!0}})],S.prototype,"size",null),e([g({pieChart:"pie-chart"})],S.prototype,"type",void 0),e([s({types:[v]})],S.prototype,"visualVariables",void 0),S=e([l("esri.renderers.PieChartRenderer")],S);export{S as default};
|
package/renderers/Renderer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONMap as r}from"../core/jsonMap.js";import{JSONSupport as t}from"../core/JSONSupport.js";import{property as
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as r}from"../core/jsonMap.js";import{JSONSupport as t}from"../core/JSONSupport.js";import{property as o,subclass as s}from"../core/accessorSupport/decorators.js";import i from"./support/AuthoringInfo.js";const n=new r({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let a=class extends t{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const r=new Set;return await this.collectRequiredFields(r,e),Array.from(r).sort()}getSymbol(e,r){}async getSymbolAsync(e,r){}get symbols(){return[]}get arcadeRequired(){return!1}};e([o({type:i,json:{write:!0}})],a.prototype,"authoringInfo",void 0),e([o({type:n.apiValues,readOnly:!0,json:{type:n.jsonValues,read:!1,write:{writer:n.write,ignoreOrigin:!0,isRequired:!0}}})],a.prototype,"type",void 0),a=e([s("esri.renderers.Renderer")],a);export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clone as s}from"../core/lang.js";import{property as r,subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import{clone as s}from"../core/lang.js";import{property as r,subclass as o}from"../core/accessorSupport/decorators.js";import i from"./Renderer.js";import{VisualVariablesMixin as t}from"./mixins/VisualVariablesMixin.js";import{requiredRendererSymbolProperty as l}from"./support/commonProperties.js";import{enumeration as a}from"../core/accessorSupport/decorators/enumeration.js";var m;let n=m=class extends(t(i)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,s){await Promise.all([this.collectSymbolFields(e,s),this.collectVVRequiredFields(e,s)])}async collectSymbolFields(e,s){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,s)))}getSymbol(e,s){return this.symbol}async getSymbolAsync(e,s){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new m({description:this.description,label:this.label,symbol:s(this.symbol),visualVariables:s(this.visualVariables),authoringInfo:s(this.authoringInfo)})}};e([r({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([r(l)],n.prototype,"symbol",void 0),e([a({simple:"simple"})],n.prototype,"type",void 0),n=m=e([o("esri.renderers.SimpleRenderer")],n);export{n as default};
|