@arcgis/core 4.34.0-next.44 → 4.34.0-next.45
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0494e1212dd94d927287.js +1 -0
- package/assets/esri/core/workers/chunks/{42c5d957813080143e5a.js → 09268dc856c3d5ce178f.js} +1 -1
- package/assets/esri/core/workers/chunks/092cb42b88ecfb9c4a07.js +1 -0
- package/assets/esri/core/workers/chunks/0f20c0eec850a39620a1.js +1 -0
- package/assets/esri/core/workers/chunks/129144cbdb3fcbb87baf.js +1 -0
- package/assets/esri/core/workers/chunks/{b40845b45f8d7cd347a1.js → 17df0f766ee1e323d3fa.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf474c055a85bdbfa8d0.js → 19f1bfe815896d4983af.js} +1 -1
- package/assets/esri/core/workers/chunks/2370ff6c3006691ac688.js +1 -0
- package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb23371335ac049861e6.js → 28a85997c9003cacdefb.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d9a7333a968065b53a1.js → 2942ab268f24cea2e722.js} +1 -1
- package/assets/esri/core/workers/chunks/{3a2cbfb03103c402c6c5.js → 2b75212c31145cc07d16.js} +1 -1
- package/assets/esri/core/workers/chunks/{5958598da96464128aed.js → 2f65081bfedeab44d6cb.js} +1 -1
- package/assets/esri/core/workers/chunks/33f3e3d05429f845c139.js +1 -0
- package/assets/esri/core/workers/chunks/379a4f664e77ad1fffe9.js +1 -0
- package/assets/esri/core/workers/chunks/45b450c045d5fadf71b6.js +1 -0
- package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +1 -0
- package/assets/esri/core/workers/chunks/4d544e3e19ce07c2c195.js +1 -0
- package/assets/esri/core/workers/chunks/{6759319f3fd2d03c446b.js → 5c556468e2a598ab793a.js} +1 -1
- package/assets/esri/core/workers/chunks/64c31c90e4c589ca2f04.js +1 -0
- package/assets/esri/core/workers/chunks/709dc98379f4ce18a0b5.js +1 -0
- package/assets/esri/core/workers/chunks/73140c5c0beda7ea3703.js +1 -0
- package/assets/esri/core/workers/chunks/{ff34fdda7899e784ac73.js → 7c7338af011b8f0d7218.js} +1 -1
- package/assets/esri/core/workers/chunks/838998bfda90f099c6e9.js +1 -0
- package/assets/esri/core/workers/chunks/84f3e1ce25c36e46fd2a.js +1 -0
- package/assets/esri/core/workers/chunks/{c6da9ba188b627ab3b79.js → 8aa77a5e82c033512b45.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1c2e5e0a70fb5d27da5.js → 8bab4c59c9b644224ecb.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4b145feab275b268c2e.js → 8cc700da2ac58849a708.js} +1 -1
- package/assets/esri/core/workers/chunks/{28d71e1b866113650c75.js → 8e36693e5213c20158d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1acc620bfd2983d6853f.js → 8fae35af98c29bef8500.js} +1 -1
- package/assets/esri/core/workers/chunks/914eaed113dda727eb47.js +1 -0
- package/assets/esri/core/workers/chunks/98175b454e807b1a3c5f.js +1 -0
- package/assets/esri/core/workers/chunks/9a20be3b02c9d6349b8d.js +1 -0
- package/assets/esri/core/workers/chunks/9d30fed26e0d84ef893b.js +1 -0
- package/assets/esri/core/workers/chunks/a1ff4c252012d5026133.js +1 -0
- package/assets/esri/core/workers/chunks/{ddeaf688d72b2873c4ac.js → a2a13dd95238bb144479.js} +1 -1
- package/assets/esri/core/workers/chunks/a34d98abcf958a632b0f.js +1 -0
- package/assets/esri/core/workers/chunks/a3a23a56df4e5ee86bb2.js +1 -0
- package/assets/esri/core/workers/chunks/{5ae6e2b3557fe8730072.js → b287624909578d307e07.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b91a49202129eedaf00.js → b4304673696fc0774bff.js} +1 -1
- package/assets/esri/core/workers/chunks/b45772b72f2b8f4fd53f.js +1 -0
- package/assets/esri/core/workers/chunks/c645009f3d2576494bfc.js +1 -0
- package/assets/esri/core/workers/chunks/ce569860b170700e9b31.js +1 -0
- package/assets/esri/core/workers/chunks/cf5db995ba88912cf6b7.js +1 -0
- package/assets/esri/core/workers/chunks/{2aac5d560e4c5defe882.js → cff15600d0ec7b19dffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e99fc78bd0f40a8ba81.js → d1c97fdcba6eb443cb1c.js} +1 -1
- package/assets/esri/core/workers/chunks/d70e1b8b8bee88a7a5b8.js +353 -0
- package/assets/esri/core/workers/chunks/da396fdbd6f213042aa7.js +1 -0
- package/assets/esri/core/workers/chunks/dd0f1e06b7df953ea223.js +1 -0
- package/assets/esri/core/workers/chunks/dd79d3aa6e1a8aee6881.js +1 -0
- package/assets/esri/core/workers/chunks/e1272db232194cbe102c.js +1 -0
- package/assets/esri/core/workers/chunks/{14b536e0c1de6c7422bc.js → e408ccee12bfe089c913.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f2bdb8da5c9ffd7d05e.js → e58336aafe8c95bb6831.js} +1 -1
- package/assets/esri/core/workers/chunks/{30b9c131b69297ee186f.js → e59e09766b130a05c617.js} +1 -1
- package/assets/esri/core/workers/chunks/e65fc26f4384a328a753.js +1 -0
- package/assets/esri/core/workers/chunks/{e3f5afdf133c58b3d161.js → ea262087938335fed19f.js} +1 -1
- package/assets/esri/core/workers/chunks/{aaab7694eb333ad480f5.js → ec9fd49e0252797f7f6a.js} +1 -1
- package/assets/esri/core/workers/chunks/{655b8d24ffe5405f8ba1.js → f2a2d3cda4a3dc0a8caf.js} +1 -1
- package/assets/esri/core/workers/chunks/f67997250569069ee2ef.js +1 -0
- package/assets/esri/core/workers/chunks/fc3a6f2f99629e57dbbd.js +1 -0
- package/assets/esri/core/workers/chunks/ff9eef1940eaa3406223.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/bundle.js +1 -1
- package/config.js +1 -1
- package/core/workers/registry.js +1 -1
- package/geometry/operators/json/generalizeOperator.js +5 -0
- package/geometry/operators/json/simplifyOperator.js +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +5 -0
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/package.json +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMResourceManager.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/CIMEffectHelper.js +1 -1
- package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectCut.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/effects/EffectJog.js +1 -1
- package/symbols/cim/effects/EffectMove.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/symbols/cim/effects/EffectReverse.js +1 -1
- package/symbols/cim/effects/EffectRotate.js +1 -1
- package/symbols/cim/effects/EffectScale.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/fitVectorMarker.js +1 -1
- package/symbols/cim/placements/CIMMarkerPlacementHelper.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/03df4668002eb4cb4f98.js +0 -1
- package/assets/esri/core/workers/chunks/087ae1e3e767f0e678e5.js +0 -1
- package/assets/esri/core/workers/chunks/0b45566fad2cbb03fea1.js +0 -1
- package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +0 -1
- package/assets/esri/core/workers/chunks/21dd626a5b5ea6a7e18e.js +0 -1
- package/assets/esri/core/workers/chunks/24e76fa530fc0c495fb5.js +0 -1
- package/assets/esri/core/workers/chunks/2a26c3fc324d672ebe88.js +0 -1
- package/assets/esri/core/workers/chunks/3984ca7e05f30724adaf.js +0 -1
- package/assets/esri/core/workers/chunks/439128f23fa091633d2d.js +0 -1
- package/assets/esri/core/workers/chunks/489391ed1d443140617d.js +0 -1
- package/assets/esri/core/workers/chunks/774844eea928efa811f2.js +0 -1
- package/assets/esri/core/workers/chunks/7b82ed4cc475c782256b.js +0 -1
- package/assets/esri/core/workers/chunks/7ef29640de297a0cf744.js +0 -1
- package/assets/esri/core/workers/chunks/8867368ab9b005460f19.js +0 -353
- package/assets/esri/core/workers/chunks/8c3c752408fac3db05cf.js +0 -1
- package/assets/esri/core/workers/chunks/8ca95499e00ce8b0af9a.js +0 -1
- package/assets/esri/core/workers/chunks/97fc21355efc7b289f3b.js +0 -1
- package/assets/esri/core/workers/chunks/9cd9b22354dbdf1b1df0.js +0 -1
- package/assets/esri/core/workers/chunks/a89c060ad302381aaf7d.js +0 -1
- package/assets/esri/core/workers/chunks/af98c7546be409303213.js +0 -1
- package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +0 -1
- package/assets/esri/core/workers/chunks/c110941e87923ba47193.js +0 -1
- package/assets/esri/core/workers/chunks/d93b24e863379116b2aa.js +0 -1
- package/assets/esri/core/workers/chunks/da6f46211551a96dce19.js +0 -1
- package/assets/esri/core/workers/chunks/dd9be173cddc16a354ed.js +0 -1
- package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +0 -1
- package/assets/esri/core/workers/chunks/eb7dd722e4cd7f83b3f5.js +0 -1
- package/assets/esri/core/workers/chunks/f1adf8ebc2c1b93857bf.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/loadGeometryEngine.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import{getPathLength as i}from"../../../geometry/support/coordsUtils.js";import{setId as h}from"../CIMCursor.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(s,t,i,h,e){return new r(s,t,i)}}class r{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i,this._rule=t.rule??"FullGeometry",this._defaultSize=this._defaultPointSize*i}next(){let i;for(;i=this._inputGeometries.next();){const h=this._processGeom(t(i));if(h?.length)return s.fromJSONCIM({paths:h})}return null}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return h(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,u=[];u.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),u.push(t),u.push(i),u.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(u)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),u=this._mid(h,e),o=this._mid(_,c),a=this._mid(c,u),n=this._mid(o,a);this._addBezier3(s,t,_,o,n,r),this._addBezier3(s,n,a,u,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const u=Math.abs(this._crossProduct(_,this._sub(r,e)));let o=this._dotProduct(_,this._sub(r,e));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=.5*u,n=this._leftPerp(_),p=[e[0]+_[0]*o,e[1]+_[1]*o],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*u,p[1]+l[0][1]*u]),s.push(h),s.push([p[0]-l[0][0]*u,p[1]-l[0][1]*u]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_processGeom(s){if(!s)return null;const t=[];for(const e of s){const s=e.length>1&&i(e)<this._defaultSize;if(!e||0===e.length||s)continue;const r=e.length;let _=e[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=[];h.push(i),h.push(this._mid(_,s)),t.push(h);break}case"ReversedFirstSegment":{const s=this._cp2(e,0,-1);t.push([s,_]);break}case"PerpendicularToSecondSegment":{if(e.length<3)return[];const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=[];h.push(this._mid(s,i)),h.push(_),t.push(h);break}case"SecondSegmentWithTicks":{if(e.length<3)return[];const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);let r;r=this._crossProduct(h,this._sub(_,s))>0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([s[0]+(r[0]-h[0])/3,s[1]+(r[1]-h[1])/3]),c.push(s),c.push(i),c.push([i[0]+(r[0]+h[0])/3,i[1]+(r[1]+h[1])/3]),t.push(c);break}case"DoublePerpendicular":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push(_),u.push([i[0]+r[0]*c,i[1]+r[1]*c]),t.push(u);const o=[];o.push([i[0]-r[0]*c,i[1]-r[1]*c]),o.push(s),t.push(o);break}case"OppositeToFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push([i[0]+r[0]*c,i[1]+r[1]*c]),u.push([i[0]-r[0]*c,i[1]-r[1]*c]),t.push(u);break}case"TriplePerpendicular":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push([i[0]+r[0]*c*.8,i[1]+r[1]*c*.8]),u.push([h[0]+.8*(_[0]-h[0]),h[1]+.8*(_[1]-h[1])]),t.push(u),t.push([i,h]);const o=[];o.push([i[0]-r[0]*c*.8,i[1]-r[1]*c*.8]),o.push([h[0]+.8*(s[0]-h[0]),h[1]+.8*(s[1]-h[1])]),t.push(o);break}case"HalfCircleFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=this._mid(_,s);let r=this._sub(s,_);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),o=Math.sqrt((1+c)/2),a=Math.sqrt((1-c)/2),n=[];let p;this._crossProduct(r,this._sub(i,_))>0?(n.push(_),r=this._sub(_,h),p=s):(n.push(s),r=this._sub(s,h),p=_),this._rotateDirect(r,o,a),r[0]/=o,r[1]/=o;for(let t=1;t<=18;t++)n.push(this._add(h,r)),this._rotateDirect(r,c,u);n.push(p),t.push(n);break}case"HalfCircleSecondSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,1,-1);let h=this._sub(_,s);this._normalize(h);const r=this._crossProduct(h,this._sub(i,s))/2;this._leftPerpendicular(h);const c=[s[0]+h[0]*r,s[1]+h[1]*r];h=this._sub(s,c);const u=Math.cos(Math.PI/18);let o=Math.sin(Math.PI/18);r>0&&(o=-o);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(h,u,o),a.push(this._add(c,h));t.push(a);break}case"HalfCircleExtended":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,1,-1);let h;if(r>=4)h=e[3];else{const t=this._sub(_,s);h=this._add(i,t)}const c=this._dist(s,i)/2/.75,u=this._sub(s,_);this._normalize(u,c);const o=this._sub(i,h);this._normalize(o,c);const a=[h,i];t.push(a);const n=[this._clone(i)];this._addBezier3(n,i,this._add(i,o),this._add(s,u),s,4),n.push(_),t.push(n);break}case"OpenCircle":{const s=this._cp2(e,-2,0),i=this._sub(s,_),h=Math.cos(Math.PI/18),r=-Math.sin(Math.PI/18),c=[s];for(let t=1;t<=33;t++)this._rotateDirect(i,h,r),c.push(this._add(_,i));t.push(c);break}case"CoverageEdgesWithTicks":{const s=this._cp2(e,0,-1);let i,h;if(r>=3)i=e[2];else{const t=this._sub(s,_),h=this._leftPerp(t);i=[_[0]+h[0]-.25*t[0],_[1]+h[1]-.25*t[1]]}if(r>=4)h=e[3];else{const t=this._mid(_,s),e=this._sub(_,s);this._normalize(e),this._leftPerpendicular(e);const r=this._crossProduct(e,this._sub(i,t));this._rightPerpendicular(e),h=[i[0]+e[0]*r*2,i[1]+e[1]*r*2]}const c=this._sub(s,_);let u,o;u=this._crossProduct(c,this._sub(i,_))>0?this._rightPerp(c):this._leftPerp(c),o=[],o.push(i),o.push(_),o.push([_[0]+(u[0]-c[0])/3,_[1]+(u[1]-c[1])/3]),t.push(o),u=this._crossProduct(c,this._sub(h,s))>0?this._rightPerp(c):this._leftPerp(c),o=[],o.push([s[0]+(u[0]+c[0])/3,s[1]+(u[1]+c[1])/3]),o.push(s),o.push(h),t.push(o);break}case"GapExtentWithDoubleTicks":{const s=this._cp2(e,0,2),i=this._cp3(e,s,0,1);let h;if(r>=4)h=e[3];else{const t=this._sub(s,_);h=this._add(i,t)}this._addAngledTicks(t,_,s,this._mid(i,h)),this._addAngledTicks(t,i,h,this._mid(_,s));break}case"GapExtentMidline":{const s=this._cp2(e,2,0),i=this._cp3(e,s,0,1);let h;if(r>=4)h=e[3];else{const t=this._sub(s,_);h=this._add(i,t)}const c=[];c.push(this._mid(_,i)),c.push(this._mid(s,h)),t.push(c);break}case"Chevron":{const s=this._cp2(e,-1,-1);let i;if(r>=3)i=e[2];else{const t=this._sub(s,_);this._leftPerpendicular(t),i=this._add(_,t)}t.push([s,this._makeCtrlPt(_),i]);break}case"PerpendicularWithArc":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,.5,-1),h=this._sub(s,_),c=this._norm(h);h[0]/=c,h[1]/=c;const u=this._crossProduct(h,this._sub(i,_));let o=this._dotProduct(h,this._sub(i,_));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=[_[0]+h[0]*o,_[1]+h[1]*o];let n=this._leftPerp(h),p=[];if(p.push([a[0]-n[0]*u,a[1]-n[1]*u]),p.push([a[0]+n[0]*u,a[1]+n[1]*u]),t.push(p),r>=4){const s=e[3];let i=this._dotProduct(h,this._sub(s,_));i<.1*c?i=.1*c:i>.9*c&&(i=.9*c);const r=[_[0]+h[0]*i,_[1]+h[1]*i],u=this._crossProduct(h,this._sub(s,_)),o=[];o.push([r[0]-n[0]*u,r[1]-n[1]*u]),o.push([r[0]+n[0]*u,r[1]+n[1]*u]),t.push(o)}const d=[s[0]+n[0]*u,s[1]+n[1]*u];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);u<0&&(b=-b),p=[_,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case"ClosedHalfCircle":{const s=this._cp2(e,2,0),i=this._mid(_,s),h=this._sub(s,i),r=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[_,s];for(let t=1;t<=18;t++)this._rotateDirect(h,r,c),u.push(this._add(i,h));t.push(u);break}case"TripleParallelExtended":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,1,-2),r=this._mid(_,s),c=this._sub(i,s);this._normalize(c);const u=Math.abs(this._crossProduct(c,this._sub(r,s)))/2,o=this._dist(s,i),a=[s,_];a.push([_[0]+c[0]*o*.5,_[1]+c[1]*o*.5]),t.push(a);const n=[];n.push([r[0]-c[0]*u,r[1]-c[1]*u]),n.push([r[0]+c[0]*o*.375,r[1]+c[1]*o*.375]),h(n[n.length-1],1),n.push([r[0]+c[0]*o*.75,r[1]+c[1]*o*.75]),t.push(n);const p=[s,i];t.push(p);break}case"ParallelWithTicks":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(i,s);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h),this._addAngledTicks(t,_,s,i),this._addAngledTicks(t,this._mix(_,1,h,r),this._mix(s,1,h,r),this._mid(_,s));break}case"Parallel":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._leftPerp(h),c=this._crossProduct(h,this._sub(i,_));let u=[_,s];t.push(u),u=[],u.push([_[0]+r[0]*c,_[1]+r[1]*c]),u.push([s[0]+r[0]*c,s[1]+r[1]*c]),t.push(u);break}case"PerpendicularToFirstSegment":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._mid(_,s),r=this._sub(s,_);this._normalize(r);const c=this._crossProduct(r,this._sub(i,_));this._leftPerpendicular(r);const u=[];u.push([h[0]-r[0]*c*.25,h[1]-r[1]*c*.25]),u.push([h[0]+r[0]*c*1.25,h[1]+r[1]*c*1.25]),t.push(u);break}case"ParallelOffset":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]-h[0]*r,_[1]-h[1]*r]),c.push([s[0]-h[0]*r,s[1]-h[1]*r]),t.push(c);const u=[];u.push([_[0]+h[0]*r,_[1]+h[1]*r]),u.push([s[0]+h[0]*r,s[1]+h[1]*r]),t.push(u);break}case"OffsetOpposite":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]-h[0]*r,_[1]-h[1]*r]),c.push([s[0]-h[0]*r,s[1]-h[1]*r]),t.push(c);break}case"OffsetSame":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]+h[0]*r,_[1]+h[1]*r]),c.push([s[0]+h[0]*r,s[1]+h[1]*r]),t.push(c);break}case"CircleWithArc":{let s=this._cp2(e,3,0);const i=this._cp3(e,s,.5,-1);let c,u;if(r>=4)c=e[3],u=this._crossProduct(this._sub(c,s),this._sub(i,s))>0;else{c=s,u=this._crossProduct(this._sub(c,_),this._sub(i,_))>0;const t=24*this._geomUnitsPerPoint,h=this._sub(c,_);this._normalize(h,t);const e=Math.sqrt(2)/2;this._rotateDirect(h,e,u?e:-e),s=this._add(_,h)}const o=this._sub(s,_),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(o,a,n),p.push(this._add(_,o));this._add90DegArc(p,s,c,i,u),h(p[p.length-8],1),t.push(p);break}case"DoubleJog":{let s,i=this._cp2(e,-3,1),h=this._cp3(e,i,-1,-.5);if(r>=4)s=e[3];else{const t=_;_=i,s=h;const e=this._dist(_,t),r=this._dist(s,t);let c=30*this._geomUnitsPerPoint;.5*e<c&&(c=.5*e),.5*r<c&&(c=.5*r),i=this._mix(_,c/e,t,(e-c)/e),h=this._mix(s,c/r,t,(r-c)/r)}const c=this._mid(_,i),u=this._mid(s,h),o=this._dist(_,i),a=this._dist(h,s);let n=Math.min(o,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(_,i);this._normalize(d,n),this._crossProduct(d,this._sub(s,i))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(i),l.push(this._add(c,d)),l.push(this._sub(c,d)),l.push(_),t.push(l),d=this._sub(s,h),this._normalize(d,n),this._crossProduct(d,this._sub(_,h))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(h),l.push(this._add(u,d)),l.push(this._sub(u,d)),l.push(s),t.push(l);break}case"PerpendicularOffset":{const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(_,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const r=[h[0]/8,h[1]/8],c=this._sub(this._mid(s,i),r);t.push([c,_]);break}case"LineExcludingLastSegment":{const s=this._arrowPath(e),i=[];let h=s.length-2;for(;h--;)i.push(s[h]);t.push(i);break}case"MultivertexArrow":{const s=this._arrowPath(e),i=[];this._addArrow(i,s,!1),t.push(i);break}case"CrossedArrow":{const s=this._arrowPath(e),i=[];this._addArrow(i,s,!0),t.push(i);break}case"ChevronArrow":{const[s,i]=this._arrowLastSeg(e),h=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);const u=this._crossProduct(r,this._sub(i,s));let o=this._dotProduct(r,this._sub(i,s));o<.05*c?o=.05*c:o>.95*c-h&&(o=.95*c-h);const a=[s[0]+r[0]*o,s[1]+r[1]*o],n=this._leftPerp(r),p=[];p.push([a[0]+n[0]*u+r[0]*h,a[1]+n[1]*u+r[1]*h]),p.push(_),p.push([a[0]-n[0]*u+r[0]*h,a[1]-n[1]*u+r[1]*h]),t.push(p);break}case"ChevronArrowOffset":{const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(i,s));let u=this._dotProduct(h,this._sub(i,s));u<.05*r?u=.05*r:u>.95*r&&(u=.95*r);const o=[s[0]+h[0]*u,s[1]+h[1]*u];this._leftPerpendicular(h);const a=[];a.push([o[0]+h[0]*c*.5,o[1]+h[1]*c*.5]),a.push(this._mid(o,_)),a.push([o[0]-h[0]*c*.5,o[1]-h[1]*c*.5]),t.push(a);break}case"PartialFirstSegment":{const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(i,s));c<.05*r?c=.05*r:c>.95*r&&(c=.95*r);const u=[s[0]+h[0]*c,s[1]+h[1]*c];t.push([s,u]);break}case"Arch":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,1),h=this._sub(_,s),r=this._mix(i,1,h,.55),c=this._mix(i,1,h,-.55),u=[_];this._addBezier2(u,_,r,i,4),this._addBezier2(u,i,c,s,4),t.push(u);break}case"CurvedParallelTicks":{const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(_,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const r=[h[0]/8,h[1]/8],c=this._sub(this._mid(s,i),r),u=this._sub(this._mix(s,.75,i,.25),r),o=this._sub(this._mix(s,.25,i,.75),r),a=[s];this._addBezier2(a,s,u,c,3),this._addBezier2(a,c,o,i,3),t.push(a);for(let e=0;e<8;e++){const s=a[2*e+1],i=[this._clone(s)];i.push(this._add(s,[h[0]/4,h[1]/4])),t.push(i)}break}case"Arc90Degrees":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,1),h=[s];this._add90DegArc(h,s,_,i),t.push(h);break}case"TipWithPerpendicularAndTicks":{const[s,i]=this._arrowLastSeg(e),h=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);let u=this._crossProduct(r,this._sub(i,s)),o=this._dotProduct(r,this._sub(i,s));o<.05*c?o=.05*c:o>.95*c-h&&(o=.95*c-h);const a=this._leftPerp(r),n=[_[0]-r[0]*h,_[1]-r[1]*h],p=.5*Math.max(c-o-h,h);u=Math.abs(u);const d=[];d.push([n[0]+a[0]*(u+p)-r[0]*p,n[1]+a[1]*(u+p)-r[1]*p]),d.push([n[0]+a[0]*u,n[1]+a[1]*u]),d.push([n[0]-a[0]*u,n[1]-a[1]*u]),d.push([n[0]-a[0]*(u+p)-r[0]*p,n[1]-a[1]*(u+p)-r[1]*p]),t.push(d),t.push([n,_]);break}case"ConcentricCircles":{const s=this._cp2(e,1,0),i=this._cp3(e,s,2,0),c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18);let o=this._dist(s,_),a=[o,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,u);if(t.push(n),r>=4){n=[];const s=e[3];o=this._dist(s,_),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),0===t&&(n.push(this._add(_,a)),h(n[1],1)),this._rotateDirect(a,c,u);t.push(n)}n=[],o=this._dist(i,_),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,u);t.push(n);break}case"DoubleJogArrow":{_=this._arrowPath(e)[0];const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(i,_)));let u=Math.abs(this._dotProduct(h,this._sub(i,_)));u<.05*r?u=.05*r:u>.95*r&&(u=.95*r);const o=Math.max(c,u),a=this._leftPerp(h);let n=[];const p=[_[0]-h[0]*u*.5+a[0]*c*.5,_[1]-h[1]*u*.5+a[1]*c*.5];n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),p[0]-=a[0]*o*.25,p[1]-=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=_[0]-h[0]*u*.5-a[0]*c*.5,p[1]=_[1]-h[1]*u*.5-a[1]*c*.5,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),p[0]+=a[0]*o*.25,p[1]+=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),t.push(n);break}case"LinkedChevrons":{const s=this._cp2(e,-5,0),i=this._cp3(e,s,-.2,1),h=this._sub(_,s);this._normalize(h);const r=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(i,s)));t.push([s,_]);const u=[];u.push([_[0]-h[0]*c+r[0]*c,_[1]-h[1]*c+r[1]*c]),u.push(_),u.push([_[0]-h[0]*c-r[0]*c,_[1]-h[1]*c-r[1]*c]),t.push(u),this._addDash(t,s,[-h[0]*c+r[0]*c,-h[1]*c+r[1]*c]),this._addDash(t,s,[-h[0]*c-r[0]*c,-h[1]*c-r[1]*c]);break}case"SegmentThenHalfCircle":{const s=this._cp2(e,2,0),i=this._cp3(e,s,1.5,0);let h;h=r>=4?e[3]:this._cp3(e,s,1.25,-.5);const c=this._sub(s,_);this._normalize(c);const u=.5*this._dist(s,i),o=this._crossProduct(c,this._sub(h,_))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);o&&(n=-n);const p=[_,s];c[0]*=u,c[1]*=u;const d=this._add(s,c);c[0]=-c[0],c[1]=-c[1];for(let t=1;t<=18;t++)this._rotateDirect(c,a,n),p.push(this._add(d,c));t.push(p);break}case"LineWithStraightTicks":{const s=this._cp2(e,-2,1),i=this._cp3(e,s,-1,-.5),h=this._sub(i,s);this._normalize(h);const r=this._dotProduct(h,this._sub(s,_)),c=this._dotProduct(h,this._sub(i,_));let u=[_];u.push([_[0]+h[0]*r,_[1]+h[1]*r]),u.push(s),t.push(u),u=[_],u.push([_[0]+h[0]*c,_[1]+h[1]*c]),u.push(i),t.push(u);break}case"DoubleCurve":{const s=this._cp2(e,-5,-1),i=this._cp3(e,s,2,0),r=Math.atan2(1,5),c=Math.cos(r),u=Math.sin(r),o=this._sub(s,_),a=this._dist(_,s);this._normalize(o),this._rotateDirect(o,c,-u);const n=[_];n.push([_[0]+o[0]*a*.5,_[1]+o[1]*a*.5]),h(n[1],1),n.push([_[0]+o[0]*a*.8,_[1]+o[1]*a*.8]),this._addBezier2(n,n[2],[_[0]+o[0]*a,_[1]+o[1]*a],s,3);const p=this._sub(i,s),d=this._dist(s,i);this._normalize(p),this._rotateDirect(p,c,-u),this._addBezier2(n,s,[i[0]-p[0]*d,i[1]-p[1]*d],[i[0]-p[0]*d*.8,i[1]-p[1]*d*.8],3),n.push(i),t.push(n);break}case"ParallelWithTicksByWidth":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h),r>0?(this._addAngledTicks(t,_,[_[0]+h[0]*r,_[1]+h[1]*r],s),this._addAngledTicks(t,s,[s[0]+h[0]*r,s[1]+h[1]*r],_)):(this._addAngledTicks(t,[_[0]+h[0]*r,_[1]+h[1]*r],_,s),this._addAngledTicks(t,[s[0]+h[0]*r,s[1]+h[1]*r],_,s));break}case"EnclosingRoundedRectangle":{const s=this._cp2(e,3,-2),t=[Math.min(_[0],s[0]),Math.max(_[1],s[1])],i=[Math.max(_[0],s[0]),Math.min(_[1],s[1])],h=i[0]-t[0],r=t[1]-i[1],c=Math.min(h,r)/10,u=[];u.push([t[0]+c+.75*(h-2*c),t[1]]),u.push([i[0]-c,t[1]]),this._add90DegArc(u,[i[0]-c,t[1]],[i[0],t[1]-c],[i[0],t[1]]),u.push([i[0],i[1]+c]),this._add90DegArc(u,[i[0],i[1]+c],[i[0]-c,i[1]],i),u.push([t[0]+c,i[1]]),this._add90DegArc(u,[t[0]+c,i[1]],[t[0],i[1]+c],[t[0],i[1]]),u.push([t[0],t[1]-c]),this._add90DegArc(u,[t[0],t[1]-c],[t[0]+c,t[1]],t),u.push([t[0]+c+.75*(h-2*c),t[1]]);break}default:t.push(e)}}return t}}export{e as EffectControlMeasureLine};
|
|
5
|
+
import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import{getPathLength as i}from"../../../geometry/support/coordsUtils.js";import{setId as h}from"../CIMCursor.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(s,t,i){return new r(s,t,i)}}class r{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i,this._rule=t.rule??"FullGeometry",this._defaultSize=this._defaultPointSize*i}next(){let i;for(;i=this._inputGeometries.next();){const h=this._processGeom(t(i));if(h?.length)return s.fromJSONCIM({paths:h})}return null}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return h(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,u=[];u.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),u.push(t),u.push(i),u.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(u)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),u=this._mid(h,e),o=this._mid(_,c),a=this._mid(c,u),n=this._mid(o,a);this._addBezier3(s,t,_,o,n,r),this._addBezier3(s,n,a,u,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const u=Math.abs(this._crossProduct(_,this._sub(r,e)));let o=this._dotProduct(_,this._sub(r,e));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=.5*u,n=this._leftPerp(_),p=[e[0]+_[0]*o,e[1]+_[1]*o],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*u,p[1]+l[0][1]*u]),s.push(h),s.push([p[0]-l[0][0]*u,p[1]-l[0][1]*u]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_processGeom(s){if(!s)return null;const t=[];for(const e of s){const s=e.length>1&&i(e)<this._defaultSize;if(!e||0===e.length||s)continue;const r=e.length;let _=e[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=[];h.push(i),h.push(this._mid(_,s)),t.push(h);break}case"ReversedFirstSegment":{const s=this._cp2(e,0,-1);t.push([s,_]);break}case"PerpendicularToSecondSegment":{if(e.length<3)return[];const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=[];h.push(this._mid(s,i)),h.push(_),t.push(h);break}case"SecondSegmentWithTicks":{if(e.length<3)return[];const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);let r;r=this._crossProduct(h,this._sub(_,s))>0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([s[0]+(r[0]-h[0])/3,s[1]+(r[1]-h[1])/3]),c.push(s),c.push(i),c.push([i[0]+(r[0]+h[0])/3,i[1]+(r[1]+h[1])/3]),t.push(c);break}case"DoublePerpendicular":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push(_),u.push([i[0]+r[0]*c,i[1]+r[1]*c]),t.push(u);const o=[];o.push([i[0]-r[0]*c,i[1]-r[1]*c]),o.push(s),t.push(o);break}case"OppositeToFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push([i[0]+r[0]*c,i[1]+r[1]*c]),u.push([i[0]-r[0]*c,i[1]-r[1]*c]),t.push(u);break}case"TriplePerpendicular":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push([i[0]+r[0]*c*.8,i[1]+r[1]*c*.8]),u.push([h[0]+.8*(_[0]-h[0]),h[1]+.8*(_[1]-h[1])]),t.push(u),t.push([i,h]);const o=[];o.push([i[0]-r[0]*c*.8,i[1]-r[1]*c*.8]),o.push([h[0]+.8*(s[0]-h[0]),h[1]+.8*(s[1]-h[1])]),t.push(o);break}case"HalfCircleFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=this._mid(_,s);let r=this._sub(s,_);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),o=Math.sqrt((1+c)/2),a=Math.sqrt((1-c)/2),n=[];let p;this._crossProduct(r,this._sub(i,_))>0?(n.push(_),r=this._sub(_,h),p=s):(n.push(s),r=this._sub(s,h),p=_),this._rotateDirect(r,o,a),r[0]/=o,r[1]/=o;for(let t=1;t<=18;t++)n.push(this._add(h,r)),this._rotateDirect(r,c,u);n.push(p),t.push(n);break}case"HalfCircleSecondSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,1,-1);let h=this._sub(_,s);this._normalize(h);const r=this._crossProduct(h,this._sub(i,s))/2;this._leftPerpendicular(h);const c=[s[0]+h[0]*r,s[1]+h[1]*r];h=this._sub(s,c);const u=Math.cos(Math.PI/18);let o=Math.sin(Math.PI/18);r>0&&(o=-o);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(h,u,o),a.push(this._add(c,h));t.push(a);break}case"HalfCircleExtended":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,1,-1);let h;if(r>=4)h=e[3];else{const t=this._sub(_,s);h=this._add(i,t)}const c=this._dist(s,i)/2/.75,u=this._sub(s,_);this._normalize(u,c);const o=this._sub(i,h);this._normalize(o,c);const a=[h,i];t.push(a);const n=[this._clone(i)];this._addBezier3(n,i,this._add(i,o),this._add(s,u),s,4),n.push(_),t.push(n);break}case"OpenCircle":{const s=this._cp2(e,-2,0),i=this._sub(s,_),h=Math.cos(Math.PI/18),r=-Math.sin(Math.PI/18),c=[s];for(let t=1;t<=33;t++)this._rotateDirect(i,h,r),c.push(this._add(_,i));t.push(c);break}case"CoverageEdgesWithTicks":{const s=this._cp2(e,0,-1);let i,h;if(r>=3)i=e[2];else{const t=this._sub(s,_),h=this._leftPerp(t);i=[_[0]+h[0]-.25*t[0],_[1]+h[1]-.25*t[1]]}if(r>=4)h=e[3];else{const t=this._mid(_,s),e=this._sub(_,s);this._normalize(e),this._leftPerpendicular(e);const r=this._crossProduct(e,this._sub(i,t));this._rightPerpendicular(e),h=[i[0]+e[0]*r*2,i[1]+e[1]*r*2]}const c=this._sub(s,_);let u,o;u=this._crossProduct(c,this._sub(i,_))>0?this._rightPerp(c):this._leftPerp(c),o=[],o.push(i),o.push(_),o.push([_[0]+(u[0]-c[0])/3,_[1]+(u[1]-c[1])/3]),t.push(o),u=this._crossProduct(c,this._sub(h,s))>0?this._rightPerp(c):this._leftPerp(c),o=[],o.push([s[0]+(u[0]+c[0])/3,s[1]+(u[1]+c[1])/3]),o.push(s),o.push(h),t.push(o);break}case"GapExtentWithDoubleTicks":{const s=this._cp2(e,0,2),i=this._cp3(e,s,0,1);let h;if(r>=4)h=e[3];else{const t=this._sub(s,_);h=this._add(i,t)}this._addAngledTicks(t,_,s,this._mid(i,h)),this._addAngledTicks(t,i,h,this._mid(_,s));break}case"GapExtentMidline":{const s=this._cp2(e,2,0),i=this._cp3(e,s,0,1);let h;if(r>=4)h=e[3];else{const t=this._sub(s,_);h=this._add(i,t)}const c=[];c.push(this._mid(_,i)),c.push(this._mid(s,h)),t.push(c);break}case"Chevron":{const s=this._cp2(e,-1,-1);let i;if(r>=3)i=e[2];else{const t=this._sub(s,_);this._leftPerpendicular(t),i=this._add(_,t)}t.push([s,this._makeCtrlPt(_),i]);break}case"PerpendicularWithArc":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,.5,-1),h=this._sub(s,_),c=this._norm(h);h[0]/=c,h[1]/=c;const u=this._crossProduct(h,this._sub(i,_));let o=this._dotProduct(h,this._sub(i,_));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=[_[0]+h[0]*o,_[1]+h[1]*o];let n=this._leftPerp(h),p=[];if(p.push([a[0]-n[0]*u,a[1]-n[1]*u]),p.push([a[0]+n[0]*u,a[1]+n[1]*u]),t.push(p),r>=4){const s=e[3];let i=this._dotProduct(h,this._sub(s,_));i<.1*c?i=.1*c:i>.9*c&&(i=.9*c);const r=[_[0]+h[0]*i,_[1]+h[1]*i],u=this._crossProduct(h,this._sub(s,_)),o=[];o.push([r[0]-n[0]*u,r[1]-n[1]*u]),o.push([r[0]+n[0]*u,r[1]+n[1]*u]),t.push(o)}const d=[s[0]+n[0]*u,s[1]+n[1]*u];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);u<0&&(b=-b),p=[_,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case"ClosedHalfCircle":{const s=this._cp2(e,2,0),i=this._mid(_,s),h=this._sub(s,i),r=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[_,s];for(let t=1;t<=18;t++)this._rotateDirect(h,r,c),u.push(this._add(i,h));t.push(u);break}case"TripleParallelExtended":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,1,-2),r=this._mid(_,s),c=this._sub(i,s);this._normalize(c);const u=Math.abs(this._crossProduct(c,this._sub(r,s)))/2,o=this._dist(s,i),a=[s,_];a.push([_[0]+c[0]*o*.5,_[1]+c[1]*o*.5]),t.push(a);const n=[];n.push([r[0]-c[0]*u,r[1]-c[1]*u]),n.push([r[0]+c[0]*o*.375,r[1]+c[1]*o*.375]),h(n[n.length-1],1),n.push([r[0]+c[0]*o*.75,r[1]+c[1]*o*.75]),t.push(n);const p=[s,i];t.push(p);break}case"ParallelWithTicks":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(i,s);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h),this._addAngledTicks(t,_,s,i),this._addAngledTicks(t,this._mix(_,1,h,r),this._mix(s,1,h,r),this._mid(_,s));break}case"Parallel":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._leftPerp(h),c=this._crossProduct(h,this._sub(i,_));let u=[_,s];t.push(u),u=[],u.push([_[0]+r[0]*c,_[1]+r[1]*c]),u.push([s[0]+r[0]*c,s[1]+r[1]*c]),t.push(u);break}case"PerpendicularToFirstSegment":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._mid(_,s),r=this._sub(s,_);this._normalize(r);const c=this._crossProduct(r,this._sub(i,_));this._leftPerpendicular(r);const u=[];u.push([h[0]-r[0]*c*.25,h[1]-r[1]*c*.25]),u.push([h[0]+r[0]*c*1.25,h[1]+r[1]*c*1.25]),t.push(u);break}case"ParallelOffset":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]-h[0]*r,_[1]-h[1]*r]),c.push([s[0]-h[0]*r,s[1]-h[1]*r]),t.push(c);const u=[];u.push([_[0]+h[0]*r,_[1]+h[1]*r]),u.push([s[0]+h[0]*r,s[1]+h[1]*r]),t.push(u);break}case"OffsetOpposite":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]-h[0]*r,_[1]-h[1]*r]),c.push([s[0]-h[0]*r,s[1]-h[1]*r]),t.push(c);break}case"OffsetSame":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]+h[0]*r,_[1]+h[1]*r]),c.push([s[0]+h[0]*r,s[1]+h[1]*r]),t.push(c);break}case"CircleWithArc":{let s=this._cp2(e,3,0);const i=this._cp3(e,s,.5,-1);let c,u;if(r>=4)c=e[3],u=this._crossProduct(this._sub(c,s),this._sub(i,s))>0;else{c=s,u=this._crossProduct(this._sub(c,_),this._sub(i,_))>0;const t=24*this._geomUnitsPerPoint,h=this._sub(c,_);this._normalize(h,t);const e=Math.sqrt(2)/2;this._rotateDirect(h,e,u?e:-e),s=this._add(_,h)}const o=this._sub(s,_),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(o,a,n),p.push(this._add(_,o));this._add90DegArc(p,s,c,i,u),h(p[p.length-8],1),t.push(p);break}case"DoubleJog":{let s,i=this._cp2(e,-3,1),h=this._cp3(e,i,-1,-.5);if(r>=4)s=e[3];else{const t=_;_=i,s=h;const e=this._dist(_,t),r=this._dist(s,t);let c=30*this._geomUnitsPerPoint;.5*e<c&&(c=.5*e),.5*r<c&&(c=.5*r),i=this._mix(_,c/e,t,(e-c)/e),h=this._mix(s,c/r,t,(r-c)/r)}const c=this._mid(_,i),u=this._mid(s,h),o=this._dist(_,i),a=this._dist(h,s);let n=Math.min(o,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(_,i);this._normalize(d,n),this._crossProduct(d,this._sub(s,i))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(i),l.push(this._add(c,d)),l.push(this._sub(c,d)),l.push(_),t.push(l),d=this._sub(s,h),this._normalize(d,n),this._crossProduct(d,this._sub(_,h))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(h),l.push(this._add(u,d)),l.push(this._sub(u,d)),l.push(s),t.push(l);break}case"PerpendicularOffset":{const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(_,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const r=[h[0]/8,h[1]/8],c=this._sub(this._mid(s,i),r);t.push([c,_]);break}case"LineExcludingLastSegment":{const s=this._arrowPath(e),i=[];let h=s.length-2;for(;h--;)i.push(s[h]);t.push(i);break}case"MultivertexArrow":{const s=this._arrowPath(e),i=[];this._addArrow(i,s,!1),t.push(i);break}case"CrossedArrow":{const s=this._arrowPath(e),i=[];this._addArrow(i,s,!0),t.push(i);break}case"ChevronArrow":{const[s,i]=this._arrowLastSeg(e),h=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);const u=this._crossProduct(r,this._sub(i,s));let o=this._dotProduct(r,this._sub(i,s));o<.05*c?o=.05*c:o>.95*c-h&&(o=.95*c-h);const a=[s[0]+r[0]*o,s[1]+r[1]*o],n=this._leftPerp(r),p=[];p.push([a[0]+n[0]*u+r[0]*h,a[1]+n[1]*u+r[1]*h]),p.push(_),p.push([a[0]-n[0]*u+r[0]*h,a[1]-n[1]*u+r[1]*h]),t.push(p);break}case"ChevronArrowOffset":{const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(i,s));let u=this._dotProduct(h,this._sub(i,s));u<.05*r?u=.05*r:u>.95*r&&(u=.95*r);const o=[s[0]+h[0]*u,s[1]+h[1]*u];this._leftPerpendicular(h);const a=[];a.push([o[0]+h[0]*c*.5,o[1]+h[1]*c*.5]),a.push(this._mid(o,_)),a.push([o[0]-h[0]*c*.5,o[1]-h[1]*c*.5]),t.push(a);break}case"PartialFirstSegment":{const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(i,s));c<.05*r?c=.05*r:c>.95*r&&(c=.95*r);const u=[s[0]+h[0]*c,s[1]+h[1]*c];t.push([s,u]);break}case"Arch":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,1),h=this._sub(_,s),r=this._mix(i,1,h,.55),c=this._mix(i,1,h,-.55),u=[_];this._addBezier2(u,_,r,i,4),this._addBezier2(u,i,c,s,4),t.push(u);break}case"CurvedParallelTicks":{const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(_,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const r=[h[0]/8,h[1]/8],c=this._sub(this._mid(s,i),r),u=this._sub(this._mix(s,.75,i,.25),r),o=this._sub(this._mix(s,.25,i,.75),r),a=[s];this._addBezier2(a,s,u,c,3),this._addBezier2(a,c,o,i,3),t.push(a);for(let e=0;e<8;e++){const s=a[2*e+1],i=[this._clone(s)];i.push(this._add(s,[h[0]/4,h[1]/4])),t.push(i)}break}case"Arc90Degrees":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,1),h=[s];this._add90DegArc(h,s,_,i),t.push(h);break}case"TipWithPerpendicularAndTicks":{const[s,i]=this._arrowLastSeg(e),h=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);let u=this._crossProduct(r,this._sub(i,s)),o=this._dotProduct(r,this._sub(i,s));o<.05*c?o=.05*c:o>.95*c-h&&(o=.95*c-h);const a=this._leftPerp(r),n=[_[0]-r[0]*h,_[1]-r[1]*h],p=.5*Math.max(c-o-h,h);u=Math.abs(u);const d=[];d.push([n[0]+a[0]*(u+p)-r[0]*p,n[1]+a[1]*(u+p)-r[1]*p]),d.push([n[0]+a[0]*u,n[1]+a[1]*u]),d.push([n[0]-a[0]*u,n[1]-a[1]*u]),d.push([n[0]-a[0]*(u+p)-r[0]*p,n[1]-a[1]*(u+p)-r[1]*p]),t.push(d),t.push([n,_]);break}case"ConcentricCircles":{const s=this._cp2(e,1,0),i=this._cp3(e,s,2,0),c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18);let o=this._dist(s,_),a=[o,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,u);if(t.push(n),r>=4){n=[];const s=e[3];o=this._dist(s,_),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),0===t&&(n.push(this._add(_,a)),h(n[1],1)),this._rotateDirect(a,c,u);t.push(n)}n=[],o=this._dist(i,_),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,u);t.push(n);break}case"DoubleJogArrow":{_=this._arrowPath(e)[0];const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(i,_)));let u=Math.abs(this._dotProduct(h,this._sub(i,_)));u<.05*r?u=.05*r:u>.95*r&&(u=.95*r);const o=Math.max(c,u),a=this._leftPerp(h);let n=[];const p=[_[0]-h[0]*u*.5+a[0]*c*.5,_[1]-h[1]*u*.5+a[1]*c*.5];n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),p[0]-=a[0]*o*.25,p[1]-=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=_[0]-h[0]*u*.5-a[0]*c*.5,p[1]=_[1]-h[1]*u*.5-a[1]*c*.5,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),p[0]+=a[0]*o*.25,p[1]+=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),t.push(n);break}case"LinkedChevrons":{const s=this._cp2(e,-5,0),i=this._cp3(e,s,-.2,1),h=this._sub(_,s);this._normalize(h);const r=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(i,s)));t.push([s,_]);const u=[];u.push([_[0]-h[0]*c+r[0]*c,_[1]-h[1]*c+r[1]*c]),u.push(_),u.push([_[0]-h[0]*c-r[0]*c,_[1]-h[1]*c-r[1]*c]),t.push(u),this._addDash(t,s,[-h[0]*c+r[0]*c,-h[1]*c+r[1]*c]),this._addDash(t,s,[-h[0]*c-r[0]*c,-h[1]*c-r[1]*c]);break}case"SegmentThenHalfCircle":{const s=this._cp2(e,2,0),i=this._cp3(e,s,1.5,0);let h;h=r>=4?e[3]:this._cp3(e,s,1.25,-.5);const c=this._sub(s,_);this._normalize(c);const u=.5*this._dist(s,i),o=this._crossProduct(c,this._sub(h,_))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);o&&(n=-n);const p=[_,s];c[0]*=u,c[1]*=u;const d=this._add(s,c);c[0]=-c[0],c[1]=-c[1];for(let t=1;t<=18;t++)this._rotateDirect(c,a,n),p.push(this._add(d,c));t.push(p);break}case"LineWithStraightTicks":{const s=this._cp2(e,-2,1),i=this._cp3(e,s,-1,-.5),h=this._sub(i,s);this._normalize(h);const r=this._dotProduct(h,this._sub(s,_)),c=this._dotProduct(h,this._sub(i,_));let u=[_];u.push([_[0]+h[0]*r,_[1]+h[1]*r]),u.push(s),t.push(u),u=[_],u.push([_[0]+h[0]*c,_[1]+h[1]*c]),u.push(i),t.push(u);break}case"DoubleCurve":{const s=this._cp2(e,-5,-1),i=this._cp3(e,s,2,0),r=Math.atan2(1,5),c=Math.cos(r),u=Math.sin(r),o=this._sub(s,_),a=this._dist(_,s);this._normalize(o),this._rotateDirect(o,c,-u);const n=[_];n.push([_[0]+o[0]*a*.5,_[1]+o[1]*a*.5]),h(n[1],1),n.push([_[0]+o[0]*a*.8,_[1]+o[1]*a*.8]),this._addBezier2(n,n[2],[_[0]+o[0]*a,_[1]+o[1]*a],s,3);const p=this._sub(i,s),d=this._dist(s,i);this._normalize(p),this._rotateDirect(p,c,-u),this._addBezier2(n,s,[i[0]-p[0]*d,i[1]-p[1]*d],[i[0]-p[0]*d*.8,i[1]-p[1]*d*.8],3),n.push(i),t.push(n);break}case"ParallelWithTicksByWidth":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h),r>0?(this._addAngledTicks(t,_,[_[0]+h[0]*r,_[1]+h[1]*r],s),this._addAngledTicks(t,s,[s[0]+h[0]*r,s[1]+h[1]*r],_)):(this._addAngledTicks(t,[_[0]+h[0]*r,_[1]+h[1]*r],_,s),this._addAngledTicks(t,[s[0]+h[0]*r,s[1]+h[1]*r],_,s));break}case"EnclosingRoundedRectangle":{const s=this._cp2(e,3,-2),t=[Math.min(_[0],s[0]),Math.max(_[1],s[1])],i=[Math.max(_[0],s[0]),Math.min(_[1],s[1])],h=i[0]-t[0],r=t[1]-i[1],c=Math.min(h,r)/10,u=[];u.push([t[0]+c+.75*(h-2*c),t[1]]),u.push([i[0]-c,t[1]]),this._add90DegArc(u,[i[0]-c,t[1]],[i[0],t[1]-c],[i[0],t[1]]),u.push([i[0],i[1]+c]),this._add90DegArc(u,[i[0],i[1]+c],[i[0]-c,i[1]],i),u.push([t[0]+c,i[1]]),this._add90DegArc(u,[t[0]+c,i[1]],[t[0],i[1]+c],[t[0],i[1]]),u.push([t[0],t[1]-c]),this._add90DegArc(u,[t[0],t[1]-c],[t[0]+c,t[1]],t),u.push([t[0]+c+.75*(h-2*c),t[1]]);break}default:t.push(e)}}return t}}export{e as EffectControlMeasureLine};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{PathEffectCursor as t}from"../CIMCursor.js";import{CurveHelper as i}from"../CurveHelper.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(e,t,i
|
|
5
|
+
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{PathEffectCursor as t}from"../CIMCursor.js";import{CurveHelper as i}from"../CurveHelper.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(e,t,i){return new u(e,t,i)}}class u extends t{constructor(e,t,r){super(e,!0,!0),this._curveHelper=new i,this._beginCut=(void 0!==t.beginCut?t.beginCut:1)*r,this._endCut=(void 0!==t.endCut?t.endCut:1)*r,this._middleCut=(void 0!==t.middleCut?t.middleCut:0)*r,this._invert=void 0!==t.invert&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const{_beginCut:i,_endCut:r,_middleCut:u}=this,s=t.pathLength(),n=e.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(0!==i||0!==r||0!==u)if(i+r+u>=s)for(n.startPath();t.nextPoint();)n.pushXY(t.x,t.y);else this._curveHelper.appendSubCurve(n,t,0,i),this._curveHelper.appendSubCurve(n,t,.5*(s-u),.5*(s+u)),this._curveHelper.appendSubCurve(n,t,s-r,r)}else if(0===i&&0===r&&0===u)for(n.startPath();t.nextPoint();)n.pushXY(t.x,t.y);else i+r+u<s&&(0===u?this._curveHelper.appendSubCurve(n,t,i,s-r):(this._curveHelper.appendSubCurve(n,t,i,.5*(s-u)),this._curveHelper.appendSubCurve(n,t,.5*(s+u),s-r)));return 0===n.totalSize?null:n}}export{r as EffectCut};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{PathEffectCursor as s}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as r}from"../GeometryWalker.js";import{normalizeDashEffectTemplate as a}from"../utils.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{PathEffectCursor as s}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as r}from"../GeometryWalker.js";import{normalizeDashEffectTemplate as a}from"../utils.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new h(t,e,s)}}class h extends s{constructor(t,e,s){super(t,!0,!0),this._firstCurve=null,this._walker=new i,this._walker.updateTolerance(s),this._endings=e.lineDashEnding,this._customDashPos=-(e.offsetAlongLine??0)*s,this._offsetAtEnd=(e.customEndingOffset??0)*s;let n=a(e).dashTemplate;null==n&&(n=[]),n.length%2&&(n=[...n,...n]),this._pattern=new r,this._pattern.init(n,!0),this._pattern.scale(s)}processPath(s){if(0===this._pattern.length()){this.iteratePath=!1;const i=e(s);return t.fromJSONCIM({paths:[i]})}if(!this.iteratePath){let i=!0;switch(this._endings){case"HalfPattern":case"HalfGap":default:this._pattern.extPtGap=0;break;case"FullPattern":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case"FullGap":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case"NoConstraint":this.isClosed||(i=!1);break;case"Custom":this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const r=s.pathLength();if(this._pattern.isEmpty()||r<.1*this._pattern.length()){const i=e(s);return t.fromJSONCIM({paths:[i]})}if(!this._walker.init(s,this._pattern,i)){const i=e(s);return t.fromJSONCIM({paths:[i]})}}let i;if(this.iteratePath)i=this._pattern.nextValue();else{let t;switch(this._endings){case"HalfPattern":default:t=.5*this._pattern.firstValue();break;case"HalfGap":t=.5*-this._pattern.lastValue();break;case"FullGap":t=-this._pattern.lastValue();break;case"FullPattern":t=0;break;case"NoConstraint":case"Custom":t=-this._customDashPos}let e=t/this._pattern.length();e-=Math.floor(e),t=e*this._pattern.length(),this._pattern.reset(),i=this._pattern.nextValue();let s=!1;for(;t>=i;)t-=i,i=this._pattern.nextValue(),s=!s;i-=t,s?(this._walker.nextPosition(i),i=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(i),i=this._pattern.nextValue(),this._walker.nextPosition(i),i=this._pattern.nextValue())}let r=this._walker.nextCurve(i);if(r)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)r.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else i=this._pattern.nextValue(),!this._walker.nextPosition(i)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(r.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,r=this._firstCurve,this._firstCurve=null;return r?.reset(),r}}export{n as EffectDashes};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{clipCursorToTileExtent as
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{lazyBufferOperator as e,clipCursorToTileExtent as n}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,i,e,n,s,h){return new r(t,i,e,n,s,h)}}class r{constructor(t,i,e,n,s,r){this._preventClipping=r,this._inputGeometries=t,this._tileKey=n,this._maxInflateSize=s*e,this._width=(void 0!==i.width?i.width:2)*e,i.method,this._option=i.option}next(){let s;for(;s=this._inputGeometries.next();){if("esriGeometryEnvelope"===s.geometryType&&this._width>0){const i=s.asJSON();return Math.min(i.xmax-i.xmin,i.ymax-i.ymin)-2*this._width<0?s:t.fromJSONCIM({paths:[[[i.xmin+this._width,i.ymin+this._width],[i.xmax-this._width,i.ymin+this._width],[i.xmax-this._width,i.ymax-this._width],[i.xmin+this._width,i.ymax-this._width],[i.xmin+this._width,i.ymin+this._width]],[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]})}if("esriGeometryPolygon"===s.geometryType){if(0===this._width)return s.clone();const t=e.module,r=!this._preventClipping&&this._tileKey?n(s,this._maxInflateSize,!0):s.clone();if(!r)continue;const h={...r.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},o=t.execute(h,-this._width);if(o)for(const i of o.rings)if(i){r.startPath();for(const t of i.reverse())r.pushXY(t[0],r.yFactor*t[1])}return r}}return null}}export{s as EffectDonut};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{getCursorBoundsXY as
|
|
5
|
+
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{getCursorBoundsXY as r}from"../../../geometry/support/boundsUtils.js";import{lazyConvexHullOperator as n}from"../CIMEffects.js";class o{static{this.instance=null}static local(){return null===o.instance&&(o.instance=new o),o.instance}execute(e,t){return new s(e,t)}}class s{constructor(e,t){this._inputGeometries=e,this._medhod=t.method}next(){let e=this._inputGeometries.next();const t=this._medhod;for(;null!=e;){if(e.totalSize>0)switch(t){case"RectangularBox":return i(e);case"ConvexHull":return this._constructConvexHull(e);default:return u(e)}e=this._inputGeometries.next()}return null}_constructConvexHull(r){switch(r.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const o=n.module,s={...r.asJSON(),spatialReference:{wkid:t.WebMercator.wkid}},i=o.execute(s);return i?e.fromJSONCIM(i):null}case"esriGeometryEnvelope":return r;default:return null}}}function i(t){const n=r(t),o={xmin:n[0],ymin:n[1],xmax:n[2],ymax:n[3]};return e.fromJSONCIM(o)}function u(t){switch(t.geometryType){case"esriGeometryPolyline":{const r=[];for(;t.nextPath();)l(t,r);return e.fromJSONCIM({rings:r})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return t;default:return null}}function l(e,t){if(e.seekPathStart(),!e.nextPoint())return;const r=e.x,n=e.y,o=[[r,n]];for(t.push(o);e.nextPoint();)o.push([e.x,e.y]);o.push([r,n])}export{o as EffectEnclosingPolygon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{PathEffectCursor as i}from"../CIMCursor.js";import{CurveHelper as s}from"../CurveHelper.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,i,s
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{PathEffectCursor as i}from"../CIMCursor.js";import{CurveHelper as s}from"../CurveHelper.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,i,s){return new n(t,i,s)}}class n extends i{constructor(t,i,e){super(t,!1,!0),this._curveHelper=new s,this._length=(void 0!==i.length?i.length:20)*e,this._angle=void 0!==i.angle?i.angle:225,this._position=void 0!==i.position?i.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(i){const s=t.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(i))return null;i.seekInPath(0);const e=i.x,n=i.y;i.seekInPath(i.pathSize-1);const o=i.x,r=i.y,h=[o-e,r-n];this._curveHelper.normalize(h);const l=e+(o-e)*this._position/100,a=n+(r-n)*this._position/100,_=Math.cos((90-this._angle)/180*Math.PI);let p=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(p=-p),this._mirror=!this._mirror;const c=[l-this._length/2*_,a-this._length/2*p],m=[l+this._length/2*_,a+this._length/2*p];return s.pushPath([[e,n],c,m,[o,r]]),s}}export{e as EffectJog};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class t{static{this.instance=null}static local(){return null===t.instance&&(t.instance=new t),t.instance}execute(t,s,n
|
|
5
|
+
class t{static{this.instance=null}static local(){return null===t.instance&&(t.instance=new t),t.instance}execute(t,s,n){return new e(t,s,n)}}class e{constructor(t,e,s){this._inputGeometries=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if(t.totalSize>0)return this._move(t.clone(),this._offsetX,this._offsetY);t=this._inputGeometries.next()}return null}_move(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=t.x+e,t.y=t.y+s;return t.reset(),t}}export{t as EffectMove};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as s}from"../../../geometry/support/jsonUtils.js";import{clipCursorToTileExtent as i,lazyOffsetOperator as o}from"../CIMEffects.js";import{CurveHelper as n,pixelTolerance as f}from"../CurveHelper.js";const m=10;class a{static{this.instance=null}static local(){return null===a.instance&&(a.instance=new a),a.instance}execute(t,e,r,s,i,o){return new l(t,e,r,s,i,o)}}class l{constructor(t,e,r,s,i,o){this._preventClipping=o,this._inputGeometries=t,this._tileKey=s,this._curveHelper=new n,this._offset=(e.offset??1)*r,this._method=e.method,this._maxInflateSize=Math.max(Math.abs(i*r),m),this._option=e.option,this._offsetFlattenError=f*r}next(){let n;for(;n=this._inputGeometries.next();){if(0===this._offset)return n.clone();if("esriGeometryEnvelope"===n.geometryType){if("Rounded"===this._method&&this._offset>0){const r=e(n),s=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(s){const e=t.createEmptyOptimizedCIM(n.geometryType);return e.pushPath(s),e}return null}const r=n.asJSON();if(s(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return t.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const f=!this._preventClipping&&this._tileKey?i(n,this._maxInflateSize,!0):n.clone();if(!f)continue;const m=o.module,a={...f.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}},l=m.execute(a,-this._offset,{joins:h(this._method),flattenError:this._offsetFlattenError,miterLimit:4});return l?t.fromJSONCIM(l):null}return null}}function h(t){switch(t){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{a as EffectOffset};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{ringsCentroidCursor as e}from"../../../geometry/support/centroid.js";import{defaultCIMValues as i}from"../defaultCIMValues.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,i
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{ringsCentroidCursor as e}from"../../../geometry/support/centroid.js";import{defaultCIMValues as i}from"../defaultCIMValues.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,i){return new r(t,e,i)}}class r{constructor(t,e,n){this._inputGeometries=t,this._length=(void 0!==e.length?e.length:i.CIMGeometricEffectRadial.length)*n,this._angle=void 0!==e.angle?e.angle*Math.PI/180:i.CIMGeometricEffectRadial.angle,this._lx=Math.cos(this._angle)*this._length,this._ly=Math.sin(this._angle)*this._length}next(){let i=this._inputGeometries.next();for(;i;){if("esriGeometryPoint"===i.geometryType||"esriGeometryMultipoint"===i.geometryType){const e=t.createEmptyOptimizedCIM("esriGeometryPolyline");return i.nextPath()&&i.nextPoint()&&e.pushPath([[i.x,i.y],[i.x+this._lx,i.y+this._ly]]),e}if("esriGeometryPolygon"===i.geometryType){const n=e(i);if(!n)return null;const r=t.createEmptyOptimizedCIM("esriGeometryPolyline");return r.pushPath([[n[0],n[1]],[n[0]+this._lx,n[1]+this._ly]]),r}i=this._inputGeometries.next()}return null}}export{n as EffectRadial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(e,n,r
|
|
5
|
+
class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(e,n,r){return new t(e,n,r)}}class t{constructor(e,t,n){this._inputGeometries=e,this._reverse=void 0===t.reverse||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if("esriGeometryPolyline"===e.geometryType)return n(e.clone());e=this._inputGeometries.next()}return null}}function n(e){for(;e.nextPath();)for(let t=0;t<e.pathSize/2;t++){e.seekInPath(t);const n=e.x,r=e.y;e.seekInPath(e.pathSize-t-1);const s=e.x,i=e.y;e.x=n,e.y=r,e.seekInPath(t),e.x=s,e.y=i}return e.reset(),e}export{e as EffectReverse};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,e,r
|
|
5
|
+
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,e,r){return new n(t,e,r)}}class n{constructor(t,e,n){this._inputGeometries=t,this._rotateAngle=void 0!==e.angle?e.angle*Math.PI/180:0}next(){let e=this._inputGeometries.next();for(;e;){if(0===this._rotateAngle||"esriGeometryPoint"===e.geometryType)return e;if(e.totalSize>0){const n=t(e),r=(n[2]+n[0])/2,s=(n[3]+n[1])/2;return e.reset(),this._rotate(e.clone(),r,s)}e=this._inputGeometries.next()}return null}_rotate(t,e,n){const r=Math.cos(this._rotateAngle),s=Math.sin(this._rotateAngle);for(;t.nextPath();)for(;t.nextPoint();){const o=t.x-e,i=t.y-n;t.x=e+o*r-i*s,t.y=n+o*s+i*r}return t.reset(),t}}export{e as EffectRotate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,e,s
|
|
5
|
+
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,e,s){return new r(t,e,s)}}class r{constructor(t,e,r){this._inputGeometries=t,this._xFactor=void 0!==e.xScaleFactor?e.xScaleFactor:1.15,this._yFactor=void 0!==e.yScaleFactor?e.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(1===this._xFactor&&1===this._yFactor)return e;if("esriGeometryPoint"===e.geometryType)return e;if(e.totalSize>0){const r=t(e),s=(r[2]+r[0])/2,o=(r[3]+r[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,o)}}return null}_scaleCursor(t,e,r){for(;t.nextPath();)for(;t.nextPoint();)t.x=e+(t.x-e)*this._xFactor,t.y=r+(t.y-r)*this._yFactor;return t.reset(),t}}export{e as EffectScale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import e from"../../../geometry/support/PolylineBuilder.js";import{PathEffectCursor as n}from"../CIMCursor.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,n
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import e from"../../../geometry/support/PolylineBuilder.js";import{PathEffectCursor as n}from"../CIMCursor.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,n){return new s(t,e,n)}}class s extends n{constructor(t,e,n){super(t,!1,!0),this._suppress=void 0!==e.suppress&&e.suppress,this._invert=void 0!==e.invert&&e.invert}processPath(n){if(n.totalSize<=0)return null;if(!this._suppress){const e=t.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,n.yFactor);for(n.seekPathEnd();n.nextPoint();)e.pushXY(n.x,n.y);return e}const r=[],s=new Array(n.pathSize);let o=0;for(n.seekPathStart();n.nextPoint();)s[o++]=n.getControlPoint(),r.push([n.x,n.y]);let i=!0,l=!0,h=!1,p=!this._invert;o=0;const u=new e;let c=r[0];for(;o<r.length;){const t=r[o+1],e=s[o],n=s[o+1];o++,l&&(p=e||n?this._invert:!this._invert,l=!1),p?(u.addSegment(c,t,i),i=!1):h=!0,c=t,n&&(p?(p=!1,i=!0):p=!0)}const a=u.getGeometry();if(0===a.length)return null;if(!h&&r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]){const e=a[a.length-1];return e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]||e.push([e[0][0],e[0][1]]),t.fromJSONCIM({paths:a})}const g=a[a.length-1];return u.getPointCount()>1&&"esriGeometryPolygon"===n.geometryType&&g[0][0]===g[g.length-1][0]&&g[0][1]===g[g.length-1][1]&&a.length>1&&(a[a.length-1].push(...a[0]),a.splice(0,1)),t.fromJSONCIM({paths:a})}}export{r as EffectSuppress};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import o from"../../../geometry/SpatialReference.js";import{isPolygon as i,isPolyline as l}from"../../../geometry/support/jsonUtils.js";import r from"../../../geometry/support/PolylineBuilder.js";import{Point as n}from"../../../geometry/support/TileClipper.js";import{PathEffectCursor as h}from"../CIMCursor.js";import{lazyGeneralizeOperator as a,lazyLengthOperator as c,lazySimplifyOperator as _}from"../CIMEffects.js";const p=()=>t.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class y{static{this.instance=null}static local(){return null===y.instance&&(y.instance=new y),y.instance}execute(e,t,s){return new f(e,t,s)}}class f extends h{constructor(e,t,s){super(e,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new n(NaN,NaN),this._lastWidth=0,this._geomUnitsPerPoint=s,this._halfFromWidth=Math.abs(void 0!==t.fromWidth?t.fromWidth:0)*s*.5,this._halfToWidth=Math.abs(void 0!==t.toWidth?t.toWidth:1)*s*.5,this._originalLength=(void 0!==t.length?t.length:0)*s,this._length=0}processPath(t){if(t.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const e=s.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,t.yFactor);for(t.seekPathEnd();t.prevPoint();)e.pushXY(t.x,t.y);for(t.seekPathStart();t.nextPoint();)e.pushXY(t.x,t.y);return e}const n=t.asJSON();t.seekPath(t.totalSize-1);const h=a.module.execute(n,.25*this._geomUnitsPerPoint,{removeDegenerateParts:!0}),y=null==h?null:i(h)?h.rings:l(h)?h.paths:null;if(!y)return p().error(new e("mapview-bad-resource","Unable to process geometry")),null;const f=c.module.execute(h);if((0===this._originalLength||this._originalLength>f)&&f>0){this._length=f;const e=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(e)<1){const t=e*e;this._slopeC=Math.sqrt(1/(1+t)),this._slopeS=Math.sqrt(t/(1+t)),e<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;const m=[];for(const e of y){const t=new r,s=new r;let o=0;this._setFromOffset(e.slice(0,2),t,s);for(let r=0,n=3;n<=e.length;++r,++n)o=this._setOffset(e.slice(r,n),o,t,s);this._setToOffset(e.slice(-2),o,t,s);const[i]=t.getGeometry(),[l]=s.getGeometry();m.push([...i,...l.reverse()])}const x={rings:m,spatialReference:{wkid:o.WebMercator.wkid}},d=_.module.execute(x);return s.fromJSONCIM(d)}_setFromOffset([[e,t],[s,o]],i,l){const r=this._halfFromWidth,h=new n(s-e,o-t).normalize().scale(r);i.beginPath([e-h.y,t+h.x]),l.beginPath([e+h.y,t-h.x])}_setToOffset([[e,t],[s,o]],i,l,r){let h;h=(i+=Math.sqrt((s-e)**2+(o-t)**2))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*i/this._length;const a=new n(s-e,o-t).normalize().scale(h);l.lineTo([s-a.y,o+a.x]),r.lineTo([s+a.y,o-a.x])}_setOffset([[t,s],[o,i],[l,r]],h,a,c){const _=Math.sqrt((o-t)**2+(i-s)**2);let y;y=h+_>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(h+_)/this._length,h+=_;const f=new n(o,i),m=new n(o-t,i-s).normalize(),x=new n(l-o,r-i).normalize(),d=n.sub(x,m),g=a.getPointCount(),u=c.getPointCount();m.leftPerpendicular(),x.leftPerpendicular();const T=m.x*x.x+m.y*x.y;if(T>.99){const e=n.add(m,x).scale(y/2),t=e.clone().rotate(this._slopeC,this._slopeS);a.lineTo([f.x+t.x,f.y+t.y]);const s=e.rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x-s.x,f.y-s.y])}else{const o=m.x*x.y-m.y*x.x;if(d.scale(1/o),o<0){d.scale(-y).rotateReverse(this._slopeC,this._slopeS);const t=c.getXY(u-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS),t=x.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x+e.x,f.y+e.y]),c.lineTo([f.x,f.y]),c.lineTo([f.x+t.x,f.y+t.y])}else c.lineTo([f.x+d.x,f.y+d.y])}else{d.scale(y).rotate(this._slopeC,this._slopeS);const t=a.getXY(g-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(y).rotate(this._slopeC,this._slopeS),t=x.clone().scale(y).rotate(this._slopeC,this._slopeS);a.lineTo([f.x+e.x,f.y+e.y]),a.lineTo([f.x,f.y]),a.lineTo([f.x+t.x,f.y+t.y])}else a.lineTo([f.x+d.x,f.y+d.y])}const i=Math.acos(T);let l=1;if(y>.25){const e=2*Math.acos(1-.25/y);e<i&&(l=Math.round(i/e))}const r=Math.cos(i/l),h=Math.sin(i/l),_=m.clone();if(o<0){_.rotate(this._slopeC,this._slopeS);const o=a.getXY(g-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(this._lastWidth);o.rotate(this._slopeC,this._slopeS);const i=m.clone().scale(this._lastWidth);i.rotate(this._slopeC,this._slopeS),a.lineTo([e.x+o.x,e.y+o.y]),a.lineTo([e.x,e.y]),a.lineTo([e.x+i.x,e.y+i.y])}}else{_.scale(-1).rotateReverse(this._slopeC,this._slopeS);const o=c.getXY(u-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(-this._lastWidth);o.rotateReverse(this._slopeC,this._slopeS);const i=m.clone().scale(-this._lastWidth);i.rotateReverse(this._slopeC,this._slopeS),c.lineTo([e.x+o.x,e.y+o.y]),c.lineTo([e.x,e.y]),c.lineTo([e.x+i.x,e.y+i.y])}}_.scale(y);for(let e=0;e<=l;e++)o<0?(a.lineTo([f.x+_.x,f.y+_.y]),_.rotateReverse(r,h)):(c.lineTo([f.x+_.x,f.y+_.y]),_.rotate(r,h))}return this._lastTangent1.setCoords(m.x,m.y),this._lastWidth=y,h}}export{y as EffectTaperedPolygon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{DashPattern as e,GeometryWalker as i,Pos as s}from"../GeometryWalker.js";class h{static{this.instance=null}static local(){return null===h.instance&&(h.instance=new h),h.instance}execute(t,e,i
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{DashPattern as e,GeometryWalker as i,Pos as s}from"../GeometryWalker.js";class h{static{this.instance=null}static local(){return null===h.instance&&(h.instance=new h),h.instance}execute(t,e,i){return new n(t,e,i)}}class n{constructor(t,s,h){this._inputGeometries=t,this._height=(void 0!==s.amplitude?s.amplitude:2)*h,this._period=(void 0!==s.period?s.period:3)*h,this._style=s.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new e,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new i,this._walker.updateTolerance(h)}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._height||0===this._period)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(e){const i=t.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){i.startPath();const t=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case"Sinus":default:this._constructCurve(i,t,!1);break;case"Square":this._constructSquare(i,t);break;case"Triangle":this._constructTriangle(i,t);break;case"Random":this._constructCurve(i,t,!0)}else for(;e.nextPoint();)i.pushXY(e.x,e.y)}return i}_constructCurve(t,e,i){let h=Math.round(e/this._period);0===h&&(h=1);const n=h*16+1,r=e/h,a=this._period/16,o=1/n,p=2*Math.PI*e/r,_=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),l=2*Math.PI*Math.random(),u=.75-Math.random()/2,d=.75-Math.random()/2,g=new s;this._walker.curPointAndAngle(g),t.pushPoint(g.pt);let w=0;for(;;){if(!this._walker.nextPointAndAngle(a,g)){t.pushPoint(this._walker.getPathEnd());break}{const e=w;let s;if(w+=o,i){const t=this._height/2*(1+.3*Math.sin(u*p*e+_));s=t*Math.sin(p*e+c),s+=t*Math.sin(d*p*e+l),s/=2}else s=.5*this._height*Math.sin(.5*p*e);t.pushXY(g.pt[0]-s*g.sa,g.pt[1]+s*g.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let i=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const h=new s;this._walker.curPointAndAngle(h);const n=new s;if(this._walker.nextPointAndAngle(this._period,n)){const r=new s;this._walker.nextPointAndAngle(this._period,r)&&(i?(t.pushPoint(h.pt),i=!1):t.pushPoint(h.pt),t.pushXY(h.pt[0]-this._height/2*h.sa,h.pt[1]+this._height/2*h.ca),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let i=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const h=new s;this._walker.curPointAndAngle(h);const n=new s;if(this._walker.nextPointAndAngle(this._period/2,n)){const r=new s;this._walker.nextPointAndAngle(this._period,r)&&(this._walker.nextPosition(this._period/2)&&(i?(t.pushPoint(h.pt),i=!1):t.pushPoint(h.pt),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca)),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}}export{h as EffectWave};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as m}from"../../core/lang.js";import{getExtent as e}from"./SDFHelper.js";import{CIMEffectHelper as r}from"./effects/CIMEffectHelper.js";const a=.01;function t(t
|
|
5
|
+
import{clone as m}from"../../core/lang.js";import{getExtent as e}from"./SDFHelper.js";import{CIMEffectHelper as r}from"./effects/CIMEffectHelper.js";const a=.01;function t(t){if(!t.frame)return t;const{markerGraphics:f}=t;if(!f||0===f.length)return t;let n=0,o=0,s=0,i=0;for(const m of f){const{geometry:a,symbol:t}=m;if(!a||!t||!("symbolLayers"in t))continue;const{symbolLayers:f}=t;if(f)for(const m of f){const{effects:t}=m,f=r.applyEffects(t,a),c=e(f);c&&(n=Math.min(n,c[0]),o=Math.min(o,c[1]),s=Math.max(s,c[2]),i=Math.max(i,c[3]))}}const{xmin:c,ymin:x,xmax:y,ymax:p}=t.frame,h=(y-c)/2,l=(p-x)/2,M=(y+c)/2,u=(p+x)/2;if(h<=0||l<=0)return t;const b=(M-n)/h,g=(s-M)/h,j=(u-o)/l,E=(i-u)/l,F=Math.max(Math.max(b,g),Math.max(j,E));return F<=1+a?t:(t=m(t)).frame?(t.frame.xmin=(t.frame.xmin-M)*F+M,t.frame.ymin=(t.frame.ymin-u)*F+u,t.frame.xmax=(t.frame.xmax-M)*F+M,t.frame.ymax=(t.frame.ymax-u)*F+u,!1!==t.respectFrame&&(t.size*=F),t):t}export{t as fitVectorMarker};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getPlacementOperator as t}from"../CIMOperators.js";class e{static getPlacement(e,r,n,s,c
|
|
5
|
+
import{getPlacementOperator as t}from"../CIMOperators.js";class e{static getPlacement(e,r,n,s,c){const o=t(n);if(!o)return null;-1===r&&e.invertY();return o.execute(e,n,s,c)}}export{e as CIMMarkerPlacementHelper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as e,DashPattern as s,Pos as i}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as e,DashPattern as s,Pos as i}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new a(t,e,s)}}class a extends t{constructor(t,i,n){super(t),this._geometryWalker=new e,this._geometryWalker.updateTolerance(n),this._angleToLine=i.angleToLine??!0,this._offset=(i.offset?i.offset:0)*n,this._originalEndings=i.endings,this._offsetAtEnd=(i.customEndingOffset?i.customEndingOffset:0)*n,this._position=-(i.offsetAlongLine?i.offsetAlongLine:0)*n,this._pattern=new s,this._pattern.init(i.placementTemplate,!1),this._pattern.scale(n),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{"WithFullGap"===this._originalEndings&&this.isClosed?this._endings="WithMarkers":this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case"NoConstraint":s=-this._position,s=this._adjustPosition(s),i=!1;break;case"WithHalfGap":default:s=-this._pattern.lastValue()/2;break;case"WithFullGap":s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case"WithMarkers":s=0;break;case"Custom":s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let n=0;for(;s>n;)s-=n,n=this._pattern.nextValue();n-=s,e=n,this.iteratePath=!0}const s=new i;return this._geometryWalker.nextPointAndAngle(e,s)?"WithFullGap"===this._endings&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):"WithMarkers"===this._endings&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}export{n as PlacementAlongLineSameSize};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,s
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,s){return new i(t,e,s)}}class i extends t{constructor(t,s,i){super(t,!1,!0),this._curveHelper=new e,this._placePerPart=s.placePerPart??!1,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._offset=void 0!==s.offset?s.offset*i:0,this._type=s.extremityPlacement,this._position=void 0!==s.offsetAlongLine?s.offsetAlongLine*i:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case"Both":default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case"JustBegin":e=this._atExtremities(t,this._position,!0);break;case"JustEnd":e=this._atExtremities(t,this._position,!1);case"None":}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[n,r]=[0,0],[a,o]=[t.x,t.y];const h=[0,0];for(;s?t.nextPoint():t.prevPoint();){n=a,r=o,a=t.x,o=t.y;const s=this._curveHelper.getLength(n,r,a,o);if(i+s>e){const t=(e-i)/s,[l,c]=this._curveHelper.getAngleCS(h,n,r,a,o,t),P=this._curveHelper.getCoord2D(n,r,a,o,t);return this.internalPlacement.setTranslate(P[0]-this._offset*c,P[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(-l,-c),this.internalPlacement}i+=s}}return null}}export{s as PlacementAtExtremities};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as s,Pos as e}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,i,s
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as s,Pos as e}from"../GeometryWalker.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,i,s){return new a(t,i,s)}}class a extends t{constructor(t,e,n){super(t),this._walker=new i,this._walker.updateTolerance(n),this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*n:0,this._beginGap=void 0!==e.beginPosition?e.beginPosition*n:0,this._endGap=void 0!==e.endPosition?e.endPosition*n:0,this._flipFirst=void 0===e.flipFirst||e.flipFirst,this._pattern=new s,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let i;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+t;i=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,e=this._beginGap+s;i=e-this._prevPos,this._prevPos=e,this.iteratePath=!0}const s=new e;if(!this._walker.nextPointAndAngle(i,s,1))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const n=this._isFirst&&this._flipFirst;let a,h;return this._angleToLine?(a=s.ca,h=s.sa):(a=1,h=0),n&&(a=-a,h=-h),this.internalPlacement.setRotateCS(a,h),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}export{n as PlacementAtRatioPositions};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../core/RandomLCG.js";import{Placement as s}from"../CIMPlacements.js";const i=512,e=10,h=24,n=1e-6;class _{static{this.instance=null}static local(){return null===_.instance&&(_.instance=new _),_.instance}execute(t,s,i,e
|
|
5
|
+
import t from"../../../core/RandomLCG.js";import{Placement as s}from"../CIMPlacements.js";const i=512,e=10,h=24,n=1e-6;class _{static{this.instance=null}static local(){return null===_.instance&&(_.instance=new _),_.instance}execute(t,s,i,e){return new r(t,s,i,e)}}class r{constructor(e,h,n,_){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(h.stepX??16)*n,this._stepY=Math.abs(h.stepY??16)*n,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,0!==this._stepX&&0!==this._stepY){if(this._gridType=h.gridType??"Fixed","Random"===this._gridType){const s=h.seed??13,i=1;this._randomLCG=new t(s*i),this._randomness=(h.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=h.gridAngle??0,this._shiftOddRows=h.shiftOddRows??!1,this._offsetX=(h.offsetX??0)*n,this._offsetY=(h.offsetY??0)*n,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,null!=_){const[t,s,e,h]=_.split("/"),n=parseFloat(t),r=parseFloat(s),a=parseFloat(e),o=parseFloat(h);this._graphicOriginX=-(o*2**n+a)*i,this._graphicOriginY=r*i,this._testInsidePolygon=!0}this._internalPlacement=new s,this._calculateMinMax(e),this._geometryCursor=e}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!r._randValues){r._randValues=[];for(let t=0;t<h;t++)for(let s=0;s<h;s++)r._randValues.push(this._randomLCG.getFloat()),r._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(t){let s,e,h,n,_,r,a,o,l,f,c,u,p,M;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,a=o=p=c=Number.MAX_VALUE,l=f=M=u=-Number.MAX_VALUE;const g=1!==this._cosAngle;for(t.reset();t.nextPath();)for(;t.nextPoint();)r=t.x,_=t.y,s=r-this._graphicOriginX-this._offsetX,e=_-this._graphicOriginY-this._offsetY,g?(h=this._cosAngle*s-this._sinAngle*e,n=this._sinAngle*s+this._cosAngle*e):(h=s,n=e),a=Math.min(a,h),l=Math.max(l,h),o=Math.min(o,n),f=Math.max(f,n),c=Math.min(c,_),u=Math.max(u,_),p=Math.min(p,r),M=Math.max(M,r);c=c!==Number.MAX_VALUE?c:-i-this._stepY,u=u!==-Number.MAX_VALUE?u:this._stepY,p=p!==Number.MAX_VALUE?p:-this._stepX,M=M!==-Number.MAX_VALUE?M:i+this._stepX;const d=u-c,X=M-p;if(this._verticalSubdivision=d>=X,this._polygonMin=this._verticalSubdivision?c:p,this._testInsidePolygon){let t=0-this._graphicOriginX-this._offsetX-this._stepX,s=i-this._graphicOriginX-this._offsetX+this._stepX,e=-i-this._graphicOriginY-this._offsetY-this._stepY,h=0-this._graphicOriginY-this._offsetY+this._stepY;if(g){const i=[[t,e],[t,h],[s,e],[s,h]];t=e=Number.MAX_VALUE,s=h=-Number.MAX_VALUE;for(const n of i){const i=this._cosAngle*n[0]-this._sinAngle*n[1],_=this._sinAngle*n[0]+this._cosAngle*n[1];t=Math.min(t,i),s=Math.max(s,i),e=Math.min(e,_),h=Math.max(h,_)}}a=a!==Number.MAX_VALUE?Math.max(a,t):t,o=o!==Number.MAX_VALUE?Math.max(o,e):e,l=l!==-Number.MAX_VALUE?Math.min(l,s):s,f=f!==-Number.MAX_VALUE?Math.min(f,h):h}this._xMin=Math.round(a/this._stepX),this._xMax=Math.round(l/this._stepX),this._yMin=Math.round(o/this._stepY),this._yMax=Math.round(f/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,p,M,c,u)}_buildAccelerationMap(t,s,h,n,_){t.reset();const r=new Map,a=this._verticalSubdivision,l=a?_-n:h-s;let f=Math.ceil(l/e);if(f<=1)return;const c=Math.floor(l/f);let u,p,M,g,d,X,m,x,A,Y,y;for(f++,this._delta=c,a?(A=-i-2*this._stepY,Y=2*this._stepY,y=n):(A=-2*this._stepX,Y=i+2*this._stepX,y=s);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,p=t.y;t.nextPoint();u=M,p=g){if(M=t.x,g=t.y,a){if(p===g||p<A&&g<A||p>Y&&g>Y)continue;d=Math.min(p,g),X=Math.max(p,g)}else{if(u===M||u<A&&M<A||u>Y&&M>Y)continue;d=Math.min(u,M),X=Math.max(u,M)}for(;d<X;)m=Math.floor((d-y)/c),o(m,u,p,M,g,r),d+=c;x=Math.floor((X-y)/c),x>m&&o(x,u,p,M,g,r)}this._accelerationMap=r}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const s=this._currentY*this._stepY+this._offsetY;let i,e;if(this._currentX++,"Random"===this._gridType){const n=(this._currentX%h+h)%h,_=(this._currentY%h+h)%h;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-r._randValues[_*h+n])*2/3,e=this._graphicOriginY+s+this._stepY*this._randomness*(.5-r._randValues[_*h+n+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*s,e=this._graphicOriginY-this._sinAngle*t+this._cosAngle*s;if(!this._testInsidePolygon||this._isInsidePolygon(i,e,this._geometryCursor))return this._internalPlacement.setTranslate(i,e),this._internalPlacement}}_isInsidePolygon(t,s,i){if(null==this._accelerationMap)return a(t,s,i);t+=n,s+=n;const e=this._verticalSubdivision,h=e?s:t,_=Math.floor((h-this._polygonMin)/this._delta),r=this._accelerationMap.get(_);if(!r)return!1;let o,l,f,c=0;for(const n of r){if(o=n[0],l=n[1],e){if(o[1]>s==l[1]>s)continue;f=(l[0]-o[0])*(s-o[1])-(l[1]-o[1])*(t-o[0])}else{if(o[0]>t==l[0]>t)continue;f=(l[1]-o[1])*(t-o[0])-(l[0]-o[0])*(s-o[1])}f>0?c++:c--}return 0!==c}}function a(t,s,i){let e,h,_,r,a=0;for(t+=n,s+=n,i.reset();i.nextPath();)if(i.nextPoint())for(e=i.x,h=i.y;i.nextPoint();e=_,h=r){if(_=i.x,r=i.y,h>s==r>s)continue;(_-e)*(s-h)-(r-h)*(t-e)>0?a++:a--}return 0!==a}function o(t,s,i,e,h,n){let _=n.get(t);_||(_=[],n.set(t,_)),_.push([[s,i],[e,h]])}export{_ as PlacementInsidePolygon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const n=.001;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,n
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const n=.001;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,n){return new s(t,e,n)}}class s extends t{constructor(t,i,s){super(t),this._curveHelper=new e,this._angleToLine=void 0===i.angleToLine||i.angleToLine,this._offset=void 0!==i.offset?i.offset*s:0,this._relativeTo=i.relativeTo,this._position=void 0!==i.startPointOffset?i.startPointOffset*s:0,this._epsilon=n*s}processPath(t){const e=this._position;if("SegmentMidpoint"===this._relativeTo){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,n]=[t.x,t.y],[i,s]=[0,0];const r=[0,0];for(;t.nextPoint();){i=t.x,s=t.y;const o=this._curveHelper.getLength(e,n,i,s);if(o<this._epsilon){e=i,n=s;continue}const a=.5+this._position/o,[l,h]=this._curveHelper.getAngleCS(r,e,n,i,s,a),c=this._curveHelper.getCoord2D(e,n,i,s,a);return this.internalPlacement.setTranslate(c[0]-this._offset*h,c[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(l,h),this.internalPlacement}}return this.iteratePath=!1,null}const n="LineEnd"===this._relativeTo;return this.onLine(t,e,n)}onLine(t,e,n){let i,s=!1;switch(this._relativeTo){case"LineMiddle":default:t.seekPathStart(),i=t.pathLength()/2+e;break;case"LineBeginning":i=e;break;case"LineEnd":i=e,s=!0}n?t.seekPathEnd():t.seekPathStart();let r=0;if(n?t.prevPoint():t.nextPoint()){let[e,o]=[t.x,t.y],[a,l]=[0,0];const h=[0,0];for(;n?t.prevPoint():t.nextPoint();){a=t.x,l=t.y;const n=this._curveHelper.getLength(e,o,a,l);if(r+n>i){const t=(i-r)/n,[c,f]=this._curveHelper.getAngleCS(h,e,o,a,l,t),u=this._curveHelper.getCoord2D(e,o,a,l,t),_=s?-this._offset:this._offset;return this.internalPlacement.setTranslate(u[0]-_*f,u[1]+_*c),this._angleToLine&&(s?this.internalPlacement.setRotateCS(-c,-f):this.internalPlacement.setRotateCS(c,f)),this.internalPlacement}e=a,o=l,r+=n}}return null}}export{i as PlacementOnLine};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const s=1e-15;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,s
|
|
5
|
+
import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";const s=1e-15;class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,s){return new n(t,e,s)}}class n extends t{constructor(t,s,i){super(t),this._curveHelper=new e,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._offset=void 0!==s.offset?s.offset*i:0,this._endPoints=void 0===s.placeOnEndPoints||s.placeOnEndPoints,this._controlPoints=void 0===s.placeOnControlPoints||s.placeOnControlPoints,this._regularVertices=void 0===s.placeOnRegularVertices||s.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(0!==this._offset){const t=Math.cos(e[2]),n=Math.sin(e[2]);s-=this._offset*n,i+=this._offset*t}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let s=0,i=!1,n=0,a=0;if(t.seekPathStart(),t.nextPoint()){let r=t.x,h=t.y,l=t.getControlPoint(),_=!0,c=t.nextPoint();for(;c;){const g=t.x,P=t.y,u=t.getControlPoint();(this._angleToLine||0!==this._offset)&&(n=this._curveHelper.getAngle(r,h,g,P,0)),_?(_=!1,e?(s=n,i=l):(this._endPoints||this._controlPoints&&l)&&this._tags.push([r,h,n])):l?this._controlPoints&&this._tags.push([r,h,o(a,n)]):this._regularVertices&&this._tags.push([r,h,o(a,n)]),(this._angleToLine||0!==this._offset)&&(a=this._curveHelper.getAngle(r,h,g,P,1)),c=t.nextPoint(),c||(e?u||i?this._controlPoints&&this._tags.push([g,P,o(a,s)]):this._regularVertices&&this._tags.push([g,P,o(a,s)]):(this._endPoints||this._controlPoints&&u)&&this._tags.push([g,P,a])),r=g,h=P,l=u}}this._tagIterator=0}}function o(t,e){const i=Math.PI;for(;Math.abs(e-t)>i+2*s;)e-t>i?e-=2*i:e+=2*i;return(t+e)/2}export{i as PlacementOnVertices};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";import{weightedAreaCentroid as e}from"../../../geometry/support/centroid.js";import{getLabelPoint as s}from"../../../geometry/support/labelPoint.js";import{Placement as r}from"../CIMPlacements.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s
|
|
5
|
+
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";import{weightedAreaCentroid as e}from"../../../geometry/support/centroid.js";import{getLabelPoint as s}from"../../../geometry/support/labelPoint.js";import{Placement as r}from"../CIMPlacements.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new o(t,e,s)}}class o{constructor(t,e,s){this._geometryCursor=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?e.offsetY*s:0,this._method=void 0!==e.method?e.method:"OnPolygon",this._placementPerPart=void 0!==e.placePerPart&&e.placePerPart,this._internalPlacement=new r}next(){const t=this._geometryCursor;if(!t)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(t);for(;t.nextPath();)if(!(t.getCurrentRingArea()<0))return this._polygonCenter(t.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(r){let n=!1;switch(this._method){case"CenterOfMass":{const t=e(r);t&&(this._internalPlacement.setTranslate(t[0]+this._offsetX,t[1]+this._offsetY),n=!0)}break;case"BoundingBoxCenter":{const e=t(r);e&&(this._internalPlacement.setTranslate((e[2]+e[0])/2+this._offsetX,(e[3]+e[1])/2+this._offsetY),n=!0)}break;default:{const t=s(r);null!==t&&(this._internalPlacement.setTranslate(t[0]+this._offsetX,t[1]+this._offsetY),n=!0)}}return n?this._internalPlacement:null}}export{n as PlacementPolygonCenter};
|
package/symbols/cim/utils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const l=" /-,\n";function i(e){let t=e.length;for(;t--;)if(!l.includes(e.charAt(t)))return!1;return!0}function a(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,i(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const l=t[e.slice(n,o)];l&&r.push([null,l,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,i(t)])}return r}function c(e,t,r){let n="",o=null;for(const l of t){const[t,r,i]=l;if(null!=t&&""!==t)i?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",l=null;for(const i of t){const[t,n,a]=i;if(null!=t&&""!==t)a?l=t:(null!=l&&(o+=l,l=null),o+=t);else{let t=n;null!=r&&(t=W(n,r));const i=e.attributes[t];null!=i&&""!==i&&(null!=l&&(o+=l,l=null),o+=i)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,l,i=!0){const a=t/o,c=r/l,s=Math.ceil(a/2),u=Math.ceil(c/2);for(let f=0;f<l;f++)for(let r=0;r<o;r++){const M=4*(r+(i?l-f-1:f)*o);let y=0,m=0,C=0,I=0,p=0,h=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,l=(r+.5)*a,i=o*o;for(let c=Math.floor(r*a);c<(r+1)*a;c++){let r=Math.abs(l-(c+.5))/s;const o=Math.sqrt(i+r*r);o>=-1&&o<=1&&(y=2*o*o*o-3*o*o+1,y>0&&(r=4*(c+n*t),b+=y*e[r+3],C+=y,e[r+3]<255&&(y=y*e[r+3]/250),I+=y*e[r],p+=y*e[r+1],h+=y*e[r+2],m+=y))}}n[M]=I/m,n[M+1]=p/m,n[M+2]=h/m,n[M+3]=b/C}}function M(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function y(e){return e.data?.symbol??null}function m(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function I(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function p(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const h=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?M(e.tintColor):[255,255,255,1],S=e=>{if(!e)return!1;for(const t of e)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectDonut":case"CIMGeometricEffectOffset":case"CIMGeometricEffectTaperedPolygon":case"CIMGeometricEffectEnclosingPolygon":return!0}return!1};function g(){return import("../../geometry/geometryEngineJSON.js")}function P(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function T(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function A(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=A(t);if(null!=e)return e}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidFill":return e.color}return null}function N(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=N(e);if(null!=t)return t}break}case"CIMTextSymbol":return N(e.symbol);case"CIMSolidStroke":return e.color}}function x(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function G(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=G(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return G(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function E(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function F(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const V=e=>e.includes("data:image/svg+xml");function z(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function D(e,t,r,n,o,l,i=!0){const{infos:a}=l;let c=1,s=0,u=0,f=0,M=1;for(const{absoluteAnchorPoint:C,offsetX:I,offsetY:p,rotation:h,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:S}of a){M=C?1:c;u=K(I,p,s,M,u),f=$(I,p,s,M,f),d&&(S||i)&&(c*=b/d),s=Q(h,k,s)}const y=K(n,o,s,M,u),m=$(n,o,s,M,f);return{size:e*c,rotation:Q(t,r,s),offsetX:y,offsetY:m}}function j(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>j(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function q(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function B(e){return e.split(" ").map(e=>Number(e))}function R(e){return"string"==typeof e?B(e):e}function H(e){return e?.dashTemplate&&(e.dashTemplate=R(e.dashTemplate)),e}function J(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return J(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return J(e.symbol)}}return"Normal"}function U(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&p(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function W(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function X(e){return e.map(e=>({...e,propertyName:O(e.propertyName)}))}function Y(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function $(e,t,r,n,o){const l=r*Math.PI/180;if(l){const r=Math.cos(l);return(Math.sin(l)*e+r*t)*n+o}return t*n+o}function K(e,t,r,n,o){const l=r*Math.PI/180;if(l){return(Math.cos(l)*e-Math.sin(l)*t)*n+o}return e*n+o}function Q(e,t,r){return t?r-e:r+e}function Z(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let l=t[O(r)];if(null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180)),null==l&&(l=q(t.type,r.toLowerCase()),null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]]:o&&(l*=Math.PI/180))),null!=t.primitiveName){const i=e[t.primitiveName];if(null!=i){const e=i[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(l=e,null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180))):(l={valueExpressionInfo:e,defaultValue:l},null!=l&&(n?l={type:"Process",op:"ArcadeColor",value:l}:o&&(l={type:"Process",op:"Divide",left:l,right:180/Math.PI}))))}}if(null==l)throw new Error(`Failed to derive a value or an expression for "${r}".`);return l}function _(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function ee(e,t){return Math.max(Math.min((e??t)/100,1),0)}export{u as adjustTextCase,a as analyzeTextParts,D as applyParentTransform,s as assignTextValuesFromFeature,F as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,T as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,E as fromCIMVerticalAlignment,q as getDefaultCIMValue,d as getEnum,W as getFieldName,A as getFillColor,P as getFontStyle,w as getFontWeight,h as getNumericValue,Z as getProcessParam,ee as getRelativeGradientSize,U as getSize,N as getStrokeColor,G as getStrokeWidth,J as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,_ as hasProcessParam,x as hasStrokeLayer,g as importGeometryEngine,I as isCIMFill,m as isCIMMarker,p as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,S as isGeometryEngineRequired,V as isSVGImage,j as isValidCIMValue,z as mapCIMSymbolToGeometryType,M as normalizeAlpha,H as normalizeDashEffectTemplate,R as normalizeDashTemplate,X as normalizePrimitiveOverrideProps,B as parseDashTemplate,f as resampleHermite,y as toCIMSymbolJSON,Y as toLowerCaseProps,O as uncapitalize};
|
|
5
|
+
import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const l=" /-,\n";function i(e){let t=e.length;for(;t--;)if(!l.includes(e.charAt(t)))return!1;return!0}function a(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,i(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const l=t[e.slice(n,o)];l&&r.push([null,l,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,i(t)])}return r}function s(e,t,r){let n="",o=null;for(const l of t){const[t,r,i]=l;if(null!=t&&""!==t)i?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function c(e,t,r,n){let o="",l=null;for(const i of t){const[t,n,a]=i;if(null!=t&&""!==t)a?l=t:(null!=l&&(o+=l,l=null),o+=t);else{let t=n;null!=r&&(t=W(n,r));const i=e.attributes[t];null!=i&&""!==i&&(null!=l&&(o+=l,l=null),o+=i)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,l,i=!0){const a=t/o,s=r/l,c=Math.ceil(a/2),u=Math.ceil(s/2);for(let f=0;f<l;f++)for(let r=0;r<o;r++){const y=4*(r+(i?l-f-1:f)*o);let M=0,m=0,C=0,p=0,h=0,I=0,b=0;const d=(f+.5)*s;for(let n=Math.floor(f*s);n<(f+1)*s;n++){const o=Math.abs(d-(n+.5))/u,l=(r+.5)*a,i=o*o;for(let s=Math.floor(r*a);s<(r+1)*a;s++){let r=Math.abs(l-(s+.5))/c;const o=Math.sqrt(i+r*r);o>=-1&&o<=1&&(M=2*o*o*o-3*o*o+1,M>0&&(r=4*(s+n*t),b+=M*e[r+3],C+=M,e[r+3]<255&&(M=M*e[r+3]/250),p+=M*e[r],h+=M*e[r+1],I+=M*e[r+2],m+=M))}}n[y]=p/m,n[y+1]=h/m,n[y+2]=I/m,n[y+3]=b/C}}function y(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function M(e){return e.data?.symbol??null}function m(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function p(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function h(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const I=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?y(e.tintColor):[255,255,255,1];class S{constructor(e){this._import=e}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(e=>this.module=e)),this._promise}}function g(e){return new S(e)}const P=g(()=>import("../../geometry/geometryEngineJSON.js"));function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function L(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function A(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function N(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function T(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=T(t);if(null!=e)return e}break;case"CIMTextSymbol":return T(e.symbol);case"CIMSolidFill":return e.color}return null}function x(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=x(e);if(null!=t)return t}break}case"CIMTextSymbol":return x(e.symbol);case"CIMSolidStroke":return e.color}}function v(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function F(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=F(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return F(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function V(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function z(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function G(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const O=e=>e.includes("data:image/svg+xml");function D(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function E(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function j(e,t,r,n,o,l,i=!0){const{infos:a}=l;let s=1,c=0,u=0,f=0,y=1;for(const{absoluteAnchorPoint:C,offsetX:p,offsetY:h,rotation:I,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:S}of a){y=C?1:s;u=K(p,h,c,y,u),f=$(p,h,c,y,f),d&&(S||i)&&(s*=b/d),c=Q(I,k,c)}const M=K(n,o,c,y,u),m=$(n,o,c,y,f);return{size:e*s,rotation:Q(t,r,c),offsetX:M,offsetY:m}}function q(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>q(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function R(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function _(e){return e.split(" ").map(e=>Number(e))}function B(e){return"string"==typeof e?_(e):e}function H(e){return e?.dashTemplate&&(e.dashTemplate=B(e.dashTemplate)),e}function J(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return J(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return J(e.symbol)}}return"Normal"}function U(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&h(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function W(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function X(e){return e.map(e=>({...e,propertyName:E(e.propertyName)}))}function Y(e){const t={};for(const r in e){const n=e[r];t[E(r)]=n}return t}function $(e,t,r,n,o){const l=r*Math.PI/180;if(l){const r=Math.cos(l);return(Math.sin(l)*e+r*t)*n+o}return t*n+o}function K(e,t,r,n,o){const l=r*Math.PI/180;if(l){return(Math.cos(l)*e-Math.sin(l)*t)*n+o}return e*n+o}function Q(e,t,r){return t?r-e:r+e}function Z(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let l=t[E(r)];if(null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180)),null==l&&(l=R(t.type,r.toLowerCase()),null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]]:o&&(l*=Math.PI/180))),null!=t.primitiveName){const i=e[t.primitiveName];if(null!=i){const e=i[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(l=e,null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180))):(l={valueExpressionInfo:e,defaultValue:l},null!=l&&(n?l={type:"Process",op:"ArcadeColor",value:l}:o&&(l={type:"Process",op:"Divide",left:l,right:180/Math.PI}))))}}if(null==l)throw new Error(`Failed to derive a value or an expression for "${r}".`);return l}function ee(e,t,r){if(null!=t[E(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function te(e,t){return Math.max(Math.min((e??t)/100,1),0)}export{u as adjustTextCase,a as analyzeTextParts,j as applyParentTransform,c as assignTextValuesFromFeature,G as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,N as fromCIMFontDecoration,A as fromCIMFontStyle,V as fromCIMHorizontalAlignment,z as fromCIMVerticalAlignment,R as getDefaultCIMValue,d as getEnum,W as getFieldName,T as getFillColor,w as getFontStyle,L as getFontWeight,I as getNumericValue,Z as getProcessParam,te as getRelativeGradientSize,U as getSize,x as getStrokeColor,F as getStrokeWidth,J as getTextCasing,s as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,ee as hasProcessParam,v as hasStrokeLayer,g as importLazily,p as isCIMFill,m as isCIMMarker,h as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,O as isSVGImage,q as isValidCIMValue,P as lazyGeometryEngine,D as mapCIMSymbolToGeometryType,y as normalizeAlpha,H as normalizeDashEffectTemplate,B as normalizeDashTemplate,X as normalizePrimitiveOverrideProps,_ as parseDashTemplate,f as resampleHermite,M as toCIMSymbolJSON,Y as toLowerCaseProps,E as uncapitalize};
|