@record-evolution/widget-linechart 1.6.30 → 1.6.32
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 +146 -141
- package/dist/widget-linechart.js.map +1 -1
- package/package.json +2 -2
- package/src/default-data.json +1 -1
- package/src/definition-schema.d.ts +65 -23
- package/src/definition-schema.json +68 -39
- package/src/widget-linechart.ts +11 -1
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 J from "echarts/core";
|
|
2
|
+
import { GridComponent as xt, TitleComponent as vt, ToolboxComponent as _t, TooltipComponent as At, LegendComponent as bt, DataZoomComponent as wt } from "echarts/components";
|
|
3
|
+
import { LineChart as Ct, BarChart as St, ScatterChart as Et } from "echarts/charts";
|
|
4
|
+
import { UniversalTransition as Tt, LegacyGridContainLabel as Dt } from "echarts/features";
|
|
5
|
+
import { CanvasRenderer as Ot } from "echarts/renderers";
|
|
6
|
+
import et from "tinycolor2";
|
|
7
|
+
const I = globalThis, K = I.ShadowRoot && (I.ShadyCSS === void 0 || I.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Y = /* @__PURE__ */ Symbol(), st = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
let ut = class {
|
|
9
9
|
constructor(t, e, i) {
|
|
10
|
-
if (this._$cssResult$ = !0, i !==
|
|
10
|
+
if (this._$cssResult$ = !0, i !== Y) 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 (K && t === void 0) {
|
|
17
17
|
const i = e !== void 0 && e.length === 1;
|
|
18
|
-
i && (t =
|
|
18
|
+
i && (t = st.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && st.set(e, t));
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
@@ -23,28 +23,28 @@ let dt = class {
|
|
|
23
23
|
return this.cssText;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const
|
|
26
|
+
const Pt = (s) => new ut(typeof s == "string" ? s : s + "", void 0, Y), Lt = (s, ...t) => {
|
|
27
27
|
const e = s.length === 1 ? s[0] : t.reduce((i, r, n) => i + ((o) => {
|
|
28
28
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
29
29
|
if (typeof o == "number") return o;
|
|
30
30
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
31
31
|
})(r) + s[n + 1], s[0]);
|
|
32
|
-
return new
|
|
33
|
-
},
|
|
34
|
-
if (
|
|
32
|
+
return new ut(e, s, Y);
|
|
33
|
+
}, Mt = (s, t) => {
|
|
34
|
+
if (K) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
35
35
|
else for (const e of t) {
|
|
36
|
-
const i = document.createElement("style"), r =
|
|
36
|
+
const i = document.createElement("style"), r = I.litNonce;
|
|
37
37
|
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, it = K ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
|
|
40
40
|
let e = "";
|
|
41
41
|
for (const i of t.cssRules) e += i.cssText;
|
|
42
|
-
return
|
|
42
|
+
return Pt(e);
|
|
43
43
|
})(s) : s;
|
|
44
|
-
const { is:
|
|
44
|
+
const { is: Ut, defineProperty: Nt, getOwnPropertyDescriptor: zt, getOwnPropertyNames: Ht, getOwnPropertySymbols: Rt, getPrototypeOf: jt } = Object, W = globalThis, rt = W.trustedTypes, It = rt ? rt.emptyScript : "", kt = W.reactiveElementPolyfillSupport, M = (s, t) => s, k = { toAttribute(s, t) {
|
|
45
45
|
switch (t) {
|
|
46
46
|
case Boolean:
|
|
47
|
-
s = s ?
|
|
47
|
+
s = s ? It : null;
|
|
48
48
|
break;
|
|
49
49
|
case Object:
|
|
50
50
|
case Array:
|
|
@@ -69,8 +69,8 @@ const { is: Lt, defineProperty: Mt, getOwnPropertyDescriptor: Ut, getOwnProperty
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
return e;
|
|
72
|
-
} },
|
|
73
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
72
|
+
} }, X = (s, t) => !Ut(s, t), nt = { attribute: !0, type: String, converter: k, reflect: !1, useDefault: !1, hasChanged: X };
|
|
73
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), W.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
74
74
|
let S = class extends HTMLElement {
|
|
75
75
|
static addInitializer(t) {
|
|
76
76
|
this._$Ei(), (this.l ??= []).push(t);
|
|
@@ -78,14 +78,14 @@ let S = class extends HTMLElement {
|
|
|
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 = nt) {
|
|
82
82
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
83
83
|
const i = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, i, e);
|
|
84
|
-
r !== void 0 &&
|
|
84
|
+
r !== void 0 && Nt(this.prototype, t, r);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
static getPropertyDescriptor(t, e, i) {
|
|
88
|
-
const { get: r, set: n } =
|
|
88
|
+
const { get: r, set: n } = zt(this.prototype, t) ?? { get() {
|
|
89
89
|
return this[e];
|
|
90
90
|
}, set(o) {
|
|
91
91
|
this[e] = o;
|
|
@@ -96,17 +96,17 @@ let S = class extends HTMLElement {
|
|
|
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) ?? nt;
|
|
100
100
|
}
|
|
101
101
|
static _$Ei() {
|
|
102
|
-
if (this.hasOwnProperty(
|
|
103
|
-
const t =
|
|
102
|
+
if (this.hasOwnProperty(M("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, i = [...
|
|
107
|
+
if (this.hasOwnProperty(M("finalized"))) return;
|
|
108
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
|
|
109
|
+
const e = this.properties, i = [...Ht(e), ...Rt(e)];
|
|
110
110
|
for (const r of i) this.createProperty(r, e[r]);
|
|
111
111
|
}
|
|
112
112
|
const t = this[Symbol.metadata];
|
|
@@ -125,8 +125,8 @@ let S = class extends HTMLElement {
|
|
|
125
125
|
const e = [];
|
|
126
126
|
if (Array.isArray(t)) {
|
|
127
127
|
const i = new Set(t.flat(1 / 0).reverse());
|
|
128
|
-
for (const r of i) e.unshift(
|
|
129
|
-
} else t !== void 0 && e.push(
|
|
128
|
+
for (const r of i) e.unshift(it(r));
|
|
129
|
+
} else t !== void 0 && e.push(it(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 Mt(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?.());
|
|
@@ -168,14 +168,14 @@ let S = class extends HTMLElement {
|
|
|
168
168
|
_$ET(t, e) {
|
|
169
169
|
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
|
|
170
170
|
if (r !== void 0 && i.reflect === !0) {
|
|
171
|
-
const n = (i.converter?.toAttribute !== void 0 ? i.converter :
|
|
171
|
+
const n = (i.converter?.toAttribute !== void 0 ? i.converter : k).toAttribute(e, i.type);
|
|
172
172
|
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
_$AK(t, e) {
|
|
176
176
|
const i = this.constructor, r = i._$Eh.get(t);
|
|
177
177
|
if (r !== void 0 && this._$Em !== r) {
|
|
178
|
-
const n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter :
|
|
178
|
+
const n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : k;
|
|
179
179
|
this._$Em = r;
|
|
180
180
|
const l = o.fromAttribute(e, n.type);
|
|
181
181
|
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
|
|
@@ -184,7 +184,7 @@ let S = class extends HTMLElement {
|
|
|
184
184
|
requestUpdate(t, e, i, r = !1, n) {
|
|
185
185
|
if (t !== void 0) {
|
|
186
186
|
const o = this.constructor;
|
|
187
|
-
if (r === !1 && (n = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ??
|
|
187
|
+
if (r === !1 && (n = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ?? X)(n, e) || i.useDefault && i.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, i)))) return;
|
|
188
188
|
this.C(t, e, i);
|
|
189
189
|
}
|
|
190
190
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -252,51 +252,51 @@ let S = class extends HTMLElement {
|
|
|
252
252
|
firstUpdated(t) {
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
|
-
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[
|
|
256
|
-
const
|
|
257
|
-
\f\r]`,
|
|
258
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
259
|
-
function
|
|
260
|
-
if (!
|
|
261
|
-
return
|
|
255
|
+
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[M("elementProperties")] = /* @__PURE__ */ new Map(), S[M("finalized")] = /* @__PURE__ */ new Map(), kt?.({ ReactiveElement: S }), (W.reactiveElementVersions ??= []).push("2.1.2");
|
|
256
|
+
const F = globalThis, ot = (s) => s, B = F.trustedTypes, at = B ? B.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, mt = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, ft = "?" + v, Bt = `<${ft}>`, b = document, N = () => b.createComment(""), z = (s) => s === null || typeof s != "object" && typeof s != "function", Q = Array.isArray, Wt = (s) => Q(s) || typeof s?.[Symbol.iterator] == "function", G = `[
|
|
257
|
+
\f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ht = /-->/g, lt = />/g, _ = RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^
|
|
258
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ct = /'/g, dt = /"/g, gt = /^(?:script|style|textarea|title)$/i, qt = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), Vt = qt(1), E = /* @__PURE__ */ Symbol.for("lit-noChange"), u = /* @__PURE__ */ Symbol.for("lit-nothing"), pt = /* @__PURE__ */ new WeakMap(), A = b.createTreeWalker(b, 129);
|
|
259
|
+
function $t(s, t) {
|
|
260
|
+
if (!Q(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
261
|
+
return at !== void 0 ? at.createHTML(t) : t;
|
|
262
262
|
}
|
|
263
|
-
const
|
|
263
|
+
const Zt = (s, t) => {
|
|
264
264
|
const e = s.length - 1, i = [];
|
|
265
|
-
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o =
|
|
265
|
+
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = L;
|
|
266
266
|
for (let l = 0; l < e; l++) {
|
|
267
267
|
const h = s[l];
|
|
268
|
-
let a,
|
|
269
|
-
for (; g < h.length && (o.lastIndex = g,
|
|
268
|
+
let a, d, c = -1, g = 0;
|
|
269
|
+
for (; g < h.length && (o.lastIndex = g, d = o.exec(h), d !== null); ) g = o.lastIndex, o === L ? d[1] === "!--" ? o = ht : d[1] !== void 0 ? o = lt : d[2] !== void 0 ? (gt.test(d[2]) && (r = RegExp("</" + d[2], "g")), o = _) : d[3] !== void 0 && (o = _) : o === _ ? d[0] === ">" ? (o = r ?? L, c = -1) : d[1] === void 0 ? c = -2 : (c = o.lastIndex - d[2].length, a = d[1], o = d[3] === void 0 ? _ : d[3] === '"' ? dt : ct) : o === dt || o === ct ? o = _ : o === ht || o === lt ? o = L : (o = _, r = void 0);
|
|
270
270
|
const m = o === _ && s[l + 1].startsWith("/>") ? " " : "";
|
|
271
|
-
n += o ===
|
|
271
|
+
n += o === L ? h + Bt : c >= 0 ? (i.push(a), h.slice(0, c) + mt + h.slice(c) + v + m) : h + v + (c === -2 ? l : m);
|
|
272
272
|
}
|
|
273
|
-
return [
|
|
273
|
+
return [$t(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
274
274
|
};
|
|
275
|
-
class
|
|
275
|
+
class H {
|
|
276
276
|
constructor({ strings: t, _$litType$: e }, i) {
|
|
277
277
|
let r;
|
|
278
278
|
this.parts = [];
|
|
279
279
|
let n = 0, o = 0;
|
|
280
|
-
const l = t.length - 1, h = this.parts, [a,
|
|
281
|
-
if (this.el =
|
|
280
|
+
const l = t.length - 1, h = this.parts, [a, d] = Zt(t, e);
|
|
281
|
+
if (this.el = H.createElement(a, i), A.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
285
|
for (; (r = A.nextNode()) !== null && h.length < l; ) {
|
|
286
286
|
if (r.nodeType === 1) {
|
|
287
|
-
if (r.hasAttributes()) for (const c of r.getAttributeNames()) if (c.endsWith(
|
|
288
|
-
const g =
|
|
289
|
-
h.push({ type: 1, index: n, name: f[2], strings: m, ctor: f[1] === "." ?
|
|
287
|
+
if (r.hasAttributes()) for (const c of r.getAttributeNames()) if (c.endsWith(mt)) {
|
|
288
|
+
const g = d[o++], m = r.getAttribute(c).split(v), f = /([.?@])?(.*)/.exec(g);
|
|
289
|
+
h.push({ type: 1, index: n, name: f[2], strings: m, ctor: f[1] === "." ? Jt : f[1] === "?" ? Kt : f[1] === "@" ? Yt : q }), r.removeAttribute(c);
|
|
290
290
|
} else c.startsWith(v) && (h.push({ type: 6, index: n }), r.removeAttribute(c));
|
|
291
|
-
if (
|
|
291
|
+
if (gt.test(r.tagName)) {
|
|
292
292
|
const c = r.textContent.split(v), g = c.length - 1;
|
|
293
293
|
if (g > 0) {
|
|
294
|
-
r.textContent =
|
|
295
|
-
for (let m = 0; m < g; m++) r.append(c[m],
|
|
296
|
-
r.append(c[g],
|
|
294
|
+
r.textContent = B ? B.emptyScript : "";
|
|
295
|
+
for (let m = 0; m < g; m++) r.append(c[m], N()), A.nextNode(), h.push({ type: 2, index: ++n });
|
|
296
|
+
r.append(c[g], N());
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
299
|
+
} else if (r.nodeType === 8) if (r.data === ft) h.push({ type: 2, index: n });
|
|
300
300
|
else {
|
|
301
301
|
let c = -1;
|
|
302
302
|
for (; (c = r.data.indexOf(v, c + 1)) !== -1; ) h.push({ type: 7, index: n }), c += v.length - 1;
|
|
@@ -312,10 +312,10 @@ class U {
|
|
|
312
312
|
function T(s, t, e = s, i) {
|
|
313
313
|
if (t === E) return t;
|
|
314
314
|
let r = i !== void 0 ? e._$Co?.[i] : e._$Cl;
|
|
315
|
-
const n =
|
|
315
|
+
const n = z(t) ? void 0 : t._$litDirective$;
|
|
316
316
|
return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = r : e._$Cl = r), r !== void 0 && (t = T(s, r._$AS(s, t.values), r, i)), t;
|
|
317
317
|
}
|
|
318
|
-
class
|
|
318
|
+
class Gt {
|
|
319
319
|
constructor(t, e) {
|
|
320
320
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
321
321
|
}
|
|
@@ -332,7 +332,7 @@ class Vt {
|
|
|
332
332
|
for (; h !== void 0; ) {
|
|
333
333
|
if (o === h.index) {
|
|
334
334
|
let a;
|
|
335
|
-
h.type === 2 ? a = new
|
|
335
|
+
h.type === 2 ? a = new R(n, n.nextSibling, this, t) : h.type === 1 ? a = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (a = new Xt(n, this, t)), this._$AV.push(a), h = i[++l];
|
|
336
336
|
}
|
|
337
337
|
o !== h?.index && (n = A.nextNode(), o++);
|
|
338
338
|
}
|
|
@@ -343,7 +343,7 @@ class Vt {
|
|
|
343
343
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
class
|
|
346
|
+
class R {
|
|
347
347
|
get _$AU() {
|
|
348
348
|
return this._$AM?._$AU ?? this._$Cv;
|
|
349
349
|
}
|
|
@@ -362,7 +362,7 @@ class N {
|
|
|
362
362
|
return this._$AB;
|
|
363
363
|
}
|
|
364
364
|
_$AI(t, e = this) {
|
|
365
|
-
t = T(this, t, e),
|
|
365
|
+
t = T(this, t, e), z(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Wt(t) ? this.k(t) : this._(t);
|
|
366
366
|
}
|
|
367
367
|
O(t) {
|
|
368
368
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -371,38 +371,38 @@ class N {
|
|
|
371
371
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
372
372
|
}
|
|
373
373
|
_(t) {
|
|
374
|
-
this._$AH !== u &&
|
|
374
|
+
this._$AH !== u && z(this._$AH) ? this._$AA.nextSibling.data = t : this.T(b.createTextNode(t)), this._$AH = t;
|
|
375
375
|
}
|
|
376
376
|
$(t) {
|
|
377
|
-
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el =
|
|
377
|
+
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = H.createElement($t(i.h, i.h[0]), this.options)), i);
|
|
378
378
|
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
379
379
|
else {
|
|
380
|
-
const n = new
|
|
380
|
+
const n = new Gt(r, this), o = n.u(this.options);
|
|
381
381
|
n.p(e), this.T(o), this._$AH = n;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
_$AC(t) {
|
|
385
385
|
let e = pt.get(t.strings);
|
|
386
|
-
return e === void 0 && pt.set(t.strings, e = new
|
|
386
|
+
return e === void 0 && pt.set(t.strings, e = new H(t)), e;
|
|
387
387
|
}
|
|
388
388
|
k(t) {
|
|
389
|
-
|
|
389
|
+
Q(this._$AH) || (this._$AH = [], this._$AR());
|
|
390
390
|
const e = this._$AH;
|
|
391
391
|
let i, r = 0;
|
|
392
|
-
for (const n of t) r === e.length ? e.push(i = new
|
|
392
|
+
for (const n of t) r === e.length ? e.push(i = new R(this.O(N()), this.O(N()), this, this.options)) : i = e[r], i._$AI(n), r++;
|
|
393
393
|
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
|
|
394
394
|
}
|
|
395
395
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
396
396
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
397
|
-
const i =
|
|
398
|
-
|
|
397
|
+
const i = ot(t).nextSibling;
|
|
398
|
+
ot(t).remove(), t = i;
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
setConnected(t) {
|
|
402
402
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
class
|
|
405
|
+
class q {
|
|
406
406
|
get tagName() {
|
|
407
407
|
return this.element.tagName;
|
|
408
408
|
}
|
|
@@ -415,11 +415,11 @@ class k {
|
|
|
415
415
|
_$AI(t, e = this, i, r) {
|
|
416
416
|
const n = this.strings;
|
|
417
417
|
let o = !1;
|
|
418
|
-
if (n === void 0) t = T(this, t, e, 0), o = !
|
|
418
|
+
if (n === void 0) t = T(this, t, e, 0), o = !z(t) || t !== this._$AH && t !== E, o && (this._$AH = t);
|
|
419
419
|
else {
|
|
420
420
|
const l = t;
|
|
421
421
|
let h, a;
|
|
422
|
-
for (t = n[0], h = 0; h < n.length - 1; h++) a = T(this, l[i + h], e, h), a === E && (a = this._$AH[h]), o ||= !
|
|
422
|
+
for (t = n[0], h = 0; h < n.length - 1; h++) a = T(this, l[i + h], e, h), a === E && (a = this._$AH[h]), o ||= !z(a) || a !== this._$AH[h], a === u ? t = u : t !== u && (t += (a ?? "") + n[h + 1]), this._$AH[h] = a;
|
|
423
423
|
}
|
|
424
424
|
o && !r && this.j(t);
|
|
425
425
|
}
|
|
@@ -427,7 +427,7 @@ class k {
|
|
|
427
427
|
t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
class
|
|
430
|
+
class Jt extends q {
|
|
431
431
|
constructor() {
|
|
432
432
|
super(...arguments), this.type = 3;
|
|
433
433
|
}
|
|
@@ -435,7 +435,7 @@ class Zt extends k {
|
|
|
435
435
|
this.element[this.name] = t === u ? void 0 : t;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
class
|
|
438
|
+
class Kt extends q {
|
|
439
439
|
constructor() {
|
|
440
440
|
super(...arguments), this.type = 4;
|
|
441
441
|
}
|
|
@@ -443,7 +443,7 @@ class Gt extends k {
|
|
|
443
443
|
this.element.toggleAttribute(this.name, !!t && t !== u);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
class
|
|
446
|
+
class Yt extends q {
|
|
447
447
|
constructor(t, e, i, r, n) {
|
|
448
448
|
super(t, e, i, r, n), this.type = 5;
|
|
449
449
|
}
|
|
@@ -456,7 +456,7 @@ class Jt extends k {
|
|
|
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 Xt {
|
|
460
460
|
constructor(t, e, i) {
|
|
461
461
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
462
462
|
}
|
|
@@ -467,19 +467,19 @@ class Kt {
|
|
|
467
467
|
T(this, t);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
const
|
|
470
|
+
const Ft = F.litHtmlPolyfillSupport;
|
|
471
|
+
Ft?.(H, R), (F.litHtmlVersions ??= []).push("3.3.2");
|
|
472
|
+
const Qt = (s, t, e) => {
|
|
473
473
|
const i = e?.renderBefore ?? t;
|
|
474
474
|
let r = i._$litPart$;
|
|
475
475
|
if (r === void 0) {
|
|
476
476
|
const n = e?.renderBefore ?? null;
|
|
477
|
-
i._$litPart$ = r = new
|
|
477
|
+
i._$litPart$ = r = new R(t.insertBefore(N(), n), n, void 0, e ?? {});
|
|
478
478
|
}
|
|
479
479
|
return r._$AI(s), r;
|
|
480
480
|
};
|
|
481
|
-
const
|
|
482
|
-
class
|
|
481
|
+
const tt = globalThis;
|
|
482
|
+
class U extends S {
|
|
483
483
|
constructor() {
|
|
484
484
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
485
485
|
}
|
|
@@ -489,7 +489,7 @@ class P 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 = Qt(e, this.renderRoot, this.renderOptions);
|
|
493
493
|
}
|
|
494
494
|
connectedCallback() {
|
|
495
495
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -501,16 +501,16 @@ class P extends S {
|
|
|
501
501
|
return E;
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
(
|
|
508
|
-
const
|
|
504
|
+
U._$litElement$ = !0, U.finalized = !0, tt.litElementHydrateSupport?.({ LitElement: U });
|
|
505
|
+
const te = tt.litElementPolyfillSupport;
|
|
506
|
+
te?.({ LitElement: U });
|
|
507
|
+
(tt.litElementVersions ??= []).push("4.2.2");
|
|
508
|
+
const ee = (s) => (t, e) => {
|
|
509
509
|
e !== void 0 ? e.addInitializer(() => {
|
|
510
510
|
customElements.define(s, t);
|
|
511
511
|
}) : customElements.define(s, t);
|
|
512
512
|
};
|
|
513
|
-
const
|
|
513
|
+
const se = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: X }, ie = (s = se, t, e) => {
|
|
514
514
|
const { kind: i, metadata: r } = e;
|
|
515
515
|
let n = globalThis.litPropertyMetadata.get(r);
|
|
516
516
|
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), n.set(e.name, s), i === "accessor") {
|
|
@@ -531,32 +531,30 @@ const te = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged:
|
|
|
531
531
|
}
|
|
532
532
|
throw Error("Unsupported decorator location: " + i);
|
|
533
533
|
};
|
|
534
|
-
function
|
|
535
|
-
return (t, e) => typeof e == "object" ?
|
|
534
|
+
function V(s) {
|
|
535
|
+
return (t, e) => typeof e == "object" ? ie(s, t, e) : ((i, r, n) => {
|
|
536
536
|
const o = r.hasOwnProperty(n);
|
|
537
537
|
return r.constructor.createProperty(n, i), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
|
|
538
538
|
})(s, t, e);
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
return
|
|
540
|
+
function Z(s) {
|
|
541
|
+
return V({ ...s, state: !0, attribute: !1 });
|
|
542
542
|
}
|
|
543
|
-
const
|
|
544
|
-
function
|
|
543
|
+
const re = (s, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(s, t, e), e);
|
|
544
|
+
function ne(s, t) {
|
|
545
545
|
return (e, i, r) => {
|
|
546
546
|
const n = (o) => o.renderRoot?.querySelector(s) ?? null;
|
|
547
|
-
return
|
|
547
|
+
return re(e, i, { get() {
|
|
548
548
|
return n(this);
|
|
549
549
|
} });
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
-
var
|
|
553
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
552
|
+
var oe = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, x = (s, t, e, i) => {
|
|
553
|
+
for (var r = i > 1 ? void 0 : i ? ae(t, e) : t, n = s.length - 1, o; n >= 0; n--)
|
|
554
554
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
|
555
|
-
return i && r &&
|
|
555
|
+
return i && r && oe(t, e, r), r;
|
|
556
556
|
};
|
|
557
|
-
|
|
558
|
-
yt,
|
|
559
|
-
$t,
|
|
557
|
+
J.use([
|
|
560
558
|
xt,
|
|
561
559
|
vt,
|
|
562
560
|
_t,
|
|
@@ -564,13 +562,15 @@ G.use([
|
|
|
564
562
|
bt,
|
|
565
563
|
wt,
|
|
566
564
|
Ct,
|
|
567
|
-
Tt,
|
|
568
565
|
St,
|
|
569
|
-
Et
|
|
566
|
+
Et,
|
|
567
|
+
Ot,
|
|
568
|
+
Tt,
|
|
569
|
+
Dt
|
|
570
570
|
]);
|
|
571
|
-
let y = class extends
|
|
571
|
+
let y = class extends U {
|
|
572
572
|
constructor() {
|
|
573
|
-
super(), this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 0, this.origHeight = 0, this.modifier = 1, this.version = "1.6.
|
|
573
|
+
super(), this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 0, this.origHeight = 0, this.modifier = 1, this.version = "1.6.32", this.updateThresholdMs = 300, this.maxIntervalSamples = 3, this.template = {
|
|
574
574
|
title: {
|
|
575
575
|
text: "Temperature Change in the Coming Week",
|
|
576
576
|
left: "center",
|
|
@@ -685,7 +685,7 @@ let y = class extends P {
|
|
|
685
685
|
const i = ["parallel", "geo", "timeline", "visualMap", "markPoint"], r = Object.fromEntries(
|
|
686
686
|
Object.entries(s.theme_object).filter(([n]) => !i.includes(n))
|
|
687
687
|
);
|
|
688
|
-
|
|
688
|
+
J.registerTheme(s.theme_name, r);
|
|
689
689
|
}
|
|
690
690
|
transformData() {
|
|
691
691
|
if (!this?.inputData?.dataseries?.length) return;
|
|
@@ -693,40 +693,45 @@ let y = class extends P {
|
|
|
693
693
|
t.series = [], t.doomed = !0;
|
|
694
694
|
}), this.inputData.dataseries.sort((t, e) => (t.advanced?.drawOrder ?? 0) - (e.advanced?.drawOrder ?? 0)), this.inputData.dataseries.forEach((t) => {
|
|
695
695
|
t.advanced ??= {}, t.advanced.chartName ??= "", t.data ??= [];
|
|
696
|
-
const e = [...new Set(t.data.map((n) => n.pivot ?? ""))].sort(), i =
|
|
696
|
+
const e = [...new Set(t.data.map((n) => n.pivot ?? ""))].sort(), i = et(t.backgroundColor).monochromatic(e.length).map((n) => n.toHexString()), r = et(t.borderColor).monochromatic(e.length).map((n) => n.toHexString());
|
|
697
697
|
e.forEach((n, o) => {
|
|
698
|
-
const l = n ?? "", h = t.label ?? "", a = l + (l && h ? " - " : "") + h,
|
|
699
|
-
let m = this.inputData?.axis?.timeseries ? g?.map((
|
|
698
|
+
const l = n ?? "", h = t.label ?? "", a = l + (l && h ? " - " : "") + h, d = t.borderColor ? t.advanced?.chartName?.includes("#split#") ? t.borderColor : r[o] : void 0, c = t.backgroundColor ? t.advanced?.chartName?.includes("#split#") ? t.backgroundColor : i[o] : void 0, g = e.length === 1 ? t.data : t.data?.filter((p) => p.pivot === n);
|
|
699
|
+
let m = this.inputData?.axis?.timeseries ? g?.map((p) => ({ name: p.x, value: [new Date(p.x ?? "").getTime(), p.y, p.r] })) ?? [] : g?.map((p) => ({ name: p.x, value: [p.x, p.y, p.r] })) ?? [], f = 0, w = 0;
|
|
700
700
|
if (this.xAxisType() === "time" && m) {
|
|
701
|
-
const
|
|
702
|
-
f = Math.min(...
|
|
701
|
+
const p = m.map((yt) => yt.value[0]);
|
|
702
|
+
f = Math.min(...p), w = Math.max(...p);
|
|
703
703
|
}
|
|
704
|
-
const
|
|
704
|
+
const D = {
|
|
705
705
|
id: a,
|
|
706
706
|
name: a,
|
|
707
707
|
minDate: f,
|
|
708
708
|
maxDate: w,
|
|
709
709
|
type: t.type ?? "line",
|
|
710
710
|
lineStyle: {
|
|
711
|
-
color:
|
|
711
|
+
color: d,
|
|
712
712
|
width: t.styling?.borderWidth ?? 2,
|
|
713
713
|
type: t.styling?.borderDash ?? "solid"
|
|
714
714
|
},
|
|
715
715
|
smooth: !1,
|
|
716
716
|
itemStyle: {
|
|
717
717
|
color: c,
|
|
718
|
-
borderColor:
|
|
718
|
+
borderColor: d,
|
|
719
719
|
borderWidth: t.styling?.borderWidth ?? 2
|
|
720
720
|
},
|
|
721
721
|
areaStyle: t.styling?.fill ? { color: c } : void 0,
|
|
722
722
|
symbol: t.styling?.pointStyle ?? "circle",
|
|
723
|
-
symbolSize: (
|
|
723
|
+
symbolSize: (p) => p[2] ?? 0,
|
|
724
724
|
showSymbol: t.styling?.pointStyle !== "none",
|
|
725
725
|
data: m ?? [],
|
|
726
726
|
drawOrder: t.advanced?.drawOrder ?? 0
|
|
727
727
|
};
|
|
728
728
|
let C = t.advanced?.chartName ?? "";
|
|
729
|
-
C = C.replace("#split#", l)
|
|
729
|
+
C = C.replace("#split#", l);
|
|
730
|
+
const O = this.setupChart(C), j = O?.series.map((p) => p.id) ?? [];
|
|
731
|
+
let $ = a, P = 2;
|
|
732
|
+
for (; j.includes($); )
|
|
733
|
+
$ = `${a}_${P++}`;
|
|
734
|
+
D.id = $, O?.series.push(D);
|
|
730
735
|
});
|
|
731
736
|
});
|
|
732
737
|
const s = [];
|
|
@@ -759,8 +764,8 @@ let y = class extends P {
|
|
|
759
764
|
for (const l of s.series) {
|
|
760
765
|
const h = l.data;
|
|
761
766
|
for (const a of h || []) {
|
|
762
|
-
const
|
|
763
|
-
|
|
767
|
+
const d = a.value?.[0] || 0;
|
|
768
|
+
d > r && (r = d);
|
|
764
769
|
}
|
|
765
770
|
}
|
|
766
771
|
else
|
|
@@ -798,16 +803,16 @@ let y = class extends P {
|
|
|
798
803
|
s.lastConfig = l;
|
|
799
804
|
const a = h ? window.structuredClone(this.template) : s.echart?.getOption() ?? window.structuredClone(this.template);
|
|
800
805
|
if (a.title.text = t, a.title.show = i, a.xAxis.name = this.inputData?.axis?.xAxisLabel ?? "", a.xAxis.type = this.xAxisType(), a.xAxis.show = r, this.xAxisType() === "time") {
|
|
801
|
-
const f = s.series.map(($) => $.minDate ?? 1 / 0).reduce(($,
|
|
806
|
+
const f = s.series.map(($) => $.minDate ?? 1 / 0).reduce(($, P) => Math.min($, P), 1 / 0), w = s.series.map(($) => $.maxDate ?? 0).reduce(($, P) => Math.max($, P), 0), D = Number(this.timeRange?.start), C = Number(this.timeRange?.end), O = isNaN(D) ? f : D, j = isNaN(C) ? w : C;
|
|
802
807
|
a.xAxis = {
|
|
803
808
|
...a.xAxis,
|
|
804
|
-
min:
|
|
805
|
-
max:
|
|
809
|
+
min: O !== 1 / 0 ? O : (/* @__PURE__ */ new Date()).getTime() - 1440 * 60 * 1e3,
|
|
810
|
+
max: j !== 0 ? j : (/* @__PURE__ */ new Date()).getTime()
|
|
806
811
|
};
|
|
807
812
|
}
|
|
808
813
|
a.dataZoom[0].show = this.inputData?.axis?.xAxisZoom ?? !1, a.toolbox.show = this.inputData?.axis?.xAxisZoom ?? !1;
|
|
809
|
-
const
|
|
810
|
-
a.yAxis.type = this.yAxisType(), a.yAxis.name =
|
|
814
|
+
const d = this.inputData?.axis?.yAxisLabel ?? "", c = n && !!d;
|
|
815
|
+
a.yAxis.type = this.yAxisType(), a.yAxis.name = d, a.yAxis.scale = this.inputData?.axis?.yAxisScaling ?? !1, a.yAxis.show = n, a.yAxis.nameLocation = "end", a.yAxis.nameGap = 10, a.yAxis.nameTextStyle = { align: "left" }, a.yAxis.axisLine = { show: !0 }, ["value", "log"].includes(a.yAxis.type) && (a.yAxis.axisLabel = {
|
|
811
816
|
"font-size": 14,
|
|
812
817
|
formatter: (f) => Math.round(f * 100) / 100
|
|
813
818
|
}), a.series = s.series, a.legend.show = e;
|
|
@@ -843,7 +848,7 @@ let y = class extends P {
|
|
|
843
848
|
const e = document.createElement("div");
|
|
844
849
|
e.setAttribute("name", s), e.setAttribute("class", "sizer"), this.chartContainer.appendChild(e);
|
|
845
850
|
const r = {
|
|
846
|
-
echart:
|
|
851
|
+
echart: J.init(e, this.theme?.theme_name),
|
|
847
852
|
series: [],
|
|
848
853
|
element: e,
|
|
849
854
|
drawing: !1,
|
|
@@ -857,7 +862,7 @@ let y = class extends P {
|
|
|
857
862
|
this.resizeObserver && this.chartContainer && (this.resizeObserver.unobserve(this.chartContainer), this.resizeObserver.disconnect()), super.disconnectedCallback();
|
|
858
863
|
}
|
|
859
864
|
render() {
|
|
860
|
-
return
|
|
865
|
+
return Vt`
|
|
861
866
|
<div
|
|
862
867
|
class="wrapper"
|
|
863
868
|
style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
|
|
@@ -880,7 +885,7 @@ let y = class extends P {
|
|
|
880
885
|
`;
|
|
881
886
|
}
|
|
882
887
|
};
|
|
883
|
-
y.styles =
|
|
888
|
+
y.styles = Lt`
|
|
884
889
|
:host {
|
|
885
890
|
display: block;
|
|
886
891
|
font-family: sans-serif;
|
|
@@ -958,31 +963,31 @@ y.styles = Ot`
|
|
|
958
963
|
}
|
|
959
964
|
`;
|
|
960
965
|
x([
|
|
961
|
-
|
|
966
|
+
V({ type: Object })
|
|
962
967
|
], y.prototype, "inputData", 2);
|
|
963
968
|
x([
|
|
964
|
-
|
|
969
|
+
V({ type: Object })
|
|
965
970
|
], y.prototype, "theme", 2);
|
|
966
971
|
x([
|
|
967
|
-
|
|
972
|
+
V({ type: Object })
|
|
968
973
|
], y.prototype, "timeRange", 2);
|
|
969
974
|
x([
|
|
970
|
-
|
|
975
|
+
Z()
|
|
971
976
|
], y.prototype, "canvasList", 2);
|
|
972
977
|
x([
|
|
973
|
-
|
|
978
|
+
Z()
|
|
974
979
|
], y.prototype, "themeBgColor", 2);
|
|
975
980
|
x([
|
|
976
|
-
|
|
981
|
+
Z()
|
|
977
982
|
], y.prototype, "themeTitleColor", 2);
|
|
978
983
|
x([
|
|
979
|
-
|
|
984
|
+
Z()
|
|
980
985
|
], y.prototype, "themeSubtitleColor", 2);
|
|
981
986
|
x([
|
|
982
|
-
|
|
987
|
+
ne(".chart-container")
|
|
983
988
|
], y.prototype, "chartContainer", 2);
|
|
984
989
|
y = x([
|
|
985
|
-
|
|
990
|
+
ee("widget-linechart-1.6.32")
|
|
986
991
|
], y);
|
|
987
992
|
export {
|
|
988
993
|
y as WidgetLinechart
|