@record-evolution/widget-linechart 1.7.1 → 1.7.2
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/dist/widget-linechart.js +499 -410
- package/dist/widget-linechart.js.map +1 -1
- package/package.json +1 -1
- package/src/default-data.json +11 -11
- package/src/definition-schema.d.ts +15 -5
- package/src/definition-schema.json +42 -4
- package/src/widget-linechart.ts +151 -15
package/dist/widget-linechart.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { GridComponent as
|
|
3
|
-
import { LineChart as
|
|
4
|
-
import { UniversalTransition as
|
|
5
|
-
import { CanvasRenderer as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
let
|
|
1
|
+
import * as nt from "echarts/core";
|
|
2
|
+
import { GridComponent as Pt, TitleComponent as Mt, ToolboxComponent as Nt, TooltipComponent as Ut, LegendComponent as zt, DataZoomComponent as Rt } from "echarts/components";
|
|
3
|
+
import { LineChart as It, BarChart as Ht, ScatterChart as jt } from "echarts/charts";
|
|
4
|
+
import { UniversalTransition as kt, LegacyGridContainLabel as Bt } from "echarts/features";
|
|
5
|
+
import { CanvasRenderer as Wt } from "echarts/renderers";
|
|
6
|
+
import ft from "tinycolor2";
|
|
7
|
+
const G = globalThis, at = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, rt = /* @__PURE__ */ Symbol(), yt = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
let Tt = class {
|
|
9
9
|
constructor(t, e, s) {
|
|
10
|
-
if (this._$cssResult$ = !0, s !==
|
|
10
|
+
if (this._$cssResult$ = !0, s !== rt) 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 (at && t === void 0) {
|
|
17
17
|
const s = e !== void 0 && e.length === 1;
|
|
18
|
-
s && (t =
|
|
18
|
+
s && (t = yt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && yt.set(e, t));
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
@@ -23,101 +23,101 @@ let vt = class {
|
|
|
23
23
|
return this.cssText;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const
|
|
27
|
-
const e =
|
|
28
|
-
if (
|
|
29
|
-
if (typeof
|
|
30
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
31
|
-
})(
|
|
32
|
-
return new
|
|
33
|
-
},
|
|
34
|
-
if (
|
|
26
|
+
const Zt = (o) => new Tt(typeof o == "string" ? o : o + "", void 0, rt), Vt = (o, ...t) => {
|
|
27
|
+
const e = o.length === 1 ? o[0] : t.reduce((s, i, n) => s + ((a) => {
|
|
28
|
+
if (a._$cssResult$ === !0) return a.cssText;
|
|
29
|
+
if (typeof a == "number") return a;
|
|
30
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
31
|
+
})(i) + o[n + 1], o[0]);
|
|
32
|
+
return new Tt(e, o, rt);
|
|
33
|
+
}, qt = (o, t) => {
|
|
34
|
+
if (at) o.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
35
35
|
else for (const e of t) {
|
|
36
|
-
const s = document.createElement("style"),
|
|
37
|
-
|
|
36
|
+
const s = document.createElement("style"), i = G.litNonce;
|
|
37
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, o.appendChild(s);
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, gt = at ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((t) => {
|
|
40
40
|
let e = "";
|
|
41
41
|
for (const s of t.cssRules) e += s.cssText;
|
|
42
|
-
return
|
|
43
|
-
})(
|
|
44
|
-
const { is:
|
|
42
|
+
return Zt(e);
|
|
43
|
+
})(o) : o;
|
|
44
|
+
const { is: Xt, defineProperty: Yt, getOwnPropertyDescriptor: Gt, getOwnPropertyNames: Kt, getOwnPropertySymbols: Ft, getPrototypeOf: Jt } = Object, J = globalThis, xt = J.trustedTypes, Qt = xt ? xt.emptyScript : "", te = J.reactiveElementPolyfillSupport, j = (o, t) => o, K = { toAttribute(o, t) {
|
|
45
45
|
switch (t) {
|
|
46
46
|
case Boolean:
|
|
47
|
-
|
|
47
|
+
o = o ? Qt : null;
|
|
48
48
|
break;
|
|
49
49
|
case Object:
|
|
50
50
|
case Array:
|
|
51
|
-
|
|
51
|
+
o = o == null ? o : JSON.stringify(o);
|
|
52
52
|
}
|
|
53
|
-
return
|
|
54
|
-
}, fromAttribute(
|
|
55
|
-
let e =
|
|
53
|
+
return o;
|
|
54
|
+
}, fromAttribute(o, t) {
|
|
55
|
+
let e = o;
|
|
56
56
|
switch (t) {
|
|
57
57
|
case Boolean:
|
|
58
|
-
e =
|
|
58
|
+
e = o !== null;
|
|
59
59
|
break;
|
|
60
60
|
case Number:
|
|
61
|
-
e =
|
|
61
|
+
e = o === null ? null : Number(o);
|
|
62
62
|
break;
|
|
63
63
|
case Object:
|
|
64
64
|
case Array:
|
|
65
65
|
try {
|
|
66
|
-
e = JSON.parse(
|
|
66
|
+
e = JSON.parse(o);
|
|
67
67
|
} catch {
|
|
68
68
|
e = null;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
return e;
|
|
72
|
-
} },
|
|
73
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
74
|
-
let
|
|
72
|
+
} }, ht = (o, t) => !Xt(o, t), $t = { attribute: !0, type: String, converter: K, reflect: !1, useDefault: !1, hasChanged: ht };
|
|
73
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), J.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
74
|
+
let O = 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 = $t) {
|
|
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
|
-
const s = /* @__PURE__ */ Symbol(),
|
|
84
|
-
|
|
83
|
+
const s = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
84
|
+
i !== void 0 && Yt(this.prototype, t, i);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
static getPropertyDescriptor(t, e, s) {
|
|
88
|
-
const { get:
|
|
88
|
+
const { get: i, set: n } = Gt(this.prototype, t) ?? { get() {
|
|
89
89
|
return this[e];
|
|
90
|
-
}, set(
|
|
91
|
-
this[e] =
|
|
90
|
+
}, set(a) {
|
|
91
|
+
this[e] = a;
|
|
92
92
|
} };
|
|
93
|
-
return { get:
|
|
94
|
-
const l =
|
|
95
|
-
|
|
93
|
+
return { get: i, set(a) {
|
|
94
|
+
const l = i?.call(this);
|
|
95
|
+
n?.call(this, a), this.requestUpdate(t, l, s);
|
|
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) ?? $t;
|
|
100
100
|
}
|
|
101
101
|
static _$Ei() {
|
|
102
|
-
if (this.hasOwnProperty(
|
|
103
|
-
const t =
|
|
102
|
+
if (this.hasOwnProperty(j("elementProperties"))) return;
|
|
103
|
+
const t = Jt(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(
|
|
109
|
-
const e = this.properties, s = [...
|
|
110
|
-
for (const
|
|
107
|
+
if (this.hasOwnProperty(j("finalized"))) return;
|
|
108
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
|
|
109
|
+
const e = this.properties, s = [...Kt(e), ...Ft(e)];
|
|
110
|
+
for (const i of s) this.createProperty(i, e[i]);
|
|
111
111
|
}
|
|
112
112
|
const t = this[Symbol.metadata];
|
|
113
113
|
if (t !== null) {
|
|
114
114
|
const e = litPropertyMetadata.get(t);
|
|
115
|
-
if (e !== void 0) for (const [s,
|
|
115
|
+
if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
|
|
116
116
|
}
|
|
117
117
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
118
118
|
for (const [e, s] of this.elementProperties) {
|
|
119
|
-
const
|
|
120
|
-
|
|
119
|
+
const i = this._$Eu(e, s);
|
|
120
|
+
i !== void 0 && this._$Eh.set(i, e);
|
|
121
121
|
}
|
|
122
122
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
123
123
|
}
|
|
@@ -125,8 +125,8 @@ let S = class extends HTMLElement {
|
|
|
125
125
|
const e = [];
|
|
126
126
|
if (Array.isArray(t)) {
|
|
127
127
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
128
|
-
for (const
|
|
129
|
-
} else t !== void 0 && e.push(
|
|
128
|
+
for (const i of s) e.unshift(gt(i));
|
|
129
|
+
} else t !== void 0 && e.push(gt(t));
|
|
130
130
|
return e;
|
|
131
131
|
}
|
|
132
132
|
static _$Eu(t, e) {
|
|
@@ -152,7 +152,7 @@ let S = class extends HTMLElement {
|
|
|
152
152
|
}
|
|
153
153
|
createRenderRoot() {
|
|
154
154
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
155
|
-
return
|
|
155
|
+
return qt(t, this.constructor.elementStyles), t;
|
|
156
156
|
}
|
|
157
157
|
connectedCallback() {
|
|
158
158
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
@@ -166,31 +166,31 @@ let S = class extends HTMLElement {
|
|
|
166
166
|
this._$AK(t, s);
|
|
167
167
|
}
|
|
168
168
|
_$ET(t, e) {
|
|
169
|
-
const s = this.constructor.elementProperties.get(t),
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
this._$Em = t,
|
|
169
|
+
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
170
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
171
|
+
const n = (s.converter?.toAttribute !== void 0 ? s.converter : K).toAttribute(e, s.type);
|
|
172
|
+
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
_$AK(t, e) {
|
|
176
|
-
const s = this.constructor,
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
this._$Em =
|
|
180
|
-
const l =
|
|
181
|
-
this[
|
|
176
|
+
const s = this.constructor, i = s._$Eh.get(t);
|
|
177
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
178
|
+
const n = s.getPropertyOptions(i), a = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : K;
|
|
179
|
+
this._$Em = i;
|
|
180
|
+
const l = a.fromAttribute(e, n.type);
|
|
181
|
+
this[i] = l ?? this._$Ej?.get(i) ?? l, this._$Em = null;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
requestUpdate(t, e, s,
|
|
184
|
+
requestUpdate(t, e, s, i = !1, n) {
|
|
185
185
|
if (t !== void 0) {
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
186
|
+
const a = this.constructor;
|
|
187
|
+
if (i === !1 && (n = this[t]), s ??= a.getPropertyOptions(t), !((s.hasChanged ?? ht)(n, e) || s.useDefault && s.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(a._$Eu(t, s)))) return;
|
|
188
188
|
this.C(t, e, s);
|
|
189
189
|
}
|
|
190
190
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
191
191
|
}
|
|
192
|
-
C(t, e, { useDefault: s, reflect:
|
|
193
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t,
|
|
192
|
+
C(t, e, { useDefault: s, reflect: i, wrapped: n }, a) {
|
|
193
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, a ?? e ?? this[t]), n !== !0 || a !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !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 S = 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 [
|
|
212
|
+
for (const [i, n] of this._$Ep) this[i] = n;
|
|
213
213
|
this._$Ep = void 0;
|
|
214
214
|
}
|
|
215
215
|
const s = this.constructor.elementProperties;
|
|
216
|
-
if (s.size > 0) for (const [
|
|
217
|
-
const { wrapped:
|
|
218
|
-
|
|
216
|
+
if (s.size > 0) for (const [i, n] of s) {
|
|
217
|
+
const { wrapped: a } = n, l = this[i];
|
|
218
|
+
a !== !0 || this._$AL.has(i) || l === void 0 || this.C(i, void 0, n, l);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
let t = !1;
|
|
@@ -252,70 +252,70 @@ let S = class extends HTMLElement {
|
|
|
252
252
|
firstUpdated(t) {
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
\f\r]`,
|
|
258
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
259
|
-
function
|
|
260
|
-
if (!
|
|
261
|
-
return
|
|
255
|
+
O.elementStyles = [], O.shadowRootOptions = { mode: "open" }, O[j("elementProperties")] = /* @__PURE__ */ new Map(), O[j("finalized")] = /* @__PURE__ */ new Map(), te?.({ ReactiveElement: O }), (J.reactiveElementVersions ??= []).push("2.1.2");
|
|
256
|
+
const lt = globalThis, vt = (o) => o, F = lt.trustedTypes, At = F ? F.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, Et = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, Lt = "?" + A, ee = `<${Lt}>`, L = document, B = () => L.createComment(""), W = (o) => o === null || typeof o != "object" && typeof o != "function", ct = Array.isArray, ie = (o) => ct(o) || typeof o?.[Symbol.iterator] == "function", ot = `[
|
|
257
|
+
\f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, bt = /-->/g, _t = />/g, T = RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^
|
|
258
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), wt = /'/g, St = /"/g, Dt = /^(?:script|style|textarea|title)$/i, se = (o) => (t, ...e) => ({ _$litType$: o, strings: t, values: e }), oe = se(1), P = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), Ct = /* @__PURE__ */ new WeakMap(), E = L.createTreeWalker(L, 129);
|
|
259
|
+
function Ot(o, t) {
|
|
260
|
+
if (!ct(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
261
|
+
return At !== void 0 ? At.createHTML(t) : t;
|
|
262
262
|
}
|
|
263
|
-
const
|
|
264
|
-
const e =
|
|
265
|
-
let
|
|
263
|
+
const ne = (o, t) => {
|
|
264
|
+
const e = o.length - 1, s = [];
|
|
265
|
+
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = H;
|
|
266
266
|
for (let l = 0; l < e; l++) {
|
|
267
|
-
const
|
|
268
|
-
let h, c
|
|
269
|
-
for (;
|
|
270
|
-
const
|
|
271
|
-
|
|
267
|
+
const r = o[l];
|
|
268
|
+
let d, h, c = -1, p = 0;
|
|
269
|
+
for (; p < r.length && (a.lastIndex = p, h = a.exec(r), h !== null); ) p = a.lastIndex, a === H ? h[1] === "!--" ? a = bt : h[1] !== void 0 ? a = _t : h[2] !== void 0 ? (Dt.test(h[2]) && (i = RegExp("</" + h[2], "g")), a = T) : h[3] !== void 0 && (a = T) : a === T ? h[0] === ">" ? (a = i ?? H, c = -1) : h[1] === void 0 ? c = -2 : (c = a.lastIndex - h[2].length, d = h[1], a = h[3] === void 0 ? T : h[3] === '"' ? St : wt) : a === St || a === wt ? a = T : a === bt || a === _t ? a = H : (a = T, i = void 0);
|
|
270
|
+
const y = a === T && o[l + 1].startsWith("/>") ? " " : "";
|
|
271
|
+
n += a === H ? r + ee : c >= 0 ? (s.push(d), r.slice(0, c) + Et + r.slice(c) + A + y) : r + A + (c === -2 ? l : y);
|
|
272
272
|
}
|
|
273
|
-
return [
|
|
273
|
+
return [Ot(o, n + (o[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
274
274
|
};
|
|
275
|
-
class
|
|
275
|
+
class Z {
|
|
276
276
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
277
|
-
let
|
|
277
|
+
let i;
|
|
278
278
|
this.parts = [];
|
|
279
|
-
let
|
|
280
|
-
const l = t.length - 1,
|
|
281
|
-
if (this.el =
|
|
282
|
-
const
|
|
283
|
-
|
|
279
|
+
let n = 0, a = 0;
|
|
280
|
+
const l = t.length - 1, r = this.parts, [d, h] = ne(t, e);
|
|
281
|
+
if (this.el = Z.createElement(d, s), E.currentNode = this.el.content, e === 2 || e === 3) {
|
|
282
|
+
const c = this.el.content.firstChild;
|
|
283
|
+
c.replaceWith(...c.childNodes);
|
|
284
284
|
}
|
|
285
|
-
for (; (
|
|
286
|
-
if (
|
|
287
|
-
if (
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
} else
|
|
291
|
-
if (
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
-
for (let
|
|
296
|
-
|
|
285
|
+
for (; (i = E.nextNode()) !== null && r.length < l; ) {
|
|
286
|
+
if (i.nodeType === 1) {
|
|
287
|
+
if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(Et)) {
|
|
288
|
+
const p = h[a++], y = i.getAttribute(c).split(A), x = /([.?@])?(.*)/.exec(p);
|
|
289
|
+
r.push({ type: 1, index: n, name: x[2], strings: y, ctor: x[1] === "." ? re : x[1] === "?" ? he : x[1] === "@" ? le : Q }), i.removeAttribute(c);
|
|
290
|
+
} else c.startsWith(A) && (r.push({ type: 6, index: n }), i.removeAttribute(c));
|
|
291
|
+
if (Dt.test(i.tagName)) {
|
|
292
|
+
const c = i.textContent.split(A), p = c.length - 1;
|
|
293
|
+
if (p > 0) {
|
|
294
|
+
i.textContent = F ? F.emptyScript : "";
|
|
295
|
+
for (let y = 0; y < p; y++) i.append(c[y], B()), E.nextNode(), r.push({ type: 2, index: ++n });
|
|
296
|
+
i.append(c[p], B());
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
} else if (
|
|
299
|
+
} else if (i.nodeType === 8) if (i.data === Lt) r.push({ type: 2, index: n });
|
|
300
300
|
else {
|
|
301
|
-
let
|
|
302
|
-
for (; (
|
|
301
|
+
let c = -1;
|
|
302
|
+
for (; (c = i.data.indexOf(A, c + 1)) !== -1; ) r.push({ type: 7, index: n }), c += A.length - 1;
|
|
303
303
|
}
|
|
304
|
-
|
|
304
|
+
n++;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
static createElement(t, e) {
|
|
308
|
-
const s =
|
|
308
|
+
const s = L.createElement("template");
|
|
309
309
|
return s.innerHTML = t, s;
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
if (t ===
|
|
314
|
-
let
|
|
315
|
-
const
|
|
316
|
-
return
|
|
312
|
+
function M(o, t, e = o, s) {
|
|
313
|
+
if (t === P) return t;
|
|
314
|
+
let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
315
|
+
const n = W(t) ? void 0 : t._$litDirective$;
|
|
316
|
+
return i?.constructor !== n && (i?._$AO?.(!1), n === void 0 ? i = void 0 : (i = new n(o), i._$AT(o, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = M(o, i._$AS(o, t.values), i, s)), t;
|
|
317
317
|
}
|
|
318
|
-
class
|
|
318
|
+
class ae {
|
|
319
319
|
constructor(t, e) {
|
|
320
320
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
321
321
|
}
|
|
@@ -326,29 +326,29 @@ class te {
|
|
|
326
326
|
return this._$AM._$AU;
|
|
327
327
|
}
|
|
328
328
|
u(t) {
|
|
329
|
-
const { el: { content: e }, parts: s } = this._$AD,
|
|
330
|
-
|
|
331
|
-
let
|
|
332
|
-
for (;
|
|
333
|
-
if (
|
|
334
|
-
let
|
|
335
|
-
|
|
329
|
+
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? L).importNode(e, !0);
|
|
330
|
+
E.currentNode = i;
|
|
331
|
+
let n = E.nextNode(), a = 0, l = 0, r = s[0];
|
|
332
|
+
for (; r !== void 0; ) {
|
|
333
|
+
if (a === r.index) {
|
|
334
|
+
let d;
|
|
335
|
+
r.type === 2 ? d = new V(n, n.nextSibling, this, t) : r.type === 1 ? d = new r.ctor(n, r.name, r.strings, this, t) : r.type === 6 && (d = new ce(n, this, t)), this._$AV.push(d), r = s[++l];
|
|
336
336
|
}
|
|
337
|
-
|
|
337
|
+
a !== r?.index && (n = E.nextNode(), a++);
|
|
338
338
|
}
|
|
339
|
-
return
|
|
339
|
+
return E.currentNode = L, i;
|
|
340
340
|
}
|
|
341
341
|
p(t) {
|
|
342
342
|
let e = 0;
|
|
343
343
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
class
|
|
346
|
+
class V {
|
|
347
347
|
get _$AU() {
|
|
348
348
|
return this._$AM?._$AU ?? this._$Cv;
|
|
349
349
|
}
|
|
350
|
-
constructor(t, e, s,
|
|
351
|
-
this.type = 2, this._$AH =
|
|
350
|
+
constructor(t, e, s, i) {
|
|
351
|
+
this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
352
352
|
}
|
|
353
353
|
get parentNode() {
|
|
354
354
|
let t = this._$AA.parentNode;
|
|
@@ -362,7 +362,7 @@ class I {
|
|
|
362
362
|
return this._$AB;
|
|
363
363
|
}
|
|
364
364
|
_$AI(t, e = this) {
|
|
365
|
-
t =
|
|
365
|
+
t = M(this, t, e), W(t) ? t === f || t == null || t === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : t !== this._$AH && t !== P && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ie(t) ? this.k(t) : this._(t);
|
|
366
366
|
}
|
|
367
367
|
O(t) {
|
|
368
368
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -371,92 +371,92 @@ class I {
|
|
|
371
371
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
372
372
|
}
|
|
373
373
|
_(t) {
|
|
374
|
-
this._$AH !==
|
|
374
|
+
this._$AH !== f && W(this._$AH) ? this._$AA.nextSibling.data = t : this.T(L.createTextNode(t)), this._$AH = t;
|
|
375
375
|
}
|
|
376
376
|
$(t) {
|
|
377
|
-
const { values: e, _$litType$: s } = t,
|
|
378
|
-
if (this._$AH?._$AD ===
|
|
377
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = Z.createElement(Ot(s.h, s.h[0]), this.options)), s);
|
|
378
|
+
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
379
379
|
else {
|
|
380
|
-
const
|
|
381
|
-
|
|
380
|
+
const n = new ae(i, this), a = n.u(this.options);
|
|
381
|
+
n.p(e), this.T(a), this._$AH = n;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
_$AC(t) {
|
|
385
|
-
let e =
|
|
386
|
-
return e === void 0 &&
|
|
385
|
+
let e = Ct.get(t.strings);
|
|
386
|
+
return e === void 0 && Ct.set(t.strings, e = new Z(t)), e;
|
|
387
387
|
}
|
|
388
388
|
k(t) {
|
|
389
|
-
|
|
389
|
+
ct(this._$AH) || (this._$AH = [], this._$AR());
|
|
390
390
|
const e = this._$AH;
|
|
391
|
-
let s,
|
|
392
|
-
for (const
|
|
393
|
-
|
|
391
|
+
let s, i = 0;
|
|
392
|
+
for (const n of t) i === e.length ? e.push(s = new V(this.O(B()), this.O(B()), this, this.options)) : s = e[i], s._$AI(n), i++;
|
|
393
|
+
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
394
394
|
}
|
|
395
395
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
396
396
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
397
|
-
const s =
|
|
398
|
-
|
|
397
|
+
const s = vt(t).nextSibling;
|
|
398
|
+
vt(t).remove(), t = s;
|
|
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 Q {
|
|
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, s,
|
|
413
|
-
this.type = 1, this._$AH =
|
|
412
|
+
constructor(t, e, s, i, n) {
|
|
413
|
+
this.type = 1, this._$AH = f, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = f;
|
|
414
414
|
}
|
|
415
|
-
_$AI(t, e = this, s,
|
|
416
|
-
const
|
|
417
|
-
let
|
|
418
|
-
if (
|
|
415
|
+
_$AI(t, e = this, s, i) {
|
|
416
|
+
const n = this.strings;
|
|
417
|
+
let a = !1;
|
|
418
|
+
if (n === void 0) t = M(this, t, e, 0), a = !W(t) || t !== this._$AH && t !== P, a && (this._$AH = t);
|
|
419
419
|
else {
|
|
420
420
|
const l = t;
|
|
421
|
-
let
|
|
422
|
-
for (t =
|
|
421
|
+
let r, d;
|
|
422
|
+
for (t = n[0], r = 0; r < n.length - 1; r++) d = M(this, l[s + r], e, r), d === P && (d = this._$AH[r]), a ||= !W(d) || d !== this._$AH[r], d === f ? t = f : t !== f && (t += (d ?? "") + n[r + 1]), this._$AH[r] = d;
|
|
423
423
|
}
|
|
424
|
-
|
|
424
|
+
a && !i && this.j(t);
|
|
425
425
|
}
|
|
426
426
|
j(t) {
|
|
427
|
-
t ===
|
|
427
|
+
t === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
class
|
|
430
|
+
class re extends Q {
|
|
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 === f ? void 0 : t;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
class
|
|
438
|
+
class he extends Q {
|
|
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 !== f);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
class
|
|
447
|
-
constructor(t, e, s,
|
|
448
|
-
super(t, e, s,
|
|
446
|
+
class le extends Q {
|
|
447
|
+
constructor(t, e, s, i, n) {
|
|
448
|
+
super(t, e, s, i, n), this.type = 5;
|
|
449
449
|
}
|
|
450
450
|
_$AI(t, e = this) {
|
|
451
|
-
if ((t =
|
|
452
|
-
const s = this._$AH,
|
|
453
|
-
|
|
451
|
+
if ((t = M(this, t, e, 0) ?? f) === P) return;
|
|
452
|
+
const s = this._$AH, i = t === f && s !== f || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== f && (s === f || i);
|
|
453
|
+
i && this.element.removeEventListener(this.name, this, s), 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);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
class
|
|
459
|
+
class ce {
|
|
460
460
|
constructor(t, e, s) {
|
|
461
461
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
462
462
|
}
|
|
@@ -464,22 +464,22 @@ class ne {
|
|
|
464
464
|
return this._$AM._$AU;
|
|
465
465
|
}
|
|
466
466
|
_$AI(t) {
|
|
467
|
-
|
|
467
|
+
M(this, t);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
const
|
|
470
|
+
const de = lt.litHtmlPolyfillSupport;
|
|
471
|
+
de?.(Z, V), (lt.litHtmlVersions ??= []).push("3.3.2");
|
|
472
|
+
const pe = (o, t, e) => {
|
|
473
473
|
const s = e?.renderBefore ?? t;
|
|
474
|
-
let
|
|
475
|
-
if (
|
|
476
|
-
const
|
|
477
|
-
s._$litPart$ =
|
|
474
|
+
let i = s._$litPart$;
|
|
475
|
+
if (i === void 0) {
|
|
476
|
+
const n = e?.renderBefore ?? null;
|
|
477
|
+
s._$litPart$ = i = new V(t.insertBefore(B(), n), n, void 0, e ?? {});
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return i._$AI(o), i;
|
|
480
480
|
};
|
|
481
|
-
const
|
|
482
|
-
class
|
|
481
|
+
const dt = globalThis;
|
|
482
|
+
class k extends O {
|
|
483
483
|
constructor() {
|
|
484
484
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
485
485
|
}
|
|
@@ -489,7 +489,7 @@ class R extends S {
|
|
|
489
489
|
}
|
|
490
490
|
update(t) {
|
|
491
491
|
const e = this.render();
|
|
492
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
492
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = pe(e, this.renderRoot, this.renderOptions);
|
|
493
493
|
}
|
|
494
494
|
connectedCallback() {
|
|
495
495
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -498,79 +498,79 @@ class R extends S {
|
|
|
498
498
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
499
499
|
}
|
|
500
500
|
render() {
|
|
501
|
-
return
|
|
501
|
+
return P;
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
(
|
|
508
|
-
const
|
|
504
|
+
k._$litElement$ = !0, k.finalized = !0, dt.litElementHydrateSupport?.({ LitElement: k });
|
|
505
|
+
const ue = dt.litElementPolyfillSupport;
|
|
506
|
+
ue?.({ LitElement: k });
|
|
507
|
+
(dt.litElementVersions ??= []).push("4.2.2");
|
|
508
|
+
const me = (o) => (t, e) => {
|
|
509
509
|
e !== void 0 ? e.addInitializer(() => {
|
|
510
|
-
customElements.define(
|
|
511
|
-
}) : customElements.define(
|
|
510
|
+
customElements.define(o, t);
|
|
511
|
+
}) : customElements.define(o, t);
|
|
512
512
|
};
|
|
513
|
-
const
|
|
514
|
-
const { kind: s, metadata:
|
|
515
|
-
let
|
|
516
|
-
if (
|
|
517
|
-
const { name:
|
|
513
|
+
const fe = { attribute: !0, type: String, converter: K, reflect: !1, hasChanged: ht }, ye = (o = fe, t, e) => {
|
|
514
|
+
const { kind: s, metadata: i } = e;
|
|
515
|
+
let n = globalThis.litPropertyMetadata.get(i);
|
|
516
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((o = Object.create(o)).wrapped = !0), n.set(e.name, o), s === "accessor") {
|
|
517
|
+
const { name: a } = e;
|
|
518
518
|
return { set(l) {
|
|
519
|
-
const
|
|
520
|
-
t.set.call(this, l), this.requestUpdate(
|
|
519
|
+
const r = t.get.call(this);
|
|
520
|
+
t.set.call(this, l), this.requestUpdate(a, r, o, !0, l);
|
|
521
521
|
}, init(l) {
|
|
522
|
-
return l !== void 0 && this.C(
|
|
522
|
+
return l !== void 0 && this.C(a, void 0, o, l), l;
|
|
523
523
|
} };
|
|
524
524
|
}
|
|
525
525
|
if (s === "setter") {
|
|
526
|
-
const { name:
|
|
526
|
+
const { name: a } = e;
|
|
527
527
|
return function(l) {
|
|
528
|
-
const
|
|
529
|
-
t.call(this, l), this.requestUpdate(
|
|
528
|
+
const r = this[a];
|
|
529
|
+
t.call(this, l), this.requestUpdate(a, r, o, !0, l);
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
532
|
throw Error("Unsupported decorator location: " + s);
|
|
533
533
|
};
|
|
534
|
-
function
|
|
535
|
-
return (t, e) => typeof e == "object" ?
|
|
536
|
-
const
|
|
537
|
-
return
|
|
538
|
-
})(
|
|
534
|
+
function tt(o) {
|
|
535
|
+
return (t, e) => typeof e == "object" ? ye(o, t, e) : ((s, i, n) => {
|
|
536
|
+
const a = i.hasOwnProperty(n);
|
|
537
|
+
return i.constructor.createProperty(n, s), a ? Object.getOwnPropertyDescriptor(i, n) : void 0;
|
|
538
|
+
})(o, t, e);
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
return
|
|
540
|
+
function et(o) {
|
|
541
|
+
return tt({ ...o, state: !0, attribute: !1 });
|
|
542
542
|
}
|
|
543
|
-
const
|
|
544
|
-
function
|
|
545
|
-
return (e, s,
|
|
546
|
-
const
|
|
547
|
-
return
|
|
548
|
-
return
|
|
543
|
+
const ge = (o, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(o, t, e), e);
|
|
544
|
+
function xe(o, t) {
|
|
545
|
+
return (e, s, i) => {
|
|
546
|
+
const n = (a) => a.renderRoot?.querySelector(o) ?? null;
|
|
547
|
+
return ge(e, s, { get() {
|
|
548
|
+
return n(this);
|
|
549
549
|
} });
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
-
var
|
|
553
|
-
for (var
|
|
554
|
-
(
|
|
555
|
-
return s &&
|
|
552
|
+
var $e = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, $ = (o, t, e, s) => {
|
|
553
|
+
for (var i = s > 1 ? void 0 : s ? ve(t, e) : t, n = o.length - 1, a; n >= 0; n--)
|
|
554
|
+
(a = o[n]) && (i = (s ? a(t, e, i) : a(i)) || i);
|
|
555
|
+
return s && i && $e(t, e, i), i;
|
|
556
556
|
};
|
|
557
|
-
|
|
558
|
-
St,
|
|
559
|
-
Et,
|
|
560
|
-
Tt,
|
|
561
|
-
Dt,
|
|
562
|
-
Lt,
|
|
563
|
-
Ot,
|
|
557
|
+
nt.use([
|
|
564
558
|
Pt,
|
|
565
559
|
Mt,
|
|
560
|
+
Nt,
|
|
566
561
|
Ut,
|
|
567
562
|
zt,
|
|
568
|
-
|
|
569
|
-
|
|
563
|
+
Rt,
|
|
564
|
+
It,
|
|
565
|
+
Ht,
|
|
566
|
+
jt,
|
|
567
|
+
Wt,
|
|
568
|
+
kt,
|
|
569
|
+
Bt
|
|
570
570
|
]);
|
|
571
|
-
let
|
|
571
|
+
let g = class extends k {
|
|
572
572
|
constructor() {
|
|
573
|
-
super(), this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 0, this.origHeight = 0, this.modifier = 1, this.version = "1.7.
|
|
573
|
+
super(), this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 0, this.origHeight = 0, this.modifier = 1, this.version = "1.7.2", this.updateThresholdMs = 300, this.maxIntervalSamples = 3, this.template = {
|
|
574
574
|
title: {
|
|
575
575
|
text: "Temperature Change in the Coming Week",
|
|
576
576
|
left: "center",
|
|
@@ -693,82 +693,130 @@ let x = class extends R {
|
|
|
693
693
|
]
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
-
update(
|
|
697
|
-
|
|
696
|
+
update(o) {
|
|
697
|
+
o.has("inputData") && (this.cachedXAxisType = void 0, this.cachedYAxisType = void 0), o.has("inputData") && this.chartContainer && (this.transformData(), this.applyData()), o.has("theme") && (this.registerTheme(this.theme), this.deleteCharts(), this.transformData(), this.applyData()), super.update(o);
|
|
698
698
|
}
|
|
699
|
-
firstUpdated(
|
|
699
|
+
firstUpdated(o) {
|
|
700
700
|
this.registerTheme(this.theme), this.transformData(), this.applyData(), this.chartContainer && (this.resizeObserver = new ResizeObserver(() => {
|
|
701
701
|
this.canvasList.forEach((t) => {
|
|
702
702
|
t.echart?.resize();
|
|
703
703
|
});
|
|
704
704
|
}), this.resizeObserver.observe(this.chartContainer));
|
|
705
705
|
}
|
|
706
|
-
registerTheme(
|
|
706
|
+
registerTheme(o) {
|
|
707
707
|
const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), e = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
708
|
-
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, !
|
|
709
|
-
const s = ["parallel", "geo", "timeline", "visualMap", "markPoint"],
|
|
710
|
-
Object.entries(
|
|
708
|
+
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, !o || !o.theme_object || !o.theme_name) return;
|
|
709
|
+
const s = ["parallel", "geo", "timeline", "visualMap", "markPoint"], i = Object.fromEntries(
|
|
710
|
+
Object.entries(o.theme_object).filter(([n]) => !s.includes(n))
|
|
711
711
|
);
|
|
712
|
-
|
|
712
|
+
nt.registerTheme(o.theme_name, i);
|
|
713
|
+
}
|
|
714
|
+
/** True when bars grow to the right instead of upwards (axis.orientation). */
|
|
715
|
+
isHorizontal() {
|
|
716
|
+
return this.inputData?.axis?.orientation === "horizontal";
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Index of the measured y-value inside a data point's `value` tuple.
|
|
720
|
+
*
|
|
721
|
+
* A point is stored as `[x, y, r]` for a vertical chart. A horizontal chart
|
|
722
|
+
* swaps the first two entries to `[y, x, r]`, because ECharts always maps
|
|
723
|
+
* tuple index 0 to the x axis and index 1 to the y axis — and in a
|
|
724
|
+
* horizontal chart the measured value is what belongs on the x axis.
|
|
725
|
+
*/
|
|
726
|
+
valueIndex() {
|
|
727
|
+
return this.isHorizontal() ? 0 : 1;
|
|
728
|
+
}
|
|
729
|
+
/** Index of the x-value (category/timestamp) inside a data point's `value` tuple. */
|
|
730
|
+
categoryIndex() {
|
|
731
|
+
return this.isHorizontal() ? 1 : 0;
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* Formatter for the on-chart value labels (styling.showValueLabels).
|
|
735
|
+
* Rounds to two decimals to match the numeric axis labels, and leaves
|
|
736
|
+
* categorical y-values untouched.
|
|
737
|
+
*/
|
|
738
|
+
valueLabelFormatter(o) {
|
|
739
|
+
return (t) => {
|
|
740
|
+
const e = Array.isArray(t?.value) ? t.value[o] : t?.value;
|
|
741
|
+
if (e == null || e === "") return "";
|
|
742
|
+
const s = Number(e);
|
|
743
|
+
return isNaN(s) ? String(e) : String(Math.round(s * 100) / 100);
|
|
744
|
+
};
|
|
713
745
|
}
|
|
714
746
|
transformData() {
|
|
715
747
|
if (!this?.inputData?.dataseries?.length) return;
|
|
716
|
-
this.
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
748
|
+
const o = this.isHorizontal(), t = this.valueIndex(), e = this.categoryIndex();
|
|
749
|
+
this.canvasList.forEach((i) => {
|
|
750
|
+
i.series = [], i.doomed = !0;
|
|
751
|
+
}), this.inputData.dataseries.sort((i, n) => (i.advanced?.drawOrder ?? 0) - (n.advanced?.drawOrder ?? 0)), this.inputData.dataseries.forEach((i) => {
|
|
752
|
+
i.advanced ??= {}, i.advanced.chartName ??= "", i.data ??= [];
|
|
753
|
+
const n = [...new Set(i.data.map((r) => r.pivot ?? ""))].sort(), a = ft(i.backgroundColor).monochromatic(n.length).map((r) => r.toHexString()), l = ft(i.borderColor).monochromatic(n.length).map((r) => r.toHexString());
|
|
754
|
+
n.forEach((r, d) => {
|
|
755
|
+
const h = r ?? "", c = i.label ?? "", p = h + (h && c ? " - " : "") + c, y = i.borderColor ? i.advanced?.chartName?.includes("#split#") ? i.borderColor : l[d] : void 0, x = i.backgroundColor ? i.advanced?.chartName?.includes("#split#") ? i.backgroundColor : a[d] : void 0, q = n.length === 1 ? i.data : i.data?.filter((u) => u.pivot === r), b = (u, S, m) => o ? [S, u, m] : [u, S, m];
|
|
756
|
+
let v = this.inputData?.axis?.timeseries ? q?.map((u) => ({
|
|
757
|
+
name: u.x,
|
|
758
|
+
value: b(new Date(u.x ?? "").getTime(), u.y, u.r)
|
|
759
|
+
})) ?? [] : q?.map((u) => ({ name: u.x, value: b(u.x, u.y, u.r) })) ?? [], N = 0, U = 0;
|
|
760
|
+
if (this.xAxisType() === "time" && v) {
|
|
761
|
+
const u = v.map((S) => S.value[e]);
|
|
762
|
+
N = Math.min(...u), U = Math.max(...u);
|
|
727
763
|
}
|
|
728
|
-
const
|
|
729
|
-
id:
|
|
730
|
-
name:
|
|
731
|
-
minDate:
|
|
732
|
-
maxDate:
|
|
733
|
-
type:
|
|
764
|
+
const z = i.yAxis === "right" ? 1 : 0, R = {
|
|
765
|
+
id: p,
|
|
766
|
+
name: p,
|
|
767
|
+
minDate: N,
|
|
768
|
+
maxDate: U,
|
|
769
|
+
type: i.type ?? "line",
|
|
734
770
|
lineStyle: {
|
|
735
|
-
color:
|
|
736
|
-
width:
|
|
737
|
-
type:
|
|
771
|
+
color: y,
|
|
772
|
+
width: i.styling?.borderWidth ?? 2,
|
|
773
|
+
type: i.styling?.borderDash ?? "solid"
|
|
738
774
|
},
|
|
739
775
|
smooth: !1,
|
|
740
776
|
itemStyle: {
|
|
741
|
-
color:
|
|
742
|
-
borderColor:
|
|
743
|
-
borderWidth:
|
|
777
|
+
color: x,
|
|
778
|
+
borderColor: y,
|
|
779
|
+
borderWidth: i.styling?.borderWidth ?? 2
|
|
744
780
|
},
|
|
745
|
-
areaStyle:
|
|
746
|
-
symbol:
|
|
747
|
-
symbolSize: (
|
|
748
|
-
showSymbol:
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
781
|
+
areaStyle: i.styling?.fill ? { color: x } : void 0,
|
|
782
|
+
symbol: i.styling?.pointStyle ?? "circle",
|
|
783
|
+
symbolSize: (u) => u[2] ?? 0,
|
|
784
|
+
showSymbol: i.styling?.pointStyle !== "none",
|
|
785
|
+
label: {
|
|
786
|
+
show: i.styling?.showValueLabels ?? !1,
|
|
787
|
+
// Bars grow upwards when vertical and rightwards when
|
|
788
|
+
// horizontal, so the label sits past the growing end.
|
|
789
|
+
position: o ? "right" : "top",
|
|
790
|
+
fontSize: 12,
|
|
791
|
+
formatter: this.valueLabelFormatter(t)
|
|
792
|
+
},
|
|
793
|
+
data: v ?? [],
|
|
794
|
+
drawOrder: i.advanced?.drawOrder ?? 0,
|
|
795
|
+
valueAxisIndex: z,
|
|
796
|
+
// The secondary value axis is the right y axis when vertical
|
|
797
|
+
// and the top x axis when horizontal.
|
|
798
|
+
xAxisIndex: o ? z : 0,
|
|
799
|
+
yAxisIndex: o ? 0 : z
|
|
752
800
|
};
|
|
753
|
-
let
|
|
754
|
-
|
|
755
|
-
const
|
|
756
|
-
let
|
|
757
|
-
for (;
|
|
758
|
-
|
|
759
|
-
|
|
801
|
+
let _ = i.advanced?.chartName ?? "";
|
|
802
|
+
_ = _.replace("#split#", h);
|
|
803
|
+
const w = this.setupChart(_), X = w?.series.map((u) => u.id) ?? [];
|
|
804
|
+
let D = p, it = 2;
|
|
805
|
+
for (; X.includes(D); )
|
|
806
|
+
D = `${p}_${it++}`;
|
|
807
|
+
R.id = D, w?.series.push(R);
|
|
760
808
|
});
|
|
761
809
|
});
|
|
762
|
-
const
|
|
763
|
-
this.canvasList.forEach((
|
|
764
|
-
|
|
765
|
-
}),
|
|
766
|
-
[...this.canvasList.entries()].sort(([
|
|
767
|
-
const
|
|
768
|
-
return
|
|
810
|
+
const s = [];
|
|
811
|
+
this.canvasList.forEach((i, n) => {
|
|
812
|
+
i.doomed && (i.echart?.dispose(), i.element?.remove(), s.push(n));
|
|
813
|
+
}), s.forEach((i) => this.canvasList.delete(i)), this.canvasList = new Map(
|
|
814
|
+
[...this.canvasList.entries()].sort(([i, n], [a, l]) => {
|
|
815
|
+
const r = n.series?.[0].drawOrder ?? 0, d = l.series?.[0].drawOrder ?? 0;
|
|
816
|
+
return r !== d ? r - d : i.localeCompare(a);
|
|
769
817
|
})
|
|
770
|
-
),
|
|
771
|
-
|
|
818
|
+
), s.length > 0 && this.canvasList.forEach((i) => {
|
|
819
|
+
i.echart?.resize();
|
|
772
820
|
});
|
|
773
821
|
}
|
|
774
822
|
xAxisType() {
|
|
@@ -776,8 +824,8 @@ let x = class extends R {
|
|
|
776
824
|
if (this.inputData?.axis?.timeseries)
|
|
777
825
|
return this.cachedXAxisType = "time", this.cachedXAxisType;
|
|
778
826
|
this.cachedXAxisType = "value";
|
|
779
|
-
for (const
|
|
780
|
-
const t =
|
|
827
|
+
for (const o of this.inputData?.dataseries ?? []) {
|
|
828
|
+
const t = o.data?.find((e) => e.x !== void 0 && e.x !== null);
|
|
781
829
|
if (t) {
|
|
782
830
|
this.cachedXAxisType = isNaN(Number(t.x)) ? "category" : "value";
|
|
783
831
|
break;
|
|
@@ -788,8 +836,8 @@ let x = class extends R {
|
|
|
788
836
|
yAxisType() {
|
|
789
837
|
if (this.cachedYAxisType) return this.cachedYAxisType;
|
|
790
838
|
this.cachedYAxisType = "value";
|
|
791
|
-
for (const
|
|
792
|
-
const t =
|
|
839
|
+
for (const o of this.inputData?.dataseries ?? []) {
|
|
840
|
+
const t = o.data?.find((e) => e.y !== void 0 && e.y !== null);
|
|
793
841
|
if (t) {
|
|
794
842
|
this.cachedYAxisType = isNaN(Number(t.y)) ? "category" : "value";
|
|
795
843
|
break;
|
|
@@ -797,124 +845,165 @@ let x = class extends R {
|
|
|
797
845
|
}
|
|
798
846
|
return this.cachedYAxisType;
|
|
799
847
|
}
|
|
800
|
-
calculateAnimationDuration(
|
|
848
|
+
calculateAnimationDuration(o, t) {
|
|
801
849
|
const e = Date.now();
|
|
802
|
-
if (!(
|
|
850
|
+
if (!(o.series.length === 1) || !this.inputData?.axis?.timeseries)
|
|
803
851
|
return this.updateThresholdMs;
|
|
804
|
-
let
|
|
852
|
+
let i = 0;
|
|
805
853
|
if (this.xAxisType() === "time")
|
|
806
|
-
for (const l of
|
|
807
|
-
const
|
|
808
|
-
for (const
|
|
809
|
-
const
|
|
810
|
-
|
|
854
|
+
for (const l of o.series) {
|
|
855
|
+
const r = l.data;
|
|
856
|
+
for (const d of r || []) {
|
|
857
|
+
const h = d.value?.[0] || 0;
|
|
858
|
+
h > i && (i = h);
|
|
811
859
|
}
|
|
812
860
|
}
|
|
813
861
|
else
|
|
814
|
-
|
|
815
|
-
if (
|
|
816
|
-
if (
|
|
817
|
-
const l = e -
|
|
818
|
-
|
|
862
|
+
i = e;
|
|
863
|
+
if (o.lastMaxTimestamp = o.lastMaxTimestamp ?? 0, i > o.lastMaxTimestamp) {
|
|
864
|
+
if (o.updateIntervals ??= [], o.lastUpdateTime > 0) {
|
|
865
|
+
const l = e - o.lastUpdateTime;
|
|
866
|
+
o.updateIntervals.push(l), o.updateIntervals.length > this.maxIntervalSamples && o.updateIntervals.shift();
|
|
819
867
|
}
|
|
820
|
-
|
|
868
|
+
o.lastUpdateTime = e, o.lastMaxTimestamp = i;
|
|
821
869
|
}
|
|
822
|
-
return
|
|
870
|
+
return o.updateIntervals && o.updateIntervals.length > 0 ? o.updateIntervals.reduce((l, r) => l + r, 0) / o.updateIntervals.length : this.updateThresholdMs;
|
|
823
871
|
}
|
|
824
872
|
applyData() {
|
|
825
|
-
if (this.chartContainer)
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
this.
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
h.
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
const p = i.series.some((f) => (f.yAxisIndex ?? 0) === 1), y = i.series.length === 0 || i.series.some((f) => (f.yAxisIndex ?? 0) === 0), m = o && y, g = o && p, D = this.inputData?.axis?.yAxisLabel ?? "", L = this.inputData?.axis?.yAxisLabelRight ?? "", O = m && !!D, P = g && !!L, M = this.yAxisType(), A = ["value", "log"].includes(M ?? "") ? { fontSize: 14, formatter: (f) => Math.round(f * 100) / 100 } : void 0;
|
|
863
|
-
Object.assign(c[0], {
|
|
864
|
-
type: M,
|
|
865
|
-
name: D,
|
|
866
|
-
scale: this.inputData?.axis?.yAxisScaling ?? !1,
|
|
867
|
-
show: m,
|
|
868
|
-
position: "left",
|
|
869
|
-
nameLocation: "end",
|
|
870
|
-
nameGap: 10,
|
|
871
|
-
nameTextStyle: { align: "left" },
|
|
872
|
-
axisLine: { show: !0 }
|
|
873
|
-
}), A && (c[0].axisLabel = A), Object.assign(c[1], {
|
|
874
|
-
type: M,
|
|
875
|
-
name: g ? L : "",
|
|
876
|
-
scale: this.inputData?.axis?.yAxisScalingRight ?? !1,
|
|
877
|
-
show: g,
|
|
878
|
-
position: "right",
|
|
879
|
-
nameLocation: "end",
|
|
880
|
-
nameGap: 10,
|
|
881
|
-
nameTextStyle: { align: "right" },
|
|
882
|
-
axisLine: { show: !0 },
|
|
883
|
-
splitLine: { show: !1 }
|
|
884
|
-
}), A && (c[1].axisLabel = A), h.series = i.series, h.legend.show = e;
|
|
885
|
-
const Z = (s || O || P ? 30 : 0) + (e && P ? 25 : 0);
|
|
886
|
-
h.grid = {
|
|
887
|
-
...h.grid,
|
|
888
|
-
show: r,
|
|
889
|
-
backgroundColor: "transparent",
|
|
890
|
-
borderWidth: r ? 1 : 0,
|
|
891
|
-
borderColor: this.themeTitleColor ?? "#ccc",
|
|
892
|
-
top: Z,
|
|
893
|
-
bottom: n ? 20 : 0,
|
|
894
|
-
left: m ? 20 : 0,
|
|
895
|
-
right: 0,
|
|
896
|
-
containLabel: n || o
|
|
873
|
+
if (!this.chartContainer) return;
|
|
874
|
+
const o = this.isHorizontal();
|
|
875
|
+
for (const t of this.canvasList.values())
|
|
876
|
+
t.element && this.chartContainer.appendChild(t.element);
|
|
877
|
+
this.canvasList.forEach((t, e) => {
|
|
878
|
+
t.series.sort((m, I) => m.name > I.name ? 1 : -1);
|
|
879
|
+
const s = this.inputData?.axis?.showLegend ?? !0, i = this.inputData?.axis?.showTitle ?? !0, n = this.inputData?.axis?.showXAxis ?? !0, a = this.inputData?.axis?.showYAxis ?? !0, l = this.inputData?.axis?.showBox ?? !1, r = JSON.stringify({
|
|
880
|
+
showLegend: s,
|
|
881
|
+
showTitle: i,
|
|
882
|
+
showXAxis: n,
|
|
883
|
+
showYAxis: a,
|
|
884
|
+
showBox: l,
|
|
885
|
+
xAxisLabel: this.inputData?.axis?.xAxisLabel,
|
|
886
|
+
yAxisLabel: this.inputData?.axis?.yAxisLabel,
|
|
887
|
+
xAxisZoom: this.inputData?.axis?.xAxisZoom,
|
|
888
|
+
yAxisScaling: this.inputData?.axis?.yAxisScaling,
|
|
889
|
+
yAxisLabelRight: this.inputData?.axis?.yAxisLabelRight,
|
|
890
|
+
yAxisScalingRight: this.inputData?.axis?.yAxisScalingRight,
|
|
891
|
+
xAxisType: this.xAxisType(),
|
|
892
|
+
yAxisType: this.yAxisType(),
|
|
893
|
+
// Flipping the orientation swaps which option key holds the
|
|
894
|
+
// single category axis and which holds the value-axis array,
|
|
895
|
+
// so it must force a notMerge rebuild rather than a merge.
|
|
896
|
+
orientation: this.inputData?.axis?.orientation ?? "vertical",
|
|
897
|
+
seriesCount: t.series.length,
|
|
898
|
+
seriesNames: t.series.map((m) => m.name).join(","),
|
|
899
|
+
seriesAxes: t.series.map((m) => m.valueAxisIndex ?? 0).join(","),
|
|
900
|
+
seriesLabels: t.series.map((m) => m.label?.show ? 1 : 0).join(",")
|
|
901
|
+
}), d = t.lastConfig !== r;
|
|
902
|
+
t.lastConfig = r;
|
|
903
|
+
const h = d ? window.structuredClone(this.template) : t.echart?.getOption() ?? window.structuredClone(this.template);
|
|
904
|
+
if (h.title.text = e, h.title.show = i, h.xAxis.name = this.inputData?.axis?.xAxisLabel ?? "", h.xAxis.type = this.xAxisType(), h.xAxis.show = n, this.xAxisType() === "time") {
|
|
905
|
+
const m = t.series.map((C) => C.minDate ?? 1 / 0).reduce((C, st) => Math.min(C, st), 1 / 0), I = t.series.map((C) => C.maxDate ?? 0).reduce((C, st) => Math.max(C, st), 0), Y = Number(this.timeRange?.start), pt = Number(this.timeRange?.end), ut = isNaN(Y) ? m : Y, mt = isNaN(pt) ? I : pt;
|
|
906
|
+
h.xAxis = {
|
|
907
|
+
...h.xAxis,
|
|
908
|
+
min: ut !== 1 / 0 ? ut : (/* @__PURE__ */ new Date()).getTime() - 1440 * 60 * 1e3,
|
|
909
|
+
max: mt !== 0 ? mt : (/* @__PURE__ */ new Date()).getTime()
|
|
897
910
|
};
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
911
|
+
}
|
|
912
|
+
const c = this.inputData?.axis?.xAxisZoom ?? !1;
|
|
913
|
+
h.dataZoom[0].show = c, h.toolbox.show = c;
|
|
914
|
+
const p = Array.isArray(h.yAxis) ? h.yAxis : [h.yAxis ?? {}];
|
|
915
|
+
for (; p.length < 2; ) p.push({});
|
|
916
|
+
h.yAxis = p;
|
|
917
|
+
const y = t.series.some((m) => !!m.label?.show), x = t.series.some((m) => (m.valueAxisIndex ?? 0) === 1), q = t.series.length === 0 || t.series.some((m) => (m.valueAxisIndex ?? 0) === 0), b = a && q, v = a && x, N = this.inputData?.axis?.yAxisLabel ?? "", U = this.inputData?.axis?.yAxisLabelRight ?? "", z = b && !!N, R = v && !!U, _ = this.yAxisType(), w = ["value", "log"].includes(_ ?? "") ? { fontSize: 14, formatter: (m) => Math.round(m * 100) / 100 } : void 0;
|
|
918
|
+
if (Object.assign(p[0], {
|
|
919
|
+
type: _,
|
|
920
|
+
name: N,
|
|
921
|
+
scale: this.inputData?.axis?.yAxisScaling ?? !1,
|
|
922
|
+
show: b,
|
|
923
|
+
position: "left",
|
|
924
|
+
nameLocation: "end",
|
|
925
|
+
nameGap: 10,
|
|
926
|
+
nameTextStyle: { align: "left" },
|
|
927
|
+
axisLine: { show: !0 }
|
|
928
|
+
}), w && (p[0].axisLabel = w), Object.assign(p[1], {
|
|
929
|
+
type: _,
|
|
930
|
+
name: v ? U : "",
|
|
931
|
+
scale: this.inputData?.axis?.yAxisScalingRight ?? !1,
|
|
932
|
+
show: v,
|
|
933
|
+
position: "right",
|
|
934
|
+
nameLocation: "end",
|
|
935
|
+
nameGap: 10,
|
|
936
|
+
nameTextStyle: { align: "right" },
|
|
937
|
+
axisLine: { show: !0 },
|
|
938
|
+
splitLine: { show: !1 }
|
|
939
|
+
}), w && (p[1].axisLabel = w), o) {
|
|
940
|
+
const m = Array.isArray(h.xAxis) ? h.xAxis[0] : h.xAxis;
|
|
941
|
+
h.yAxis = {
|
|
942
|
+
...m,
|
|
943
|
+
position: "left",
|
|
944
|
+
// Read top-to-bottom, so the first data point is the top
|
|
945
|
+
// bar — the convention for ranked horizontal bar charts.
|
|
946
|
+
inverse: !0,
|
|
947
|
+
// 'start' is the top of an inverted axis, which keeps the
|
|
948
|
+
// axis name clear of the value axis running along the bottom.
|
|
949
|
+
// When a secondary value axis is in use it is drawn along
|
|
950
|
+
// the top, so the name has to clear its tick labels too.
|
|
951
|
+
nameLocation: "start",
|
|
952
|
+
nameGap: v ? 30 : 10,
|
|
953
|
+
nameTextStyle: { align: "left" }
|
|
954
|
+
}, h.xAxis = p.map((I, Y) => ({
|
|
955
|
+
...I,
|
|
956
|
+
position: Y === 0 ? "bottom" : "top",
|
|
957
|
+
nameLocation: "middle",
|
|
958
|
+
nameGap: 27,
|
|
959
|
+
nameTextStyle: { align: "center" }
|
|
960
|
+
})), h.dataZoom = [
|
|
961
|
+
{ ...h.dataZoom?.[0] ?? {}, xAxisIndex: void 0, yAxisIndex: [0] }
|
|
962
|
+
];
|
|
963
|
+
}
|
|
964
|
+
h.series = t.series, h.legend.show = s;
|
|
965
|
+
const X = (i || z || R ? 30 : 0) + (s && R ? 25 : 0), D = 40, it = c && !o ? D : 0, u = c && o ? D : 0;
|
|
966
|
+
h.grid = {
|
|
967
|
+
...h.grid,
|
|
968
|
+
show: l,
|
|
969
|
+
backgroundColor: "transparent",
|
|
970
|
+
borderWidth: l ? 1 : 0,
|
|
971
|
+
borderColor: this.themeTitleColor ?? "#ccc",
|
|
972
|
+
top: X,
|
|
973
|
+
// The category axis sits at the bottom when vertical and on the
|
|
974
|
+
// left when horizontal; the value axis is the other way round.
|
|
975
|
+
// The zoom slider is not accounted for by `containLabel`, so its
|
|
976
|
+
// thickness has to be reserved here as well — see ZOOM_THICKNESS.
|
|
977
|
+
bottom: ((o ? b : n) ? 20 : 0) + it,
|
|
978
|
+
left: (o ? n : b) ? 20 : 0,
|
|
979
|
+
// A horizontal chart grows towards the right edge, so the last
|
|
980
|
+
// axis tick and any value label printed past the end of a bar
|
|
981
|
+
// need room that `containLabel` does not reserve for them.
|
|
982
|
+
right: (o ? y ? 45 : 15 : 0) + u,
|
|
983
|
+
containLabel: n || a
|
|
984
|
+
}, c && Object.assign(
|
|
985
|
+
h.dataZoom[0],
|
|
986
|
+
o ? { right: 0, top: X, bottom: 20, left: void 0 } : { bottom: 0, left: void 0, right: void 0, top: void 0 }
|
|
987
|
+
);
|
|
988
|
+
const S = this.updateThresholdMs;
|
|
989
|
+
h.animation = !0, h.animationEasing = "linear", h.animationDuration = S, h.animationDurationUpdate = S, t.echart?.on("finished", () => t.drawing = !1), t.drawing = !0, t.echart?.setOption(h, { notMerge: d, lazyUpdate: !0 });
|
|
990
|
+
});
|
|
902
991
|
}
|
|
903
992
|
deleteCharts() {
|
|
904
|
-
this.canvasList.forEach((
|
|
905
|
-
|
|
993
|
+
this.canvasList.forEach((o, t) => {
|
|
994
|
+
o.echart?.dispose(), o.element?.remove(), this.canvasList.delete(t);
|
|
906
995
|
});
|
|
907
996
|
}
|
|
908
|
-
setupChart(
|
|
909
|
-
const t = this.canvasList.get(
|
|
997
|
+
setupChart(o) {
|
|
998
|
+
const t = this.canvasList.get(o);
|
|
910
999
|
if (t)
|
|
911
1000
|
return delete t.doomed, t;
|
|
912
1001
|
if (!this.chartContainer)
|
|
913
1002
|
return;
|
|
914
1003
|
const e = document.createElement("div");
|
|
915
|
-
e.setAttribute("name",
|
|
916
|
-
const
|
|
917
|
-
echart:
|
|
1004
|
+
e.setAttribute("name", o), e.setAttribute("class", "sizer"), this.chartContainer.appendChild(e);
|
|
1005
|
+
const i = {
|
|
1006
|
+
echart: nt.init(e, this.theme?.theme_name),
|
|
918
1007
|
series: [],
|
|
919
1008
|
element: e,
|
|
920
1009
|
drawing: !1,
|
|
@@ -922,13 +1011,13 @@ let x = class extends R {
|
|
|
922
1011
|
updateIntervals: [],
|
|
923
1012
|
lastMaxTimestamp: 0
|
|
924
1013
|
};
|
|
925
|
-
return this.canvasList.set(
|
|
1014
|
+
return this.canvasList.set(o, i), i;
|
|
926
1015
|
}
|
|
927
1016
|
disconnectedCallback() {
|
|
928
1017
|
this.resizeObserver && this.chartContainer && (this.resizeObserver.unobserve(this.chartContainer), this.resizeObserver.disconnect()), super.disconnectedCallback();
|
|
929
1018
|
}
|
|
930
1019
|
render() {
|
|
931
|
-
return
|
|
1020
|
+
return oe`
|
|
932
1021
|
<div
|
|
933
1022
|
class="wrapper"
|
|
934
1023
|
style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
|
|
@@ -951,7 +1040,7 @@ let x = class extends R {
|
|
|
951
1040
|
`;
|
|
952
1041
|
}
|
|
953
1042
|
};
|
|
954
|
-
|
|
1043
|
+
g.styles = Vt`
|
|
955
1044
|
:host {
|
|
956
1045
|
display: block;
|
|
957
1046
|
font-family: sans-serif;
|
|
@@ -1029,33 +1118,33 @@ x.styles = jt`
|
|
|
1029
1118
|
}
|
|
1030
1119
|
`;
|
|
1031
1120
|
$([
|
|
1032
|
-
|
|
1033
|
-
],
|
|
1121
|
+
tt({ type: Object })
|
|
1122
|
+
], g.prototype, "inputData", 2);
|
|
1034
1123
|
$([
|
|
1035
|
-
|
|
1036
|
-
],
|
|
1124
|
+
tt({ type: Object })
|
|
1125
|
+
], g.prototype, "theme", 2);
|
|
1037
1126
|
$([
|
|
1038
|
-
|
|
1039
|
-
],
|
|
1127
|
+
tt({ type: Object })
|
|
1128
|
+
], g.prototype, "timeRange", 2);
|
|
1040
1129
|
$([
|
|
1041
|
-
|
|
1042
|
-
],
|
|
1130
|
+
et()
|
|
1131
|
+
], g.prototype, "canvasList", 2);
|
|
1043
1132
|
$([
|
|
1044
|
-
|
|
1045
|
-
],
|
|
1133
|
+
et()
|
|
1134
|
+
], g.prototype, "themeBgColor", 2);
|
|
1046
1135
|
$([
|
|
1047
|
-
|
|
1048
|
-
],
|
|
1136
|
+
et()
|
|
1137
|
+
], g.prototype, "themeTitleColor", 2);
|
|
1049
1138
|
$([
|
|
1050
|
-
|
|
1051
|
-
],
|
|
1139
|
+
et()
|
|
1140
|
+
], g.prototype, "themeSubtitleColor", 2);
|
|
1052
1141
|
$([
|
|
1053
|
-
|
|
1054
|
-
],
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
],
|
|
1142
|
+
xe(".chart-container")
|
|
1143
|
+
], g.prototype, "chartContainer", 2);
|
|
1144
|
+
g = $([
|
|
1145
|
+
me("widget-linechart-1.7.2")
|
|
1146
|
+
], g);
|
|
1058
1147
|
export {
|
|
1059
|
-
|
|
1148
|
+
g as WidgetLinechart
|
|
1060
1149
|
};
|
|
1061
1150
|
//# sourceMappingURL=widget-linechart.js.map
|