UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 627 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{getStretchStopLabel as t,getTitle as e,isRendererTitle as r}from"../../support/styleUtils.js";function l(e,r,l){switch(r){case"heatmap-ramp":return l[e.label]||e.label;case"stretch-ramp":return t(e,l);default:return e.label}}function i(t,l){if(!t.title||"string"==typeof t.title)return t.title;const i="color-ramp"===t.type||"opacity-ramp"===t.type,a=t.title,p=e(l,a,i);return r(a,i)&&a.title?`${a.title} (${p})`:p}export{i as getLegendElementTitle,l as getRampStopLabel};