12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Color.js";import{binaryFindClosest as o}from"../../core/arrayUtils.js";import i from"../../core/Evented.js";import{handlesGroup as r}from"../../core/handleUtils.js";import{isSome as s,applySome as l,isNone as n}from"../../core/maybe.js";import{memoize as p}from"../../core/memoize.js";import{watch as a,syncAndInitial as u,sync as h}from"../../core/reactiveUtils.js";import{generateUUID as m}from"../../core/uuid.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import v from"../../geometry/Point.js";import{getConfig as f}from"./support/constants.js";import{convertSamples as y,convertStatistics as g}from"./support/unitUtils.js";let b=class extends i.EventedAccessor{constructor(t){super(t),this.type=null,this.id=m(),this.title=null,this.color=new e("#000000"),this.visible=!0,this._getSamplesMemoized=p(((t,e)=>y(t,e))),this._getStatisticsMemoized=p(((t,e)=>g(t,e))),this.viewVisualizationEnabled=!0,this.result=null,this.effectiveUnits=null,this.numSamplesForPreview=30,this.numSamplesPerChunk=200,this.chartFillEnabled=!0,this.chartStrokeWidth=1.5,this.chartStrokeOffsetY=0}get progress(){return s(this.result)&&this.visible?this.result.progress:0}get samples(){return this._getSamplesMemoized(this.result,this.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.result,this.effectiveUnits)}get hoveredPoint(){return l(this._viewModel.hoveredChartPosition,(t=>this._getPoint(t)))}get available(){return!0}get hasZ(){const t=this.result;return s(t)&&t.hasZ}get minDemResolution(){return f().defaultDemResolution}queryElevation(){throw new Error("not implemented")}attach(t){return this._viewModel=t,r([a((()=>t.effectiveUnits),(t=>{this.effectiveUnits=t}),u),a((()=>[t.input]),(()=>this._onChange()),h)])}toggleVisibility(t){this.visible=void 0===t?!this.visible:t}_onChange(){this.emit("change")}_getPoint(t){const{samples:e,result:i}=this;if(n(e)||n(i))return null;const r=e.length;if(0===r)return null;const s=t*e[r-1].distance,{x:l,y:p,z:a}=o(e,s,(t=>t.distance));return n(a)?null:new v({x:l,y:p,z:a,spatialReference:i.spatialReference})}};t([c({nonNullable:!0})],b.prototype,"id",void 0),t([c({nonNullable:!0})],b.prototype,"title",void 0),t([c({type:e,nonNullable:!0})],b.prototype,"color",void 0),t([c({nonNullable:!0})],b.prototype,"visible",void 0),t([c({readOnly:!0})],b.prototype,"progress",null),t([c({readOnly:!0})],b.prototype,"samples",null),t([c({readOnly:!0})],b.prototype,"statistics",null),t([c()],b.prototype,"hoveredPoint",null),t([c()],b.prototype,"viewVisualizationEnabled",void 0),t([c()],b.prototype,"available",null),t([c()],b.prototype,"result",void 0),t([c()],b.prototype,"effectiveUnits",void 0),t([c()],b.prototype,"numSamplesForPreview",void 0),t([c()],b.prototype,"numSamplesPerChunk",void 0),t([c()],b.prototype,"chartFillEnabled",void 0),t([c()],b.prototype,"chartStrokeWidth",void 0),t([c()],b.prototype,"chartStrokeOffsetY",void 0),t([c({readOnly:!0})],b.prototype,"hasZ",null),t([c({readOnly:!0})],b.prototype,"minDemResolution",null),t([c()],b.prototype,"_viewModel",void 0),b=t([d("esri.widgets.ElevationProfile.ElevationProfileLine")],b);const j=b;export{j as default};
|