@record-evolution/widget-linechart 1.6.27 → 1.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -30
- package/dist/widget-linechart.js +247 -234
- package/dist/widget-linechart.js.map +1 -1
- package/package.json +5 -1
- package/src/definition-schema.d.ts +2 -2
- package/src/definition-schema.json +11 -1
- package/src/widget-linechart.ts +27 -16
package/dist/widget-linechart.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as W from "echarts/core";
|
|
2
2
|
import { GridComponent as ft, TitleComponent as $t, ToolboxComponent as gt, TooltipComponent as yt, LegendComponent as vt, DataZoomComponent as xt } from "echarts/components";
|
|
3
3
|
import { LineChart as _t, BarChart as At, ScatterChart as bt } from "echarts/charts";
|
|
4
4
|
import { UniversalTransition as wt, LegacyGridContainLabel as Ct } from "echarts/features";
|
|
5
5
|
import { CanvasRenderer as St } from "echarts/renderers";
|
|
6
6
|
import X from "tinycolor2";
|
|
7
|
-
const
|
|
8
|
-
let
|
|
7
|
+
const z = globalThis, q = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, V = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
let lt = class {
|
|
9
9
|
constructor(t, e, i) {
|
|
10
|
-
if (this._$cssResult$ = !0, i !==
|
|
10
|
+
if (this._$cssResult$ = !0, i !== V) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
11
11
|
this.cssText = t, this.t = e;
|
|
12
12
|
}
|
|
13
13
|
get styleSheet() {
|
|
14
14
|
let t = this.o;
|
|
15
15
|
const e = this.t;
|
|
16
|
-
if (
|
|
16
|
+
if (q && t === void 0) {
|
|
17
17
|
const i = e !== void 0 && e.length === 1;
|
|
18
|
-
i && (t =
|
|
18
|
+
i && (t = F.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && F.set(e, t));
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
@@ -23,25 +23,25 @@ let ht = class {
|
|
|
23
23
|
return this.cssText;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const Et = (s) => new
|
|
27
|
-
const e = s.length === 1 ? s[0] : t.reduce((i, r,
|
|
28
|
-
if (
|
|
29
|
-
if (typeof
|
|
30
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
31
|
-
})(r) + s[
|
|
32
|
-
return new
|
|
26
|
+
const Et = (s) => new lt(typeof s == "string" ? s : s + "", void 0, V), Tt = (s, ...t) => {
|
|
27
|
+
const e = s.length === 1 ? s[0] : t.reduce((i, r, n) => i + ((o) => {
|
|
28
|
+
if (o._$cssResult$ === !0) return o.cssText;
|
|
29
|
+
if (typeof o == "number") return o;
|
|
30
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
31
|
+
})(r) + s[n + 1], s[0]);
|
|
32
|
+
return new lt(e, s, V);
|
|
33
33
|
}, Dt = (s, t) => {
|
|
34
|
-
if (
|
|
34
|
+
if (q) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
35
35
|
else for (const e of t) {
|
|
36
|
-
const i = document.createElement("style"), r =
|
|
36
|
+
const i = document.createElement("style"), r = z.litNonce;
|
|
37
37
|
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, Q = q ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
|
|
40
40
|
let e = "";
|
|
41
41
|
for (const i of t.cssRules) e += i.cssText;
|
|
42
42
|
return Et(e);
|
|
43
43
|
})(s) : s;
|
|
44
|
-
const { is: Ot, defineProperty: Pt, getOwnPropertyDescriptor: Lt, getOwnPropertyNames: Mt, getOwnPropertySymbols: Ut, getPrototypeOf: Nt } = Object,
|
|
44
|
+
const { is: Ot, defineProperty: Pt, getOwnPropertyDescriptor: Lt, getOwnPropertyNames: Mt, getOwnPropertySymbols: Ut, getPrototypeOf: Nt } = Object, j = globalThis, tt = j.trustedTypes, zt = tt ? tt.emptyScript : "", Ht = j.reactiveElementPolyfillSupport, O = (s, t) => s, H = { toAttribute(s, t) {
|
|
45
45
|
switch (t) {
|
|
46
46
|
case Boolean:
|
|
47
47
|
s = s ? zt : null;
|
|
@@ -69,43 +69,43 @@ const { is: Ot, defineProperty: Pt, getOwnPropertyDescriptor: Lt, getOwnProperty
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
return e;
|
|
72
|
-
} },
|
|
73
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
74
|
-
let
|
|
72
|
+
} }, Z = (s, t) => !Ot(s, t), et = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: Z };
|
|
73
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), j.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
74
|
+
let S = class extends HTMLElement {
|
|
75
75
|
static addInitializer(t) {
|
|
76
76
|
this._$Ei(), (this.l ??= []).push(t);
|
|
77
77
|
}
|
|
78
78
|
static get observedAttributes() {
|
|
79
79
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
80
80
|
}
|
|
81
|
-
static createProperty(t, e =
|
|
81
|
+
static createProperty(t, e = et) {
|
|
82
82
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
83
83
|
const i = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, i, e);
|
|
84
84
|
r !== void 0 && Pt(this.prototype, t, r);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
static getPropertyDescriptor(t, e, i) {
|
|
88
|
-
const { get: r, set:
|
|
88
|
+
const { get: r, set: n } = Lt(this.prototype, t) ?? { get() {
|
|
89
89
|
return this[e];
|
|
90
|
-
}, set(
|
|
91
|
-
this[e] =
|
|
90
|
+
}, set(o) {
|
|
91
|
+
this[e] = o;
|
|
92
92
|
} };
|
|
93
|
-
return { get: r, set(
|
|
93
|
+
return { get: r, set(o) {
|
|
94
94
|
const l = r?.call(this);
|
|
95
|
-
|
|
95
|
+
n?.call(this, o), this.requestUpdate(t, l, i);
|
|
96
96
|
}, configurable: !0, enumerable: !0 };
|
|
97
97
|
}
|
|
98
98
|
static getPropertyOptions(t) {
|
|
99
|
-
return this.elementProperties.get(t) ??
|
|
99
|
+
return this.elementProperties.get(t) ?? et;
|
|
100
100
|
}
|
|
101
101
|
static _$Ei() {
|
|
102
|
-
if (this.hasOwnProperty(
|
|
102
|
+
if (this.hasOwnProperty(O("elementProperties"))) return;
|
|
103
103
|
const t = Nt(this);
|
|
104
104
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
105
105
|
}
|
|
106
106
|
static finalize() {
|
|
107
|
-
if (this.hasOwnProperty(
|
|
108
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
107
|
+
if (this.hasOwnProperty(O("finalized"))) return;
|
|
108
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(O("properties"))) {
|
|
109
109
|
const e = this.properties, i = [...Mt(e), ...Ut(e)];
|
|
110
110
|
for (const r of i) this.createProperty(r, e[r]);
|
|
111
111
|
}
|
|
@@ -125,8 +125,8 @@ let b = class extends HTMLElement {
|
|
|
125
125
|
const e = [];
|
|
126
126
|
if (Array.isArray(t)) {
|
|
127
127
|
const i = new Set(t.flat(1 / 0).reverse());
|
|
128
|
-
for (const r of i) e.unshift(
|
|
129
|
-
} else t !== void 0 && e.push(
|
|
128
|
+
for (const r of i) e.unshift(Q(r));
|
|
129
|
+
} else t !== void 0 && e.push(Q(t));
|
|
130
130
|
return e;
|
|
131
131
|
}
|
|
132
132
|
static _$Eu(t, e) {
|
|
@@ -168,29 +168,29 @@ let b = class extends HTMLElement {
|
|
|
168
168
|
_$ET(t, e) {
|
|
169
169
|
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
|
|
170
170
|
if (r !== void 0 && i.reflect === !0) {
|
|
171
|
-
const
|
|
172
|
-
this._$Em = t,
|
|
171
|
+
const n = (i.converter?.toAttribute !== void 0 ? i.converter : H).toAttribute(e, i.type);
|
|
172
|
+
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
_$AK(t, e) {
|
|
176
176
|
const i = this.constructor, r = i._$Eh.get(t);
|
|
177
177
|
if (r !== void 0 && this._$Em !== r) {
|
|
178
|
-
const
|
|
178
|
+
const n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : H;
|
|
179
179
|
this._$Em = r;
|
|
180
|
-
const l =
|
|
180
|
+
const l = o.fromAttribute(e, n.type);
|
|
181
181
|
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
requestUpdate(t, e, i, r = !1,
|
|
184
|
+
requestUpdate(t, e, i, r = !1, n) {
|
|
185
185
|
if (t !== void 0) {
|
|
186
|
-
const
|
|
187
|
-
if (r === !1 && (
|
|
186
|
+
const o = this.constructor;
|
|
187
|
+
if (r === !1 && (n = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ?? Z)(n, e) || i.useDefault && i.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, i)))) return;
|
|
188
188
|
this.C(t, e, i);
|
|
189
189
|
}
|
|
190
190
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
191
191
|
}
|
|
192
|
-
C(t, e, { useDefault: i, reflect: r, wrapped:
|
|
193
|
-
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t,
|
|
192
|
+
C(t, e, { useDefault: i, reflect: r, wrapped: n }, o) {
|
|
193
|
+
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
194
194
|
}
|
|
195
195
|
async _$EP() {
|
|
196
196
|
this.isUpdatePending = !0;
|
|
@@ -209,13 +209,13 @@ let b = class extends HTMLElement {
|
|
|
209
209
|
if (!this.isUpdatePending) return;
|
|
210
210
|
if (!this.hasUpdated) {
|
|
211
211
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
212
|
-
for (const [r,
|
|
212
|
+
for (const [r, n] of this._$Ep) this[r] = n;
|
|
213
213
|
this._$Ep = void 0;
|
|
214
214
|
}
|
|
215
215
|
const i = this.constructor.elementProperties;
|
|
216
|
-
if (i.size > 0) for (const [r,
|
|
217
|
-
const { wrapped:
|
|
218
|
-
|
|
216
|
+
if (i.size > 0) for (const [r, n] of i) {
|
|
217
|
+
const { wrapped: o } = n, l = this[r];
|
|
218
|
+
o !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, n, l);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
let t = !1;
|
|
@@ -252,68 +252,68 @@ let b = class extends HTMLElement {
|
|
|
252
252
|
firstUpdated(t) {
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
\f\r]`,
|
|
258
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g,
|
|
259
|
-
function
|
|
260
|
-
if (!
|
|
261
|
-
return
|
|
255
|
+
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[O("elementProperties")] = /* @__PURE__ */ new Map(), S[O("finalized")] = /* @__PURE__ */ new Map(), Ht?.({ ReactiveElement: S }), (j.reactiveElementVersions ??= []).push("2.1.2");
|
|
256
|
+
const G = globalThis, st = (s) => s, R = G.trustedTypes, it = R ? R.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ct = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, pt = "?" + v, Rt = `<${pt}>`, w = document, L = () => w.createComment(""), M = (s) => s === null || typeof s != "object" && typeof s != "function", J = Array.isArray, jt = (s) => J(s) || typeof s?.[Symbol.iterator] == "function", B = `[
|
|
257
|
+
\f\r]`, D = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, nt = />/g, A = RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
|
|
258
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, at = /"/g, dt = /^(?:script|style|textarea|title)$/i, It = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), kt = It(1), E = /* @__PURE__ */ Symbol.for("lit-noChange"), d = /* @__PURE__ */ Symbol.for("lit-nothing"), ht = /* @__PURE__ */ new WeakMap(), b = w.createTreeWalker(w, 129);
|
|
259
|
+
function ut(s, t) {
|
|
260
|
+
if (!J(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
261
|
+
return it !== void 0 ? it.createHTML(t) : t;
|
|
262
262
|
}
|
|
263
263
|
const Bt = (s, t) => {
|
|
264
264
|
const e = s.length - 1, i = [];
|
|
265
|
-
let r,
|
|
265
|
+
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = D;
|
|
266
266
|
for (let l = 0; l < e; l++) {
|
|
267
|
-
const
|
|
268
|
-
let
|
|
269
|
-
for (;
|
|
270
|
-
const
|
|
271
|
-
|
|
267
|
+
const h = s[l];
|
|
268
|
+
let a, p, c = -1, $ = 0;
|
|
269
|
+
for (; $ < h.length && (o.lastIndex = $, p = o.exec(h), p !== null); ) $ = o.lastIndex, o === D ? p[1] === "!--" ? o = rt : p[1] !== void 0 ? o = nt : p[2] !== void 0 ? (dt.test(p[2]) && (r = RegExp("</" + p[2], "g")), o = A) : p[3] !== void 0 && (o = A) : o === A ? p[0] === ">" ? (o = r ?? D, c = -1) : p[1] === void 0 ? c = -2 : (c = o.lastIndex - p[2].length, a = p[1], o = p[3] === void 0 ? A : p[3] === '"' ? at : ot) : o === at || o === ot ? o = A : o === rt || o === nt ? o = D : (o = A, r = void 0);
|
|
270
|
+
const m = o === A && s[l + 1].startsWith("/>") ? " " : "";
|
|
271
|
+
n += o === D ? h + Rt : c >= 0 ? (i.push(a), h.slice(0, c) + ct + h.slice(c) + v + m) : h + v + (c === -2 ? l : m);
|
|
272
272
|
}
|
|
273
|
-
return [
|
|
273
|
+
return [ut(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
274
274
|
};
|
|
275
|
-
class
|
|
275
|
+
class U {
|
|
276
276
|
constructor({ strings: t, _$litType$: e }, i) {
|
|
277
277
|
let r;
|
|
278
278
|
this.parts = [];
|
|
279
|
-
let
|
|
280
|
-
const l = t.length - 1,
|
|
281
|
-
if (this.el =
|
|
279
|
+
let n = 0, o = 0;
|
|
280
|
+
const l = t.length - 1, h = this.parts, [a, p] = Bt(t, e);
|
|
281
|
+
if (this.el = U.createElement(a, i), b.currentNode = this.el.content, e === 2 || e === 3) {
|
|
282
282
|
const c = this.el.content.firstChild;
|
|
283
283
|
c.replaceWith(...c.childNodes);
|
|
284
284
|
}
|
|
285
|
-
for (; (r =
|
|
285
|
+
for (; (r = b.nextNode()) !== null && h.length < l; ) {
|
|
286
286
|
if (r.nodeType === 1) {
|
|
287
|
-
if (r.hasAttributes()) for (const c of r.getAttributeNames()) if (c.endsWith(
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
} else c.startsWith(
|
|
291
|
-
if (
|
|
292
|
-
const c = r.textContent.split(
|
|
293
|
-
if (
|
|
294
|
-
r.textContent =
|
|
295
|
-
for (let
|
|
296
|
-
r.append(c[
|
|
287
|
+
if (r.hasAttributes()) for (const c of r.getAttributeNames()) if (c.endsWith(ct)) {
|
|
288
|
+
const $ = p[o++], m = r.getAttribute(c).split(v), f = /([.?@])?(.*)/.exec($);
|
|
289
|
+
h.push({ type: 1, index: n, name: f[2], strings: m, ctor: f[1] === "." ? qt : f[1] === "?" ? Vt : f[1] === "@" ? Zt : I }), r.removeAttribute(c);
|
|
290
|
+
} else c.startsWith(v) && (h.push({ type: 6, index: n }), r.removeAttribute(c));
|
|
291
|
+
if (dt.test(r.tagName)) {
|
|
292
|
+
const c = r.textContent.split(v), $ = c.length - 1;
|
|
293
|
+
if ($ > 0) {
|
|
294
|
+
r.textContent = R ? R.emptyScript : "";
|
|
295
|
+
for (let m = 0; m < $; m++) r.append(c[m], L()), b.nextNode(), h.push({ type: 2, index: ++n });
|
|
296
|
+
r.append(c[$], L());
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
299
|
+
} else if (r.nodeType === 8) if (r.data === pt) h.push({ type: 2, index: n });
|
|
300
300
|
else {
|
|
301
301
|
let c = -1;
|
|
302
|
-
for (; (c = r.data.indexOf(
|
|
302
|
+
for (; (c = r.data.indexOf(v, c + 1)) !== -1; ) h.push({ type: 7, index: n }), c += v.length - 1;
|
|
303
303
|
}
|
|
304
|
-
|
|
304
|
+
n++;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
static createElement(t, e) {
|
|
308
|
-
const i =
|
|
308
|
+
const i = w.createElement("template");
|
|
309
309
|
return i.innerHTML = t, i;
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
if (t ===
|
|
312
|
+
function T(s, t, e = s, i) {
|
|
313
|
+
if (t === E) return t;
|
|
314
314
|
let r = i !== void 0 ? e._$Co?.[i] : e._$Cl;
|
|
315
|
-
const
|
|
316
|
-
return r?.constructor !==
|
|
315
|
+
const n = M(t) ? void 0 : t._$litDirective$;
|
|
316
|
+
return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = r : e._$Cl = r), r !== void 0 && (t = T(s, r._$AS(s, t.values), r, i)), t;
|
|
317
317
|
}
|
|
318
318
|
class Wt {
|
|
319
319
|
constructor(t, e) {
|
|
@@ -326,29 +326,29 @@ class Wt {
|
|
|
326
326
|
return this._$AM._$AU;
|
|
327
327
|
}
|
|
328
328
|
u(t) {
|
|
329
|
-
const { el: { content: e }, parts: i } = this._$AD, r = (t?.creationScope ??
|
|
330
|
-
|
|
331
|
-
let
|
|
332
|
-
for (;
|
|
333
|
-
if (
|
|
334
|
-
let
|
|
335
|
-
|
|
329
|
+
const { el: { content: e }, parts: i } = this._$AD, r = (t?.creationScope ?? w).importNode(e, !0);
|
|
330
|
+
b.currentNode = r;
|
|
331
|
+
let n = b.nextNode(), o = 0, l = 0, h = i[0];
|
|
332
|
+
for (; h !== void 0; ) {
|
|
333
|
+
if (o === h.index) {
|
|
334
|
+
let a;
|
|
335
|
+
h.type === 2 ? a = new N(n, n.nextSibling, this, t) : h.type === 1 ? a = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (a = new Gt(n, this, t)), this._$AV.push(a), h = i[++l];
|
|
336
336
|
}
|
|
337
|
-
|
|
337
|
+
o !== h?.index && (n = b.nextNode(), o++);
|
|
338
338
|
}
|
|
339
|
-
return
|
|
339
|
+
return b.currentNode = w, r;
|
|
340
340
|
}
|
|
341
341
|
p(t) {
|
|
342
342
|
let e = 0;
|
|
343
343
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
class
|
|
346
|
+
class N {
|
|
347
347
|
get _$AU() {
|
|
348
348
|
return this._$AM?._$AU ?? this._$Cv;
|
|
349
349
|
}
|
|
350
350
|
constructor(t, e, i, r) {
|
|
351
|
-
this.type = 2, this._$AH =
|
|
351
|
+
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
352
352
|
}
|
|
353
353
|
get parentNode() {
|
|
354
354
|
let t = this._$AA.parentNode;
|
|
@@ -362,7 +362,7 @@ class L {
|
|
|
362
362
|
return this._$AB;
|
|
363
363
|
}
|
|
364
364
|
_$AI(t, e = this) {
|
|
365
|
-
t =
|
|
365
|
+
t = T(this, t, e), M(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : jt(t) ? this.k(t) : this._(t);
|
|
366
366
|
}
|
|
367
367
|
O(t) {
|
|
368
368
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -371,86 +371,86 @@ class L {
|
|
|
371
371
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
372
372
|
}
|
|
373
373
|
_(t) {
|
|
374
|
-
this._$AH !==
|
|
374
|
+
this._$AH !== d && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t;
|
|
375
375
|
}
|
|
376
376
|
$(t) {
|
|
377
|
-
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el =
|
|
377
|
+
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = U.createElement(ut(i.h, i.h[0]), this.options)), i);
|
|
378
378
|
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
379
379
|
else {
|
|
380
|
-
const
|
|
381
|
-
|
|
380
|
+
const n = new Wt(r, this), o = n.u(this.options);
|
|
381
|
+
n.p(e), this.T(o), this._$AH = n;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
_$AC(t) {
|
|
385
|
-
let e =
|
|
386
|
-
return e === void 0 &&
|
|
385
|
+
let e = ht.get(t.strings);
|
|
386
|
+
return e === void 0 && ht.set(t.strings, e = new U(t)), e;
|
|
387
387
|
}
|
|
388
388
|
k(t) {
|
|
389
|
-
|
|
389
|
+
J(this._$AH) || (this._$AH = [], this._$AR());
|
|
390
390
|
const e = this._$AH;
|
|
391
391
|
let i, r = 0;
|
|
392
|
-
for (const
|
|
392
|
+
for (const n of t) r === e.length ? e.push(i = new N(this.O(L()), this.O(L()), this, this.options)) : i = e[r], i._$AI(n), r++;
|
|
393
393
|
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
|
|
394
394
|
}
|
|
395
395
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
396
396
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
397
|
-
const i =
|
|
398
|
-
|
|
397
|
+
const i = st(t).nextSibling;
|
|
398
|
+
st(t).remove(), t = i;
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
setConnected(t) {
|
|
402
402
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
class
|
|
405
|
+
class I {
|
|
406
406
|
get tagName() {
|
|
407
407
|
return this.element.tagName;
|
|
408
408
|
}
|
|
409
409
|
get _$AU() {
|
|
410
410
|
return this._$AM._$AU;
|
|
411
411
|
}
|
|
412
|
-
constructor(t, e, i, r,
|
|
413
|
-
this.type = 1, this._$AH =
|
|
412
|
+
constructor(t, e, i, r, n) {
|
|
413
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = d;
|
|
414
414
|
}
|
|
415
415
|
_$AI(t, e = this, i, r) {
|
|
416
|
-
const
|
|
417
|
-
let
|
|
418
|
-
if (
|
|
416
|
+
const n = this.strings;
|
|
417
|
+
let o = !1;
|
|
418
|
+
if (n === void 0) t = T(this, t, e, 0), o = !M(t) || t !== this._$AH && t !== E, o && (this._$AH = t);
|
|
419
419
|
else {
|
|
420
420
|
const l = t;
|
|
421
|
-
let
|
|
422
|
-
for (t =
|
|
421
|
+
let h, a;
|
|
422
|
+
for (t = n[0], h = 0; h < n.length - 1; h++) a = T(this, l[i + h], e, h), a === E && (a = this._$AH[h]), o ||= !M(a) || a !== this._$AH[h], a === d ? t = d : t !== d && (t += (a ?? "") + n[h + 1]), this._$AH[h] = a;
|
|
423
423
|
}
|
|
424
|
-
|
|
424
|
+
o && !r && this.j(t);
|
|
425
425
|
}
|
|
426
426
|
j(t) {
|
|
427
|
-
t ===
|
|
427
|
+
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
class qt extends
|
|
430
|
+
class qt extends I {
|
|
431
431
|
constructor() {
|
|
432
432
|
super(...arguments), this.type = 3;
|
|
433
433
|
}
|
|
434
434
|
j(t) {
|
|
435
|
-
this.element[this.name] = t ===
|
|
435
|
+
this.element[this.name] = t === d ? void 0 : t;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
class Vt extends
|
|
438
|
+
class Vt extends I {
|
|
439
439
|
constructor() {
|
|
440
440
|
super(...arguments), this.type = 4;
|
|
441
441
|
}
|
|
442
442
|
j(t) {
|
|
443
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
443
|
+
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
class Zt extends
|
|
447
|
-
constructor(t, e, i, r,
|
|
448
|
-
super(t, e, i, r,
|
|
446
|
+
class Zt extends I {
|
|
447
|
+
constructor(t, e, i, r, n) {
|
|
448
|
+
super(t, e, i, r, n), this.type = 5;
|
|
449
449
|
}
|
|
450
450
|
_$AI(t, e = this) {
|
|
451
|
-
if ((t =
|
|
452
|
-
const i = this._$AH, r = t ===
|
|
453
|
-
r && this.element.removeEventListener(this.name, this, i),
|
|
451
|
+
if ((t = T(this, t, e, 0) ?? d) === E) return;
|
|
452
|
+
const i = this._$AH, r = t === d && i !== d || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== d && (i === d || r);
|
|
453
|
+
r && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
454
454
|
}
|
|
455
455
|
handleEvent(t) {
|
|
456
456
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
@@ -464,22 +464,22 @@ class Gt {
|
|
|
464
464
|
return this._$AM._$AU;
|
|
465
465
|
}
|
|
466
466
|
_$AI(t) {
|
|
467
|
-
|
|
467
|
+
T(this, t);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
const Jt =
|
|
471
|
-
Jt?.(
|
|
470
|
+
const Jt = G.litHtmlPolyfillSupport;
|
|
471
|
+
Jt?.(U, N), (G.litHtmlVersions ??= []).push("3.3.2");
|
|
472
472
|
const Kt = (s, t, e) => {
|
|
473
473
|
const i = e?.renderBefore ?? t;
|
|
474
474
|
let r = i._$litPart$;
|
|
475
475
|
if (r === void 0) {
|
|
476
|
-
const
|
|
477
|
-
i._$litPart$ = r = new
|
|
476
|
+
const n = e?.renderBefore ?? null;
|
|
477
|
+
i._$litPart$ = r = new N(t.insertBefore(L(), n), n, void 0, e ?? {});
|
|
478
478
|
}
|
|
479
479
|
return r._$AI(s), r;
|
|
480
480
|
};
|
|
481
|
-
const
|
|
482
|
-
class
|
|
481
|
+
const K = globalThis;
|
|
482
|
+
class P extends S {
|
|
483
483
|
constructor() {
|
|
484
484
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
485
485
|
}
|
|
@@ -498,54 +498,63 @@ class T extends b {
|
|
|
498
498
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
499
499
|
}
|
|
500
500
|
render() {
|
|
501
|
-
return
|
|
501
|
+
return E;
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
(
|
|
508
|
-
const
|
|
504
|
+
P._$litElement$ = !0, P.finalized = !0, K.litElementHydrateSupport?.({ LitElement: P });
|
|
505
|
+
const Yt = K.litElementPolyfillSupport;
|
|
506
|
+
Yt?.({ LitElement: P });
|
|
507
|
+
(K.litElementVersions ??= []).push("4.2.2");
|
|
508
|
+
const Xt = (s) => (t, e) => {
|
|
509
509
|
e !== void 0 ? e.addInitializer(() => {
|
|
510
510
|
customElements.define(s, t);
|
|
511
511
|
}) : customElements.define(s, t);
|
|
512
512
|
};
|
|
513
|
-
const Ft = { attribute: !0, type: String, converter:
|
|
513
|
+
const Ft = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: Z }, Qt = (s = Ft, t, e) => {
|
|
514
514
|
const { kind: i, metadata: r } = e;
|
|
515
|
-
let
|
|
516
|
-
if (
|
|
517
|
-
const { name:
|
|
515
|
+
let n = globalThis.litPropertyMetadata.get(r);
|
|
516
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), n.set(e.name, s), i === "accessor") {
|
|
517
|
+
const { name: o } = e;
|
|
518
518
|
return { set(l) {
|
|
519
|
-
const
|
|
520
|
-
t.set.call(this, l), this.requestUpdate(
|
|
519
|
+
const h = t.get.call(this);
|
|
520
|
+
t.set.call(this, l), this.requestUpdate(o, h, s, !0, l);
|
|
521
521
|
}, init(l) {
|
|
522
|
-
return l !== void 0 && this.C(
|
|
522
|
+
return l !== void 0 && this.C(o, void 0, s, l), l;
|
|
523
523
|
} };
|
|
524
524
|
}
|
|
525
525
|
if (i === "setter") {
|
|
526
|
-
const { name:
|
|
526
|
+
const { name: o } = e;
|
|
527
527
|
return function(l) {
|
|
528
|
-
const
|
|
529
|
-
t.call(this, l), this.requestUpdate(
|
|
528
|
+
const h = this[o];
|
|
529
|
+
t.call(this, l), this.requestUpdate(o, h, s, !0, l);
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
532
|
throw Error("Unsupported decorator location: " + i);
|
|
533
533
|
};
|
|
534
|
-
function
|
|
535
|
-
return (t, e) => typeof e == "object" ? Qt(s, t, e) : ((i, r,
|
|
536
|
-
const
|
|
537
|
-
return r.constructor.createProperty(
|
|
534
|
+
function Y(s) {
|
|
535
|
+
return (t, e) => typeof e == "object" ? Qt(s, t, e) : ((i, r, n) => {
|
|
536
|
+
const o = r.hasOwnProperty(n);
|
|
537
|
+
return r.constructor.createProperty(n, i), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
|
|
538
538
|
})(s, t, e);
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
return
|
|
540
|
+
function k(s) {
|
|
541
|
+
return Y({ ...s, state: !0, attribute: !1 });
|
|
542
542
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
543
|
+
const te = (s, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(s, t, e), e);
|
|
544
|
+
function ee(s, t) {
|
|
545
|
+
return (e, i, r) => {
|
|
546
|
+
const n = (o) => o.renderRoot?.querySelector(s) ?? null;
|
|
547
|
+
return te(e, i, { get() {
|
|
548
|
+
return n(this);
|
|
549
|
+
} });
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
var se = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, x = (s, t, e, i) => {
|
|
553
|
+
for (var r = i > 1 ? void 0 : i ? ie(t, e) : t, n = s.length - 1, o; n >= 0; n--)
|
|
554
|
+
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
|
555
|
+
return i && r && se(t, e, r), r;
|
|
547
556
|
};
|
|
548
|
-
|
|
557
|
+
W.use([
|
|
549
558
|
ft,
|
|
550
559
|
$t,
|
|
551
560
|
gt,
|
|
@@ -559,12 +568,12 @@ k.use([
|
|
|
559
568
|
wt,
|
|
560
569
|
Ct
|
|
561
570
|
]);
|
|
562
|
-
let g = class extends
|
|
571
|
+
let g = class extends P {
|
|
563
572
|
constructor() {
|
|
564
|
-
super(), this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 0, this.origHeight = 0, this.modifier = 1, this.version = "1.6.
|
|
573
|
+
super(), this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 0, this.origHeight = 0, this.modifier = 1, this.version = "1.6.29", this.updateThresholdMs = 300, this.maxIntervalSamples = 3, this.template = {
|
|
565
574
|
title: {
|
|
566
575
|
text: "Temperature Change in the Coming Week",
|
|
567
|
-
left:
|
|
576
|
+
left: "center",
|
|
568
577
|
top: 0,
|
|
569
578
|
textStyle: {
|
|
570
579
|
fontSize: 14
|
|
@@ -574,7 +583,7 @@ let g = class extends T {
|
|
|
574
583
|
trigger: "axis"
|
|
575
584
|
},
|
|
576
585
|
legend: {
|
|
577
|
-
right:
|
|
586
|
+
right: 0,
|
|
578
587
|
top: 0
|
|
579
588
|
},
|
|
580
589
|
grid: {
|
|
@@ -664,7 +673,7 @@ let g = class extends T {
|
|
|
664
673
|
s.has("inputData") && this.chartContainer && (this.transformData(), this.applyData()), s.has("theme") && (this.registerTheme(this.theme), this.deleteCharts(), this.transformData(), this.applyData()), super.update(s);
|
|
665
674
|
}
|
|
666
675
|
firstUpdated(s) {
|
|
667
|
-
this.
|
|
676
|
+
this.registerTheme(this.theme), this.transformData(), this.applyData(), this.chartContainer && (this.resizeObserver = new ResizeObserver(() => {
|
|
668
677
|
this.canvasList.forEach((t) => {
|
|
669
678
|
t.echart?.resize();
|
|
670
679
|
});
|
|
@@ -673,16 +682,10 @@ let g = class extends T {
|
|
|
673
682
|
registerTheme(s) {
|
|
674
683
|
const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), e = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
675
684
|
if (this.themeBgColor = e || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = t || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = t || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor, !s || !s.theme_object || !s.theme_name) return;
|
|
676
|
-
const i = [
|
|
677
|
-
|
|
678
|
-
"geo",
|
|
679
|
-
"timeline",
|
|
680
|
-
"visualMap",
|
|
681
|
-
"markPoint"
|
|
682
|
-
], r = Object.fromEntries(
|
|
683
|
-
Object.entries(s.theme_object).filter(([o]) => !i.includes(o))
|
|
685
|
+
const i = ["parallel", "geo", "timeline", "visualMap", "markPoint"], r = Object.fromEntries(
|
|
686
|
+
Object.entries(s.theme_object).filter(([n]) => !i.includes(n))
|
|
684
687
|
);
|
|
685
|
-
|
|
688
|
+
W.registerTheme(s.theme_name, r);
|
|
686
689
|
}
|
|
687
690
|
transformData() {
|
|
688
691
|
if (!this?.inputData?.dataseries?.length) return;
|
|
@@ -690,19 +693,19 @@ let g = class extends T {
|
|
|
690
693
|
t.series = [], t.doomed = !0;
|
|
691
694
|
}), this.inputData.dataseries.sort((t, e) => (t.advanced?.drawOrder ?? 0) - (e.advanced?.drawOrder ?? 0)), this.inputData.dataseries.forEach((t) => {
|
|
692
695
|
t.advanced ??= {}, t.advanced.chartName ??= "", t.data ??= [];
|
|
693
|
-
const e = [...new Set(t.data.map((
|
|
694
|
-
e.forEach((
|
|
695
|
-
const l =
|
|
696
|
-
let
|
|
697
|
-
if (this.xAxisType() === "time" &&
|
|
698
|
-
const
|
|
699
|
-
|
|
696
|
+
const e = [...new Set(t.data.map((n) => n.pivot ?? ""))].sort(), i = X(t.backgroundColor).monochromatic(e.length).map((n) => n.toHexString()), r = X(t.borderColor).monochromatic(e.length).map((n) => n.toHexString());
|
|
697
|
+
e.forEach((n, o) => {
|
|
698
|
+
const l = n ?? "", h = t.label ?? "", a = l + (l && h ? " - " : "") + h, p = t.borderColor ? t.advanced?.chartName?.includes("#split#") ? t.borderColor : r[o] : void 0, c = t.backgroundColor ? t.advanced?.chartName?.includes("#split#") ? t.backgroundColor : i[o] : void 0, $ = e.length === 1 ? t.data : t.data?.filter((u) => u.pivot === n);
|
|
699
|
+
let m = this.inputData?.axis?.timeseries ? $?.map((u) => ({ name: u.x, value: [new Date(u.x ?? "").getTime(), u.y, u.r] })) ?? [] : $?.map((u) => ({ name: u.x, value: [u.x, u.y, u.r] })) ?? [], f = 0, C = 0;
|
|
700
|
+
if (this.xAxisType() === "time" && m) {
|
|
701
|
+
const u = m.map((mt) => mt.value[0]);
|
|
702
|
+
f = Math.min(...u), C = Math.max(...u);
|
|
700
703
|
}
|
|
701
|
-
const
|
|
702
|
-
id:
|
|
703
|
-
name:
|
|
704
|
-
minDate:
|
|
705
|
-
maxDate:
|
|
704
|
+
const y = {
|
|
705
|
+
id: a,
|
|
706
|
+
name: a,
|
|
707
|
+
minDate: f,
|
|
708
|
+
maxDate: C,
|
|
706
709
|
type: t.type ?? "line",
|
|
707
710
|
lineStyle: {
|
|
708
711
|
color: p,
|
|
@@ -717,13 +720,13 @@ let g = class extends T {
|
|
|
717
720
|
},
|
|
718
721
|
areaStyle: t.styling?.fill ? { color: c } : void 0,
|
|
719
722
|
symbol: t.styling?.pointStyle ?? "circle",
|
|
720
|
-
symbolSize: (
|
|
723
|
+
symbolSize: (u) => u[2] ?? 4,
|
|
721
724
|
showSymbol: t.styling?.pointStyle !== "none",
|
|
722
|
-
data:
|
|
725
|
+
data: m ?? [],
|
|
723
726
|
drawOrder: t.advanced?.drawOrder ?? 0
|
|
724
727
|
};
|
|
725
|
-
let
|
|
726
|
-
|
|
728
|
+
let _ = t.advanced?.chartName ?? "";
|
|
729
|
+
_ = _.replace("#split#", l), this.setupChart(_)?.series.push(y);
|
|
727
730
|
});
|
|
728
731
|
});
|
|
729
732
|
const s = [];
|
|
@@ -731,10 +734,12 @@ let g = class extends T {
|
|
|
731
734
|
t.doomed && (t.echart?.dispose(), t.element?.remove(), s.push(e));
|
|
732
735
|
}), s.forEach((t) => this.canvasList.delete(t)), this.canvasList = new Map(
|
|
733
736
|
[...this.canvasList.entries()].sort(([t, e], [i, r]) => {
|
|
734
|
-
const
|
|
735
|
-
return
|
|
737
|
+
const n = e.series?.[0].drawOrder ?? 0, o = r.series?.[0].drawOrder ?? 0;
|
|
738
|
+
return n !== o ? n - o : t.localeCompare(i);
|
|
736
739
|
})
|
|
737
|
-
)
|
|
740
|
+
), s.length > 0 && this.canvasList.forEach((t) => {
|
|
741
|
+
t.echart?.resize();
|
|
742
|
+
});
|
|
738
743
|
}
|
|
739
744
|
xAxisType() {
|
|
740
745
|
if (this.inputData?.axis?.timeseries) return "time";
|
|
@@ -752,9 +757,9 @@ let g = class extends T {
|
|
|
752
757
|
let r = 0;
|
|
753
758
|
if (this.xAxisType() === "time")
|
|
754
759
|
for (const l of s.series) {
|
|
755
|
-
const
|
|
756
|
-
for (const
|
|
757
|
-
const p =
|
|
760
|
+
const h = l.data;
|
|
761
|
+
for (const a of h || []) {
|
|
762
|
+
const p = a.value?.[0] || 0;
|
|
758
763
|
p > r && (r = p);
|
|
759
764
|
}
|
|
760
765
|
}
|
|
@@ -767,55 +772,60 @@ let g = class extends T {
|
|
|
767
772
|
}
|
|
768
773
|
s.lastUpdateTime = e, s.lastMaxTimestamp = r;
|
|
769
774
|
}
|
|
770
|
-
return s.updateIntervals && s.updateIntervals.length > 0 ? s.updateIntervals.reduce((l,
|
|
775
|
+
return s.updateIntervals && s.updateIntervals.length > 0 ? s.updateIntervals.reduce((l, h) => l + h, 0) / s.updateIntervals.length : this.updateThresholdMs;
|
|
771
776
|
}
|
|
772
777
|
applyData() {
|
|
773
778
|
if (this.chartContainer) {
|
|
774
779
|
for (const s of this.canvasList.values())
|
|
775
780
|
s.element && this.chartContainer.appendChild(s.element);
|
|
776
781
|
this.canvasList.forEach((s, t) => {
|
|
777
|
-
s.series.sort((
|
|
778
|
-
const e = this.inputData?.axis?.showLegend ?? !0, i = this.inputData?.axis?.showTitle ?? !0, r = this.inputData?.axis?.showXAxis ?? !0,
|
|
782
|
+
s.series.sort((f, C) => f.name > C.name ? 1 : -1);
|
|
783
|
+
const e = this.inputData?.axis?.showLegend ?? !0, i = this.inputData?.axis?.showTitle ?? !0, r = this.inputData?.axis?.showXAxis ?? !0, n = this.inputData?.axis?.showYAxis ?? !0, o = this.inputData?.axis?.showBox ?? !1, l = JSON.stringify({
|
|
779
784
|
showLegend: e,
|
|
780
785
|
showTitle: i,
|
|
781
786
|
showXAxis: r,
|
|
782
|
-
showYAxis:
|
|
783
|
-
showBox:
|
|
787
|
+
showYAxis: n,
|
|
788
|
+
showBox: o,
|
|
784
789
|
xAxisLabel: this.inputData?.axis?.xAxisLabel,
|
|
785
790
|
yAxisLabel: this.inputData?.axis?.yAxisLabel,
|
|
786
791
|
xAxisZoom: this.inputData?.axis?.xAxisZoom,
|
|
787
792
|
yAxisScaling: this.inputData?.axis?.yAxisScaling,
|
|
788
793
|
xAxisType: this.xAxisType(),
|
|
789
794
|
yAxisType: this.yAxisType(),
|
|
790
|
-
seriesCount: s.series.length
|
|
791
|
-
|
|
795
|
+
seriesCount: s.series.length,
|
|
796
|
+
seriesNames: s.series.map((f) => f.name).join(",")
|
|
797
|
+
}), h = s.lastConfig !== l;
|
|
792
798
|
s.lastConfig = l;
|
|
793
|
-
const
|
|
794
|
-
if (
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
...
|
|
798
|
-
min:
|
|
799
|
-
max:
|
|
799
|
+
const a = h ? window.structuredClone(this.template) : s.echart?.getOption() ?? window.structuredClone(this.template);
|
|
800
|
+
if (a.title.text = t, a.title.show = i, a.xAxis.name = this.inputData?.axis?.xAxisLabel ?? "", a.xAxis.type = this.xAxisType(), a.xAxis.show = r, this.xAxisType() === "time") {
|
|
801
|
+
const f = s.series.map((y) => y.maxDate ?? 0).reduce((y, _) => Math.max(y, _), 0), C = s.series.map((y) => y.minDate ?? 1 / 0).reduce((y, _) => Math.min(y, _), 1 / 0);
|
|
802
|
+
a.xAxis = {
|
|
803
|
+
...a.xAxis,
|
|
804
|
+
min: C ?? (/* @__PURE__ */ new Date()).getTime() - 1440 * 60 * 1e3,
|
|
805
|
+
max: f ?? (/* @__PURE__ */ new Date()).getTime()
|
|
800
806
|
};
|
|
801
807
|
}
|
|
802
|
-
|
|
808
|
+
a.dataZoom[0].show = this.inputData?.axis?.xAxisZoom ?? !1, a.toolbox.show = this.inputData?.axis?.xAxisZoom ?? !1;
|
|
809
|
+
const p = this.inputData?.axis?.yAxisLabel ?? "", c = n && !!p;
|
|
810
|
+
a.yAxis.type = this.yAxisType(), a.yAxis.name = p, a.yAxis.scale = this.inputData?.axis?.yAxisScaling ?? !1, a.yAxis.show = n, a.yAxis.nameLocation = "end", a.yAxis.nameGap = 10, a.yAxis.axisLine = { show: !0 }, ["value", "log"].includes(a.yAxis.type) && (a.yAxis.axisLabel = {
|
|
803
811
|
"font-size": 14,
|
|
804
|
-
formatter: (
|
|
805
|
-
}),
|
|
806
|
-
|
|
807
|
-
|
|
812
|
+
formatter: (f) => Math.round(f * 100) / 100
|
|
813
|
+
}), a.series = s.series, a.legend.show = e;
|
|
814
|
+
const $ = i || c ? 30 : 0;
|
|
815
|
+
a.grid = {
|
|
816
|
+
...a.grid,
|
|
817
|
+
show: o,
|
|
808
818
|
backgroundColor: "transparent",
|
|
809
|
-
borderWidth:
|
|
819
|
+
borderWidth: o ? 1 : 0,
|
|
810
820
|
borderColor: this.themeTitleColor ?? "#ccc",
|
|
811
|
-
top:
|
|
821
|
+
top: $,
|
|
812
822
|
bottom: r ? 20 : 0,
|
|
813
|
-
left:
|
|
823
|
+
left: n ? 20 : 0,
|
|
814
824
|
right: 0,
|
|
815
|
-
containLabel: r ||
|
|
825
|
+
containLabel: r || n
|
|
816
826
|
};
|
|
817
|
-
const
|
|
818
|
-
|
|
827
|
+
const m = this.calculateAnimationDuration(s, t);
|
|
828
|
+
a.animation = !0, a.animationEasing = "linear", a.animationDuration = m, a.animationDurationUpdate = m, s.echart?.on("finished", () => s.drawing = !1), s.drawing = !0, s.echart?.setOption(a, { notMerge: h, lazyUpdate: !0 });
|
|
819
829
|
});
|
|
820
830
|
}
|
|
821
831
|
}
|
|
@@ -833,7 +843,7 @@ let g = class extends T {
|
|
|
833
843
|
const e = document.createElement("div");
|
|
834
844
|
e.setAttribute("name", s), e.setAttribute("class", "sizer"), this.chartContainer.appendChild(e);
|
|
835
845
|
const r = {
|
|
836
|
-
echart:
|
|
846
|
+
echart: W.init(e, this.theme?.theme_name),
|
|
837
847
|
series: [],
|
|
838
848
|
element: e,
|
|
839
849
|
drawing: !1,
|
|
@@ -947,26 +957,29 @@ g.styles = Tt`
|
|
|
947
957
|
justify-content: center;
|
|
948
958
|
}
|
|
949
959
|
`;
|
|
950
|
-
|
|
951
|
-
|
|
960
|
+
x([
|
|
961
|
+
Y({ type: Object })
|
|
952
962
|
], g.prototype, "inputData", 2);
|
|
953
|
-
|
|
954
|
-
|
|
963
|
+
x([
|
|
964
|
+
Y({ type: Object })
|
|
955
965
|
], g.prototype, "theme", 2);
|
|
956
|
-
|
|
957
|
-
|
|
966
|
+
x([
|
|
967
|
+
k()
|
|
958
968
|
], g.prototype, "canvasList", 2);
|
|
959
|
-
|
|
960
|
-
|
|
969
|
+
x([
|
|
970
|
+
k()
|
|
961
971
|
], g.prototype, "themeBgColor", 2);
|
|
962
|
-
|
|
963
|
-
|
|
972
|
+
x([
|
|
973
|
+
k()
|
|
964
974
|
], g.prototype, "themeTitleColor", 2);
|
|
965
|
-
|
|
966
|
-
|
|
975
|
+
x([
|
|
976
|
+
k()
|
|
967
977
|
], g.prototype, "themeSubtitleColor", 2);
|
|
968
|
-
|
|
969
|
-
|
|
978
|
+
x([
|
|
979
|
+
ee(".chart-container")
|
|
980
|
+
], g.prototype, "chartContainer", 2);
|
|
981
|
+
g = x([
|
|
982
|
+
Xt("widget-linechart-1.6.29")
|
|
970
983
|
], g);
|
|
971
984
|
export {
|
|
972
985
|
g as WidgetLinechart
|