@record-evolution/widget-linechart 1.6.34 → 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 +565 -427
- package/dist/widget-linechart.js.map +1 -1
- package/package.json +1 -1
- package/src/default-data.json +14 -11
- package/src/definition-schema.d.ts +30 -5
- package/src/definition-schema.json +65 -4
- package/src/widget-linechart.ts +250 -43
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
|
|
9
|
-
constructor(t, e,
|
|
10
|
-
if (this._$cssResult$ = !0,
|
|
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
|
+
constructor(t, e, 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 (
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
if (at && t === void 0) {
|
|
17
|
+
const s = e !== void 0 && e.length === 1;
|
|
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,115 +23,115 @@ let ut = 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
|
|
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
|
-
for (const
|
|
42
|
-
return
|
|
43
|
-
})(
|
|
44
|
-
const { is:
|
|
41
|
+
for (const s of t.cssRules) e += s.cssText;
|
|
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
|
|
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
|
-
static getPropertyDescriptor(t, e,
|
|
88
|
-
const { get:
|
|
87
|
+
static getPropertyDescriptor(t, e, s) {
|
|
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
|
-
n?.call(this,
|
|
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,
|
|
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 [
|
|
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
|
-
for (const [e,
|
|
119
|
-
const
|
|
120
|
-
|
|
118
|
+
for (const [e, s] of this.elementProperties) {
|
|
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
|
}
|
|
124
124
|
static finalizeStyles(t) {
|
|
125
125
|
const e = [];
|
|
126
126
|
if (Array.isArray(t)) {
|
|
127
|
-
const
|
|
128
|
-
for (const
|
|
129
|
-
} else t !== void 0 && e.push(
|
|
127
|
+
const s = new Set(t.flat(1 / 0).reverse());
|
|
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) {
|
|
133
|
-
const
|
|
134
|
-
return
|
|
133
|
+
const s = e.attribute;
|
|
134
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
135
135
|
}
|
|
136
136
|
constructor() {
|
|
137
137
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -147,12 +147,12 @@ let S = class extends HTMLElement {
|
|
|
147
147
|
}
|
|
148
148
|
_$E_() {
|
|
149
149
|
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
150
|
-
for (const
|
|
150
|
+
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
|
151
151
|
t.size > 0 && (this._$Ep = t);
|
|
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?.());
|
|
@@ -162,35 +162,35 @@ let S = class extends HTMLElement {
|
|
|
162
162
|
disconnectedCallback() {
|
|
163
163
|
this._$EO?.forEach((t) => t.hostDisconnected?.());
|
|
164
164
|
}
|
|
165
|
-
attributeChangedCallback(t, e,
|
|
166
|
-
this._$AK(t,
|
|
165
|
+
attributeChangedCallback(t, e, s) {
|
|
166
|
+
this._$AK(t, s);
|
|
167
167
|
}
|
|
168
168
|
_$ET(t, e) {
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
const n = (
|
|
172
|
-
this._$Em = t, n == null ? this.removeAttribute(
|
|
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
|
|
177
|
-
if (
|
|
178
|
-
const n =
|
|
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,
|
|
184
|
+
requestUpdate(t, e, s, i = !1, n) {
|
|
185
185
|
if (t !== void 0) {
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
188
|
-
this.C(t, e,
|
|
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
|
+
this.C(t, e, s);
|
|
189
189
|
}
|
|
190
190
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
191
191
|
}
|
|
192
|
-
C(t, e, { useDefault:
|
|
193
|
-
|
|
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,21 +209,21 @@ 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
|
-
const
|
|
216
|
-
if (
|
|
217
|
-
const { wrapped:
|
|
218
|
-
|
|
215
|
+
const s = this.constructor.elementProperties;
|
|
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;
|
|
222
222
|
const e = this._$AL;
|
|
223
223
|
try {
|
|
224
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((
|
|
225
|
-
} catch (
|
|
226
|
-
throw t = !1, this._$EM(),
|
|
224
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(e)) : this._$EM();
|
|
225
|
+
} catch (s) {
|
|
226
|
+
throw t = !1, this._$EM(), s;
|
|
227
227
|
}
|
|
228
228
|
t && this._$AE(e);
|
|
229
229
|
}
|
|
@@ -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
|
|
269
|
-
for (;
|
|
270
|
-
const
|
|
271
|
-
n +=
|
|
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
|
|
276
|
-
constructor({ strings: t, _$litType$: e },
|
|
277
|
-
let
|
|
275
|
+
class Z {
|
|
276
|
+
constructor({ strings: t, _$litType$: e }, s) {
|
|
277
|
+
let i;
|
|
278
278
|
this.parts = [];
|
|
279
|
-
let n = 0,
|
|
280
|
-
const l = t.length - 1,
|
|
281
|
-
if (this.el =
|
|
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
282
|
const c = this.el.content.firstChild;
|
|
283
283
|
c.replaceWith(...c.childNodes);
|
|
284
284
|
}
|
|
285
|
-
for (; (
|
|
286
|
-
if (
|
|
287
|
-
if (
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
} else c.startsWith(
|
|
291
|
-
if (
|
|
292
|
-
const c =
|
|
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
301
|
let c = -1;
|
|
302
|
-
for (; (c =
|
|
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
|
|
309
|
-
return
|
|
308
|
+
const s = L.createElement("template");
|
|
309
|
+
return s.innerHTML = t, s;
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
if (t ===
|
|
314
|
-
let
|
|
315
|
-
const n =
|
|
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 Zt {
|
|
|
326
326
|
return this._$AM._$AU;
|
|
327
327
|
}
|
|
328
328
|
u(t) {
|
|
329
|
-
const { el: { content: e }, parts:
|
|
330
|
-
|
|
331
|
-
let n =
|
|
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
|
-
for (const
|
|
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,
|
|
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 R {
|
|
|
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,115 +371,115 @@ class R {
|
|
|
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$:
|
|
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 n = new
|
|
381
|
-
n.p(e), this.T(
|
|
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
|
|
392
|
-
for (const n of t)
|
|
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
|
|
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,
|
|
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,
|
|
415
|
+
_$AI(t, e = this, s, i) {
|
|
416
416
|
const n = this.strings;
|
|
417
|
-
let
|
|
418
|
-
if (n === void 0) t =
|
|
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 = n[0],
|
|
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,
|
|
448
|
-
super(t, e,
|
|
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
|
|
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
|
|
460
|
-
constructor(t, e,
|
|
461
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options =
|
|
459
|
+
class ce {
|
|
460
|
+
constructor(t, e, s) {
|
|
461
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
462
462
|
}
|
|
463
463
|
get _$AU() {
|
|
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
|
|
473
|
-
const
|
|
474
|
-
let
|
|
475
|
-
if (
|
|
470
|
+
const de = lt.litHtmlPolyfillSupport;
|
|
471
|
+
de?.(Z, V), (lt.litHtmlVersions ??= []).push("3.3.2");
|
|
472
|
+
const pe = (o, t, e) => {
|
|
473
|
+
const s = e?.renderBefore ?? t;
|
|
474
|
+
let i = s._$litPart$;
|
|
475
|
+
if (i === void 0) {
|
|
476
476
|
const n = e?.renderBefore ?? null;
|
|
477
|
-
|
|
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 U 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 U 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:
|
|
515
|
-
let n = globalThis.litPropertyMetadata.get(
|
|
516
|
-
if (n === void 0 && globalThis.litPropertyMetadata.set(
|
|
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
|
-
if (
|
|
526
|
-
const { name:
|
|
525
|
+
if (s === "setter") {
|
|
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
|
-
throw Error("Unsupported decorator location: " +
|
|
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,
|
|
546
|
-
const n = (
|
|
547
|
-
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
548
|
return n(this);
|
|
549
549
|
} });
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
-
var
|
|
553
|
-
for (var
|
|
554
|
-
(
|
|
555
|
-
return
|
|
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
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
557
|
+
nt.use([
|
|
558
|
+
Pt,
|
|
559
|
+
Mt,
|
|
560
|
+
Nt,
|
|
561
|
+
Ut,
|
|
562
|
+
zt,
|
|
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.
|
|
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",
|
|
@@ -629,21 +629,45 @@ let $ = class extends U {
|
|
|
629
629
|
fontSize: 14
|
|
630
630
|
}
|
|
631
631
|
},
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
632
|
+
// index 0 = left (primary) axis, index 1 = right (secondary) axis.
|
|
633
|
+
// Must stay function-free: the template is copied via structuredClone.
|
|
634
|
+
yAxis: [
|
|
635
|
+
{
|
|
636
|
+
type: "value",
|
|
637
|
+
nameLocation: "middle",
|
|
638
|
+
name: "Temperature (°C)",
|
|
639
|
+
nameGap: 30,
|
|
640
|
+
position: "left",
|
|
641
|
+
axisLabel: {
|
|
642
|
+
fontSize: 14
|
|
643
|
+
},
|
|
644
|
+
axisLine: {
|
|
645
|
+
lineStyle: {
|
|
646
|
+
width: void 0
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
scale: !1
|
|
644
650
|
},
|
|
645
|
-
|
|
646
|
-
|
|
651
|
+
{
|
|
652
|
+
type: "value",
|
|
653
|
+
position: "right",
|
|
654
|
+
show: !1,
|
|
655
|
+
name: "",
|
|
656
|
+
nameGap: 30,
|
|
657
|
+
axisLabel: {
|
|
658
|
+
fontSize: 14
|
|
659
|
+
},
|
|
660
|
+
axisLine: {
|
|
661
|
+
lineStyle: {
|
|
662
|
+
width: void 0
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
splitLine: {
|
|
666
|
+
show: !1
|
|
667
|
+
},
|
|
668
|
+
scale: !1
|
|
669
|
+
}
|
|
670
|
+
],
|
|
647
671
|
series: [
|
|
648
672
|
{
|
|
649
673
|
name: "Highest",
|
|
@@ -669,81 +693,130 @@ let $ = class extends U {
|
|
|
669
693
|
]
|
|
670
694
|
};
|
|
671
695
|
}
|
|
672
|
-
update(
|
|
673
|
-
|
|
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);
|
|
674
698
|
}
|
|
675
|
-
firstUpdated(
|
|
699
|
+
firstUpdated(o) {
|
|
676
700
|
this.registerTheme(this.theme), this.transformData(), this.applyData(), this.chartContainer && (this.resizeObserver = new ResizeObserver(() => {
|
|
677
701
|
this.canvasList.forEach((t) => {
|
|
678
702
|
t.echart?.resize();
|
|
679
703
|
});
|
|
680
704
|
}), this.resizeObserver.observe(this.chartContainer));
|
|
681
705
|
}
|
|
682
|
-
registerTheme(
|
|
706
|
+
registerTheme(o) {
|
|
683
707
|
const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), e = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
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, !
|
|
685
|
-
const
|
|
686
|
-
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))
|
|
687
711
|
);
|
|
688
|
-
|
|
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
|
+
};
|
|
689
745
|
}
|
|
690
746
|
transformData() {
|
|
691
747
|
if (!this?.inputData?.dataseries?.length) return;
|
|
692
|
-
this.
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
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);
|
|
703
763
|
}
|
|
704
|
-
const
|
|
705
|
-
id:
|
|
706
|
-
name:
|
|
707
|
-
minDate:
|
|
708
|
-
maxDate:
|
|
709
|
-
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",
|
|
710
770
|
lineStyle: {
|
|
711
|
-
color:
|
|
712
|
-
width:
|
|
713
|
-
type:
|
|
771
|
+
color: y,
|
|
772
|
+
width: i.styling?.borderWidth ?? 2,
|
|
773
|
+
type: i.styling?.borderDash ?? "solid"
|
|
714
774
|
},
|
|
715
775
|
smooth: !1,
|
|
716
776
|
itemStyle: {
|
|
717
|
-
color:
|
|
718
|
-
borderColor:
|
|
719
|
-
borderWidth:
|
|
777
|
+
color: x,
|
|
778
|
+
borderColor: y,
|
|
779
|
+
borderWidth: i.styling?.borderWidth ?? 2
|
|
720
780
|
},
|
|
721
|
-
areaStyle:
|
|
722
|
-
symbol:
|
|
723
|
-
symbolSize: (
|
|
724
|
-
showSymbol:
|
|
725
|
-
|
|
726
|
-
|
|
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
|
|
727
800
|
};
|
|
728
|
-
let
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
let
|
|
732
|
-
for (;
|
|
733
|
-
|
|
734
|
-
|
|
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);
|
|
735
808
|
});
|
|
736
809
|
});
|
|
737
810
|
const s = [];
|
|
738
|
-
this.canvasList.forEach((
|
|
739
|
-
|
|
740
|
-
}), s.forEach((
|
|
741
|
-
[...this.canvasList.entries()].sort(([
|
|
742
|
-
const
|
|
743
|
-
return
|
|
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);
|
|
744
817
|
})
|
|
745
|
-
), s.length > 0 && this.canvasList.forEach((
|
|
746
|
-
|
|
818
|
+
), s.length > 0 && this.canvasList.forEach((i) => {
|
|
819
|
+
i.echart?.resize();
|
|
747
820
|
});
|
|
748
821
|
}
|
|
749
822
|
xAxisType() {
|
|
@@ -751,8 +824,8 @@ let $ = class extends U {
|
|
|
751
824
|
if (this.inputData?.axis?.timeseries)
|
|
752
825
|
return this.cachedXAxisType = "time", this.cachedXAxisType;
|
|
753
826
|
this.cachedXAxisType = "value";
|
|
754
|
-
for (const
|
|
755
|
-
const t =
|
|
827
|
+
for (const o of this.inputData?.dataseries ?? []) {
|
|
828
|
+
const t = o.data?.find((e) => e.x !== void 0 && e.x !== null);
|
|
756
829
|
if (t) {
|
|
757
830
|
this.cachedXAxisType = isNaN(Number(t.x)) ? "category" : "value";
|
|
758
831
|
break;
|
|
@@ -763,8 +836,8 @@ let $ = class extends U {
|
|
|
763
836
|
yAxisType() {
|
|
764
837
|
if (this.cachedYAxisType) return this.cachedYAxisType;
|
|
765
838
|
this.cachedYAxisType = "value";
|
|
766
|
-
for (const
|
|
767
|
-
const t =
|
|
839
|
+
for (const o of this.inputData?.dataseries ?? []) {
|
|
840
|
+
const t = o.data?.find((e) => e.y !== void 0 && e.y !== null);
|
|
768
841
|
if (t) {
|
|
769
842
|
this.cachedYAxisType = isNaN(Number(t.y)) ? "category" : "value";
|
|
770
843
|
break;
|
|
@@ -772,100 +845,165 @@ let $ = class extends U {
|
|
|
772
845
|
}
|
|
773
846
|
return this.cachedYAxisType;
|
|
774
847
|
}
|
|
775
|
-
calculateAnimationDuration(
|
|
848
|
+
calculateAnimationDuration(o, t) {
|
|
776
849
|
const e = Date.now();
|
|
777
|
-
if (!(
|
|
850
|
+
if (!(o.series.length === 1) || !this.inputData?.axis?.timeseries)
|
|
778
851
|
return this.updateThresholdMs;
|
|
779
|
-
let
|
|
852
|
+
let i = 0;
|
|
780
853
|
if (this.xAxisType() === "time")
|
|
781
|
-
for (const l of
|
|
782
|
-
const
|
|
783
|
-
for (const
|
|
784
|
-
const
|
|
785
|
-
|
|
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);
|
|
786
859
|
}
|
|
787
860
|
}
|
|
788
861
|
else
|
|
789
|
-
|
|
790
|
-
if (
|
|
791
|
-
if (
|
|
792
|
-
const l = e -
|
|
793
|
-
|
|
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();
|
|
794
867
|
}
|
|
795
|
-
|
|
868
|
+
o.lastUpdateTime = e, o.lastMaxTimestamp = i;
|
|
796
869
|
}
|
|
797
|
-
return
|
|
870
|
+
return o.updateIntervals && o.updateIntervals.length > 0 ? o.updateIntervals.reduce((l, r) => l + r, 0) / o.updateIntervals.length : this.updateThresholdMs;
|
|
798
871
|
}
|
|
799
872
|
applyData() {
|
|
800
|
-
if (this.chartContainer)
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
this.
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
a.grid = {
|
|
838
|
-
...a.grid,
|
|
839
|
-
show: o,
|
|
840
|
-
backgroundColor: "transparent",
|
|
841
|
-
borderWidth: o ? 1 : 0,
|
|
842
|
-
borderColor: this.themeTitleColor ?? "#ccc",
|
|
843
|
-
top: y,
|
|
844
|
-
bottom: r ? 20 : 0,
|
|
845
|
-
left: n ? 20 : 0,
|
|
846
|
-
right: 0,
|
|
847
|
-
containLabel: r || n
|
|
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()
|
|
848
910
|
};
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
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
|
+
});
|
|
853
991
|
}
|
|
854
992
|
deleteCharts() {
|
|
855
|
-
this.canvasList.forEach((
|
|
856
|
-
|
|
993
|
+
this.canvasList.forEach((o, t) => {
|
|
994
|
+
o.echart?.dispose(), o.element?.remove(), this.canvasList.delete(t);
|
|
857
995
|
});
|
|
858
996
|
}
|
|
859
|
-
setupChart(
|
|
860
|
-
const t = this.canvasList.get(
|
|
997
|
+
setupChart(o) {
|
|
998
|
+
const t = this.canvasList.get(o);
|
|
861
999
|
if (t)
|
|
862
1000
|
return delete t.doomed, t;
|
|
863
1001
|
if (!this.chartContainer)
|
|
864
1002
|
return;
|
|
865
1003
|
const e = document.createElement("div");
|
|
866
|
-
e.setAttribute("name",
|
|
867
|
-
const
|
|
868
|
-
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),
|
|
869
1007
|
series: [],
|
|
870
1008
|
element: e,
|
|
871
1009
|
drawing: !1,
|
|
@@ -873,13 +1011,13 @@ let $ = class extends U {
|
|
|
873
1011
|
updateIntervals: [],
|
|
874
1012
|
lastMaxTimestamp: 0
|
|
875
1013
|
};
|
|
876
|
-
return this.canvasList.set(
|
|
1014
|
+
return this.canvasList.set(o, i), i;
|
|
877
1015
|
}
|
|
878
1016
|
disconnectedCallback() {
|
|
879
1017
|
this.resizeObserver && this.chartContainer && (this.resizeObserver.unobserve(this.chartContainer), this.resizeObserver.disconnect()), super.disconnectedCallback();
|
|
880
1018
|
}
|
|
881
1019
|
render() {
|
|
882
|
-
return
|
|
1020
|
+
return oe`
|
|
883
1021
|
<div
|
|
884
1022
|
class="wrapper"
|
|
885
1023
|
style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
|
|
@@ -902,7 +1040,7 @@ let $ = class extends U {
|
|
|
902
1040
|
`;
|
|
903
1041
|
}
|
|
904
1042
|
};
|
|
905
|
-
|
|
1043
|
+
g.styles = Vt`
|
|
906
1044
|
:host {
|
|
907
1045
|
display: block;
|
|
908
1046
|
font-family: sans-serif;
|
|
@@ -979,34 +1117,34 @@ $.styles = Pt`
|
|
|
979
1117
|
justify-content: center;
|
|
980
1118
|
}
|
|
981
1119
|
`;
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
],
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
],
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
],
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
],
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
],
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
],
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
],
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
],
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
],
|
|
1120
|
+
$([
|
|
1121
|
+
tt({ type: Object })
|
|
1122
|
+
], g.prototype, "inputData", 2);
|
|
1123
|
+
$([
|
|
1124
|
+
tt({ type: Object })
|
|
1125
|
+
], g.prototype, "theme", 2);
|
|
1126
|
+
$([
|
|
1127
|
+
tt({ type: Object })
|
|
1128
|
+
], g.prototype, "timeRange", 2);
|
|
1129
|
+
$([
|
|
1130
|
+
et()
|
|
1131
|
+
], g.prototype, "canvasList", 2);
|
|
1132
|
+
$([
|
|
1133
|
+
et()
|
|
1134
|
+
], g.prototype, "themeBgColor", 2);
|
|
1135
|
+
$([
|
|
1136
|
+
et()
|
|
1137
|
+
], g.prototype, "themeTitleColor", 2);
|
|
1138
|
+
$([
|
|
1139
|
+
et()
|
|
1140
|
+
], g.prototype, "themeSubtitleColor", 2);
|
|
1141
|
+
$([
|
|
1142
|
+
xe(".chart-container")
|
|
1143
|
+
], g.prototype, "chartContainer", 2);
|
|
1144
|
+
g = $([
|
|
1145
|
+
me("widget-linechart-1.7.2")
|
|
1146
|
+
], g);
|
|
1009
1147
|
export {
|
|
1010
|
-
|
|
1148
|
+
g as WidgetLinechart
|
|
1011
1149
|
};
|
|
1012
1150
|
//# sourceMappingURL=widget-linechart.js.map
|