123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- import {
- m,
- p
- } from "./chunk-FNA5GLRW.js";
- import {
- a
- } from "./chunk-MCWCB5IY.js";
- import {
- s as s2
- } from "./chunk-HZRKBTHJ.js";
- import {
- e,
- l3 as l,
- n5 as n,
- y3 as y
- } from "./chunk-2Z2TG5CU.js";
- import {
- s2 as s
- } from "./chunk-E5O6P5I2.js";
- // node_modules/@arcgis/core/rest/support/ClassificationDefinition.js
- var c = new s2({ classBreaksDef: "class-breaks-definition", uniqueValueDef: "unique-value-definition" });
- var l2 = class extends l {
- constructor() {
- super(...arguments), this.baseSymbol = null, this.colorRamp = null, this.type = null;
- }
- };
- 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);
- var m2 = l2;
- // node_modules/@arcgis/core/rest/support/ClassBreaksDefinition.js
- var o = new s2({ esriClassifyEqualInterval: "equal-interval", esriClassifyManual: "manual", esriClassifyNaturalBreaks: "natural-breaks", esriClassifyQuantile: "quantile", esriClassifyStandardDeviation: "standard-deviation", esriClassifyDefinedInterval: "defined-interval" });
- var a2 = new s2({ esriNormalizeByLog: "log", esriNormalizeByPercentOfTotal: "percent-of-total", esriNormalizeByField: "field" });
- var n2 = class extends m2 {
- constructor() {
- super(...arguments), this.breakCount = null, this.classificationField = null, this.classificationMethod = null, this.normalizationField = null, this.normalizationType = null, this.type = "class-breaks-definition";
- }
- set standardDeviationInterval(e2) {
- "standard-deviation" === this.classificationMethod && this._set("standardDeviationInterval", e2);
- }
- set definedInterval(e2) {
- "defined-interval" === this.classificationMethod && this._set("definedInterval", e2);
- }
- };
- 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);
- var l3 = n2;
- // node_modules/@arcgis/core/rest/support/generateRendererUtils.js
- var t = s.getLogger("esri.rest.support.generateRendererUtils");
- function l4(e2, t2) {
- return Number(e2.toFixed(t2));
- }
- function a3(e2) {
- const { normalizationTotal: t2 } = e2;
- return { classBreaks: u(e2), normalizationTotal: t2 };
- }
- function u(e2) {
- const t2 = e2.definition, { classificationMethod: n3, breakCount: a4, normalizationType: u2, definedInterval: i2 } = t2, c3 = [];
- let b2 = e2.values;
- if (0 === b2.length)
- return [];
- b2 = b2.sort((e3, t3) => e3 - t3);
- const V = b2[0], p2 = b2[b2.length - 1];
- if ("equal-interval" === n3)
- if (b2.length >= a4) {
- const e3 = (p2 - V) / a4;
- let t3 = V;
- for (let n4 = 1; n4 < a4; n4++) {
- const a5 = l4(V + n4 * e3, 6);
- c3.push({ minValue: t3, maxValue: a5, label: s3(t3, a5, u2) }), t3 = a5;
- }
- c3.push({ minValue: t3, maxValue: p2, label: s3(t3, p2, u2) });
- } else
- b2.forEach((e3) => {
- c3.push({ minValue: e3, maxValue: e3, label: s3(e3, e3, u2) });
- });
- else if ("natural-breaks" === n3) {
- const t3 = o2(b2), n4 = e2.valueFrequency || t3.valueFrequency, i3 = r(t3.uniqueValues, n4, a4);
- let f2 = V;
- for (let e3 = 1; e3 < a4; e3++)
- if (t3.uniqueValues.length > e3) {
- const n5 = l4(t3.uniqueValues[i3[e3]], 6);
- c3.push({ minValue: f2, maxValue: n5, label: s3(f2, n5, u2) }), f2 = n5;
- }
- c3.push({ minValue: f2, maxValue: p2, label: s3(f2, p2, u2) });
- } else if ("quantile" === n3)
- if (b2.length >= a4 && V !== p2) {
- let e3 = V, t3 = Math.ceil(b2.length / a4), l5 = 0;
- for (let n4 = 1; n4 < a4; n4++) {
- let o3 = t3 + l5 - 1;
- 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));
- }
- c3.push({ minValue: e3, maxValue: p2, label: s3(e3, p2, u2) });
- } else {
- let e3 = -1;
- for (let t3 = 0; t3 < b2.length; t3++) {
- const l5 = b2[t3];
- l5 !== e3 && (e3 = l5, c3.push({ minValue: e3, maxValue: l5, label: s3(e3, l5, u2) }), e3 = l5);
- }
- }
- else if ("standard-deviation" === n3) {
- const e3 = h(b2), t3 = m3(b2, e3);
- if (0 === t3)
- c3.push({ minValue: b2[0], maxValue: b2[0], label: s3(b2[0], b2[0], u2) });
- else {
- const n4 = f(V, p2, a4, e3, t3) * t3;
- let o3 = 0, r2 = V;
- for (let t4 = a4; t4 >= 1; t4--) {
- const a5 = l4(e3 - (t4 - 0.5) * n4, 6);
- c3.push({ minValue: r2, maxValue: a5, label: s3(r2, a5, u2) }), r2 = a5, o3++;
- }
- let i3 = l4(e3 + 0.5 * n4, 6);
- c3.push({ minValue: r2, maxValue: i3, label: s3(r2, i3, u2) }), r2 = i3, o3++;
- for (let t4 = 1; t4 <= a4; t4++)
- 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++;
- }
- } else if ("defined-interval" === n3) {
- if (!i2)
- return c3;
- const e3 = b2[0], t3 = b2[b2.length - 1], n4 = Math.ceil((t3 - e3) / i2);
- let a5 = e3;
- for (let o3 = 1; o3 < n4; o3++) {
- const t4 = l4(e3 + o3 * i2, 6);
- c3.push({ minValue: a5, maxValue: t4, label: s3(a5, t4, u2) }), a5 = t4;
- }
- c3.push({ minValue: a5, maxValue: t3, label: s3(a5, t3, u2) });
- }
- return c3;
- }
- function s3(e2, t2, l5) {
- let n3 = null;
- return n3 = e2 === t2 ? l5 && "percent-of-total" === l5 ? e2 + "%" : e2.toString() : l5 && "percent-of-total" === l5 ? e2 + "% - " + t2 + "%" : e2 + " - " + t2, n3;
- }
- function o2(e2) {
- const t2 = [], l5 = [];
- let n3 = Number.MIN_VALUE, a4 = 1, u2 = -1;
- for (let s4 = 0; s4 < e2.length; s4++) {
- const o3 = e2[s4];
- o3 === n3 ? (a4++, l5[u2] = a4) : null !== o3 && (t2.push(o3), n3 = o3, a4 = 1, l5.push(a4), u2++);
- }
- return { uniqueValues: t2, valueFrequency: l5 };
- }
- function r(e2, t2, l5) {
- const n3 = e2.length, a4 = [];
- l5 > n3 && (l5 = n3);
- for (let s4 = 0; s4 < l5; s4++)
- a4.push(Math.round(s4 * n3 / l5 - 1));
- a4.push(n3 - 1);
- let u2 = i(a4, e2, t2, l5);
- return c2(u2.mean, u2.sdcm, a4, e2, t2, l5) && (u2 = i(a4, e2, t2, l5)), a4;
- }
- function i(e2, t2, l5, n3) {
- let a4 = [], u2 = [], s4 = [], o3 = 0;
- const r2 = [], i2 = [];
- for (let m4 = 0; m4 < n3; m4++) {
- const n4 = b(m4, e2, t2, l5);
- r2.push(n4.sbMean), i2.push(n4.sbSdcm), o3 += i2[m4];
- }
- let c3, f2 = o3, h2 = true;
- for (; h2 || o3 < f2; ) {
- h2 = false, a4 = [];
- for (let t3 = 0; t3 < n3; t3++)
- a4.push(e2[t3]);
- for (let l6 = 0; l6 < n3; l6++)
- for (let a5 = e2[l6] + 1; a5 <= e2[l6 + 1]; a5++)
- if (c3 = t2[a5], l6 > 0 && a5 !== e2[l6 + 1] && Math.abs(c3 - r2[l6]) > Math.abs(c3 - r2[l6 - 1]))
- e2[l6] = a5;
- else if (l6 < n3 - 1 && e2[l6] !== a5 - 1 && Math.abs(c3 - r2[l6]) > Math.abs(c3 - r2[l6 + 1])) {
- e2[l6 + 1] = a5 - 1;
- break;
- }
- f2 = o3, o3 = 0, u2 = [], s4 = [];
- for (let a5 = 0; a5 < n3; a5++) {
- u2.push(r2[a5]), s4.push(i2[a5]);
- const n4 = b(a5, e2, t2, l5);
- r2[a5] = n4.sbMean, i2[a5] = n4.sbSdcm, o3 += i2[a5];
- }
- }
- if (o3 > f2) {
- for (let t3 = 0; t3 < n3; t3++)
- e2[t3] = a4[t3], r2[t3] = u2[t3], i2[t3] = s4[t3];
- o3 = f2;
- }
- return { mean: r2, sdcm: i2 };
- }
- function c2(e2, t2, l5, n3, a4, u2) {
- let s4 = 0, o3 = 0, r2 = 0, i2 = 0, c3 = true;
- for (let f2 = 0; f2 < 2 && c3; f2++) {
- 0 === f2 && (c3 = false);
- for (let f3 = 0; f3 < u2 - 1; f3++)
- for (; l5[f3 + 1] + 1 !== l5[f3 + 2]; ) {
- l5[f3 + 1] = l5[f3 + 1] + 1;
- const u3 = b(f3, l5, n3, a4);
- r2 = u3.sbMean, s4 = u3.sbSdcm;
- const h2 = b(f3 + 1, l5, n3, a4);
- if (i2 = h2.sbMean, o3 = h2.sbSdcm, !(s4 + o3 < t2[f3] + t2[f3 + 1])) {
- l5[f3 + 1] = l5[f3 + 1] - 1;
- break;
- }
- t2[f3] = s4, t2[f3 + 1] = o3, e2[f3] = r2, e2[f3 + 1] = i2, c3 = true;
- }
- for (let f3 = u2 - 1; f3 > 0; f3--)
- for (; l5[f3] !== l5[f3 - 1] + 1; ) {
- l5[f3] = l5[f3] - 1;
- const u3 = b(f3 - 1, l5, n3, a4);
- r2 = u3.sbMean, s4 = u3.sbSdcm;
- const h2 = b(f3, l5, n3, a4);
- if (i2 = h2.sbMean, o3 = h2.sbSdcm, !(s4 + o3 < t2[f3 - 1] + t2[f3])) {
- l5[f3] = l5[f3] + 1;
- break;
- }
- t2[f3 - 1] = s4, t2[f3] = o3, e2[f3 - 1] = r2, e2[f3] = i2, c3 = true;
- }
- }
- return c3;
- }
- function f(e2, t2, l5, n3, a4) {
- let u2 = Math.max(n3 - e2, t2 - n3) / a4 / l5;
- return u2 = u2 >= 1 ? 1 : u2 >= 0.5 ? 0.5 : 0.25, u2;
- }
- function h(e2) {
- let t2 = 0;
- for (let l5 = 0; l5 < e2.length; l5++)
- t2 += e2[l5];
- return t2 /= e2.length, t2;
- }
- function m3(e2, t2) {
- let l5 = 0;
- for (let n3 = 0; n3 < e2.length; n3++) {
- const a4 = e2[n3];
- l5 += (a4 - t2) * (a4 - t2);
- }
- l5 /= e2.length;
- return Math.sqrt(l5);
- }
- function b(e2, l5, n3, a4) {
- let u2 = 0, s4 = 0;
- for (let t2 = l5[e2] + 1; t2 <= l5[e2 + 1]; t2++) {
- const e3 = a4[t2];
- u2 += n3[t2] * e3, s4 += e3;
- }
- s4 <= 0 && t.warn("Exception in Natural Breaks calculation");
- const o3 = u2 / s4;
- let r2 = 0;
- for (let t2 = l5[e2] + 1; t2 <= l5[e2 + 1]; t2++)
- r2 += a4[t2] * (n3[t2] - o3) ** 2;
- return { sbMean: o3, sbSdcm: r2 };
- }
- export {
- l3 as l,
- a3 as a
- };
- //# sourceMappingURL=chunk-ULSPZIPE.js.map
|