@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.03 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import a from"../SmartMappingPrimaryHandleSliderViewModel.js";let r=class extends a{constructor(e){super(e),this.persistSizeRangeEnabled=!1}set stops(e){super.stops=e}updateStops(e){const{primaryHandleEnabled:t,persistSizeRangeEnabled:s,stops:a}=this,r=this.getValuesFromStops();if(!r?.length)return;if(e.sort((e,t)=>e.value>t.value?1:-1).forEach(e=>{r[e.index]=e.value}),a.forEach((e,t)=>e.value=r[t]),t&&s){const{stops:e}=this,t=this.getValuesFromStops(),s=e.map(e=>e.size),a=Math.max(...s),r=Math.min(...s),i=Math.max(...t),o=Math.min(...t),p=e[5===e.length?2:1].value,l=Math.abs(i-p),n=Math.abs(o-p),d=l>n?l:n,h=a-r;if(0===d)return;e.forEach(e=>{e.size=Math.abs(e.value-p)/d*h+r})}}};e([t()],r.prototype,"persistSizeRangeEnabled",void 0),r=e([s("esri.widgets.smartMapping.SizeSlider.SizeSliderViewModel")],r);const i=r;export{i as default};