chunk-ULSPZIPE.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. import {
  2. m,
  3. p
  4. } from "./chunk-FNA5GLRW.js";
  5. import {
  6. a
  7. } from "./chunk-MCWCB5IY.js";
  8. import {
  9. s as s2
  10. } from "./chunk-HZRKBTHJ.js";
  11. import {
  12. e,
  13. l3 as l,
  14. n5 as n,
  15. y3 as y
  16. } from "./chunk-2Z2TG5CU.js";
  17. import {
  18. s2 as s
  19. } from "./chunk-E5O6P5I2.js";
  20. // node_modules/@arcgis/core/rest/support/ClassificationDefinition.js
  21. var c = new s2({ classBreaksDef: "class-breaks-definition", uniqueValueDef: "unique-value-definition" });
  22. var l2 = class extends l {
  23. constructor() {
  24. super(...arguments), this.baseSymbol = null, this.colorRamp = null, this.type = null;
  25. }
  26. };
  27. e([y({ type: a, json: { write: true } })], l2.prototype, "baseSymbol", void 0), e([y({ types: m, json: { read: { reader: p }, write: true } })], l2.prototype, "colorRamp", void 0), e([y({ json: { read: c.read, write: c.write } })], l2.prototype, "type", void 0), l2 = e([n("esri.rest.support.ClassificationDefinition")], l2);
  28. var m2 = l2;
  29. // node_modules/@arcgis/core/rest/support/ClassBreaksDefinition.js
  30. var o = new s2({ esriClassifyEqualInterval: "equal-interval", esriClassifyManual: "manual", esriClassifyNaturalBreaks: "natural-breaks", esriClassifyQuantile: "quantile", esriClassifyStandardDeviation: "standard-deviation", esriClassifyDefinedInterval: "defined-interval" });
  31. var a2 = new s2({ esriNormalizeByLog: "log", esriNormalizeByPercentOfTotal: "percent-of-total", esriNormalizeByField: "field" });
  32. var n2 = class extends m2 {
  33. constructor() {
  34. super(...arguments), this.breakCount = null, this.classificationField = null, this.classificationMethod = null, this.normalizationField = null, this.normalizationType = null, this.type = "class-breaks-definition";
  35. }
  36. set standardDeviationInterval(e2) {
  37. "standard-deviation" === this.classificationMethod && this._set("standardDeviationInterval", e2);
  38. }
  39. set definedInterval(e2) {
  40. "defined-interval" === this.classificationMethod && this._set("definedInterval", e2);
  41. }
  42. };
  43. e([y({ json: { write: true } })], n2.prototype, "breakCount", void 0), e([y({ json: { write: true } })], n2.prototype, "classificationField", void 0), e([y({ type: String, json: { read: o.read, write: o.write } })], n2.prototype, "classificationMethod", void 0), e([y({ json: { write: true } })], n2.prototype, "normalizationField", void 0), e([y({ json: { read: a2.read, write: a2.write } })], n2.prototype, "normalizationType", void 0), e([y({ value: null, json: { write: true } })], n2.prototype, "standardDeviationInterval", null), e([y({ value: null, json: { write: true } })], n2.prototype, "definedInterval", null), e([y()], n2.prototype, "type", void 0), n2 = e([n("esri.rest.support.ClassBreaksDefinition")], n2);
  44. var l3 = n2;
  45. // node_modules/@arcgis/core/rest/support/generateRendererUtils.js
  46. var t = s.getLogger("esri.rest.support.generateRendererUtils");
  47. function l4(e2, t2) {
  48. return Number(e2.toFixed(t2));
  49. }
  50. function a3(e2) {
  51. const { normalizationTotal: t2 } = e2;
  52. return { classBreaks: u(e2), normalizationTotal: t2 };
  53. }
  54. function u(e2) {
  55. const t2 = e2.definition, { classificationMethod: n3, breakCount: a4, normalizationType: u2, definedInterval: i2 } = t2, c3 = [];
  56. let b2 = e2.values;
  57. if (0 === b2.length)
  58. return [];
  59. b2 = b2.sort((e3, t3) => e3 - t3);
  60. const V = b2[0], p2 = b2[b2.length - 1];
  61. if ("equal-interval" === n3)
  62. if (b2.length >= a4) {
  63. const e3 = (p2 - V) / a4;
  64. let t3 = V;
  65. for (let n4 = 1; n4 < a4; n4++) {
  66. const a5 = l4(V + n4 * e3, 6);
  67. c3.push({ minValue: t3, maxValue: a5, label: s3(t3, a5, u2) }), t3 = a5;
  68. }
  69. c3.push({ minValue: t3, maxValue: p2, label: s3(t3, p2, u2) });
  70. } else
  71. b2.forEach((e3) => {
  72. c3.push({ minValue: e3, maxValue: e3, label: s3(e3, e3, u2) });
  73. });
  74. else if ("natural-breaks" === n3) {
  75. const t3 = o2(b2), n4 = e2.valueFrequency || t3.valueFrequency, i3 = r(t3.uniqueValues, n4, a4);
  76. let f2 = V;
  77. for (let e3 = 1; e3 < a4; e3++)
  78. if (t3.uniqueValues.length > e3) {
  79. const n5 = l4(t3.uniqueValues[i3[e3]], 6);
  80. c3.push({ minValue: f2, maxValue: n5, label: s3(f2, n5, u2) }), f2 = n5;
  81. }
  82. c3.push({ minValue: f2, maxValue: p2, label: s3(f2, p2, u2) });
  83. } else if ("quantile" === n3)
  84. if (b2.length >= a4 && V !== p2) {
  85. let e3 = V, t3 = Math.ceil(b2.length / a4), l5 = 0;
  86. for (let n4 = 1; n4 < a4; n4++) {
  87. let o3 = t3 + l5 - 1;
  88. o3 > b2.length && (o3 = b2.length - 1), o3 < 0 && (o3 = 0), c3.push({ minValue: e3, maxValue: b2[o3], label: s3(e3, b2[o3], u2) }), e3 = b2[o3], l5 += t3, t3 = Math.ceil((b2.length - l5) / (a4 - n4));
  89. }
  90. c3.push({ minValue: e3, maxValue: p2, label: s3(e3, p2, u2) });
  91. } else {
  92. let e3 = -1;
  93. for (let t3 = 0; t3 < b2.length; t3++) {
  94. const l5 = b2[t3];
  95. l5 !== e3 && (e3 = l5, c3.push({ minValue: e3, maxValue: l5, label: s3(e3, l5, u2) }), e3 = l5);
  96. }
  97. }
  98. else if ("standard-deviation" === n3) {
  99. const e3 = h(b2), t3 = m3(b2, e3);
  100. if (0 === t3)
  101. c3.push({ minValue: b2[0], maxValue: b2[0], label: s3(b2[0], b2[0], u2) });
  102. else {
  103. const n4 = f(V, p2, a4, e3, t3) * t3;
  104. let o3 = 0, r2 = V;
  105. for (let t4 = a4; t4 >= 1; t4--) {
  106. const a5 = l4(e3 - (t4 - 0.5) * n4, 6);
  107. c3.push({ minValue: r2, maxValue: a5, label: s3(r2, a5, u2) }), r2 = a5, o3++;
  108. }
  109. let i3 = l4(e3 + 0.5 * n4, 6);
  110. c3.push({ minValue: r2, maxValue: i3, label: s3(r2, i3, u2) }), r2 = i3, o3++;
  111. for (let t4 = 1; t4 <= a4; t4++)
  112. i3 = o3 === 2 * a4 ? p2 : l4(e3 + (t4 + 0.5) * n4, 6), c3.push({ minValue: r2, maxValue: i3, label: s3(r2, i3, u2) }), r2 = i3, o3++;
  113. }
  114. } else if ("defined-interval" === n3) {
  115. if (!i2)
  116. return c3;
  117. const e3 = b2[0], t3 = b2[b2.length - 1], n4 = Math.ceil((t3 - e3) / i2);
  118. let a5 = e3;
  119. for (let o3 = 1; o3 < n4; o3++) {
  120. const t4 = l4(e3 + o3 * i2, 6);
  121. c3.push({ minValue: a5, maxValue: t4, label: s3(a5, t4, u2) }), a5 = t4;
  122. }
  123. c3.push({ minValue: a5, maxValue: t3, label: s3(a5, t3, u2) });
  124. }
  125. return c3;
  126. }
  127. function s3(e2, t2, l5) {
  128. let n3 = null;
  129. return n3 = e2 === t2 ? l5 && "percent-of-total" === l5 ? e2 + "%" : e2.toString() : l5 && "percent-of-total" === l5 ? e2 + "% - " + t2 + "%" : e2 + " - " + t2, n3;
  130. }
  131. function o2(e2) {
  132. const t2 = [], l5 = [];
  133. let n3 = Number.MIN_VALUE, a4 = 1, u2 = -1;
  134. for (let s4 = 0; s4 < e2.length; s4++) {
  135. const o3 = e2[s4];
  136. o3 === n3 ? (a4++, l5[u2] = a4) : null !== o3 && (t2.push(o3), n3 = o3, a4 = 1, l5.push(a4), u2++);
  137. }
  138. return { uniqueValues: t2, valueFrequency: l5 };
  139. }
  140. function r(e2, t2, l5) {
  141. const n3 = e2.length, a4 = [];
  142. l5 > n3 && (l5 = n3);
  143. for (let s4 = 0; s4 < l5; s4++)
  144. a4.push(Math.round(s4 * n3 / l5 - 1));
  145. a4.push(n3 - 1);
  146. let u2 = i(a4, e2, t2, l5);
  147. return c2(u2.mean, u2.sdcm, a4, e2, t2, l5) && (u2 = i(a4, e2, t2, l5)), a4;
  148. }
  149. function i(e2, t2, l5, n3) {
  150. let a4 = [], u2 = [], s4 = [], o3 = 0;
  151. const r2 = [], i2 = [];
  152. for (let m4 = 0; m4 < n3; m4++) {
  153. const n4 = b(m4, e2, t2, l5);
  154. r2.push(n4.sbMean), i2.push(n4.sbSdcm), o3 += i2[m4];
  155. }
  156. let c3, f2 = o3, h2 = true;
  157. for (; h2 || o3 < f2; ) {
  158. h2 = false, a4 = [];
  159. for (let t3 = 0; t3 < n3; t3++)
  160. a4.push(e2[t3]);
  161. for (let l6 = 0; l6 < n3; l6++)
  162. for (let a5 = e2[l6] + 1; a5 <= e2[l6 + 1]; a5++)
  163. if (c3 = t2[a5], l6 > 0 && a5 !== e2[l6 + 1] && Math.abs(c3 - r2[l6]) > Math.abs(c3 - r2[l6 - 1]))
  164. e2[l6] = a5;
  165. else if (l6 < n3 - 1 && e2[l6] !== a5 - 1 && Math.abs(c3 - r2[l6]) > Math.abs(c3 - r2[l6 + 1])) {
  166. e2[l6 + 1] = a5 - 1;
  167. break;
  168. }
  169. f2 = o3, o3 = 0, u2 = [], s4 = [];
  170. for (let a5 = 0; a5 < n3; a5++) {
  171. u2.push(r2[a5]), s4.push(i2[a5]);
  172. const n4 = b(a5, e2, t2, l5);
  173. r2[a5] = n4.sbMean, i2[a5] = n4.sbSdcm, o3 += i2[a5];
  174. }
  175. }
  176. if (o3 > f2) {
  177. for (let t3 = 0; t3 < n3; t3++)
  178. e2[t3] = a4[t3], r2[t3] = u2[t3], i2[t3] = s4[t3];
  179. o3 = f2;
  180. }
  181. return { mean: r2, sdcm: i2 };
  182. }
  183. function c2(e2, t2, l5, n3, a4, u2) {
  184. let s4 = 0, o3 = 0, r2 = 0, i2 = 0, c3 = true;
  185. for (let f2 = 0; f2 < 2 && c3; f2++) {
  186. 0 === f2 && (c3 = false);
  187. for (let f3 = 0; f3 < u2 - 1; f3++)
  188. for (; l5[f3 + 1] + 1 !== l5[f3 + 2]; ) {
  189. l5[f3 + 1] = l5[f3 + 1] + 1;
  190. const u3 = b(f3, l5, n3, a4);
  191. r2 = u3.sbMean, s4 = u3.sbSdcm;
  192. const h2 = b(f3 + 1, l5, n3, a4);
  193. if (i2 = h2.sbMean, o3 = h2.sbSdcm, !(s4 + o3 < t2[f3] + t2[f3 + 1])) {
  194. l5[f3 + 1] = l5[f3 + 1] - 1;
  195. break;
  196. }
  197. t2[f3] = s4, t2[f3 + 1] = o3, e2[f3] = r2, e2[f3 + 1] = i2, c3 = true;
  198. }
  199. for (let f3 = u2 - 1; f3 > 0; f3--)
  200. for (; l5[f3] !== l5[f3 - 1] + 1; ) {
  201. l5[f3] = l5[f3] - 1;
  202. const u3 = b(f3 - 1, l5, n3, a4);
  203. r2 = u3.sbMean, s4 = u3.sbSdcm;
  204. const h2 = b(f3, l5, n3, a4);
  205. if (i2 = h2.sbMean, o3 = h2.sbSdcm, !(s4 + o3 < t2[f3 - 1] + t2[f3])) {
  206. l5[f3] = l5[f3] + 1;
  207. break;
  208. }
  209. t2[f3 - 1] = s4, t2[f3] = o3, e2[f3 - 1] = r2, e2[f3] = i2, c3 = true;
  210. }
  211. }
  212. return c3;
  213. }
  214. function f(e2, t2, l5, n3, a4) {
  215. let u2 = Math.max(n3 - e2, t2 - n3) / a4 / l5;
  216. return u2 = u2 >= 1 ? 1 : u2 >= 0.5 ? 0.5 : 0.25, u2;
  217. }
  218. function h(e2) {
  219. let t2 = 0;
  220. for (let l5 = 0; l5 < e2.length; l5++)
  221. t2 += e2[l5];
  222. return t2 /= e2.length, t2;
  223. }
  224. function m3(e2, t2) {
  225. let l5 = 0;
  226. for (let n3 = 0; n3 < e2.length; n3++) {
  227. const a4 = e2[n3];
  228. l5 += (a4 - t2) * (a4 - t2);
  229. }
  230. l5 /= e2.length;
  231. return Math.sqrt(l5);
  232. }
  233. function b(e2, l5, n3, a4) {
  234. let u2 = 0, s4 = 0;
  235. for (let t2 = l5[e2] + 1; t2 <= l5[e2 + 1]; t2++) {
  236. const e3 = a4[t2];
  237. u2 += n3[t2] * e3, s4 += e3;
  238. }
  239. s4 <= 0 && t.warn("Exception in Natural Breaks calculation");
  240. const o3 = u2 / s4;
  241. let r2 = 0;
  242. for (let t2 = l5[e2] + 1; t2 <= l5[e2 + 1]; t2++)
  243. r2 += a4[t2] * (n3[t2] - o3) ** 2;
  244. return { sbMean: o3, sbSdcm: r2 };
  245. }
  246. export {
  247. l3 as l,
  248. a3 as a
  249. };
  250. //# sourceMappingURL=chunk-ULSPZIPE.js.map