@astrato-io/visualizations 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/THIRD_PARTY_NOTICES.md +163 -14
- package/VISUALIZATION_DEFINITIONS.md +319 -32
- package/chunks/{Button-5CxPEACP.js → Button-CCF851ea.js} +4 -4
- package/chunks/{CircularProgress-DFS-LQb7.js → CircularProgress-yupH6YWs.js} +39 -39
- package/chunks/FieldTypeIcon-D_MzsdfY.js +22 -0
- package/chunks/{LinearProgress-CjIQfkNA.js → LinearProgress-CyFjN4px.js} +9 -9
- package/chunks/{MenuOption-Cb7B7x6z.js → MenuOption-CQpT79AP.js} +143 -142
- package/chunks/{Title-CtFw1bVg.js → Title-C-p4ZarD.js} +22 -22
- package/chunks/_createAggregator-BF4qG9XK.js +50 -0
- package/chunks/{app-filter-bar.compiler-B9775gLJ.js → app-filter-bar.compiler-8fxCo2q7.js} +10 -10
- package/chunks/bar-layout-DStC-GNV.js +9 -0
- package/chunks/{bar.compiler-B7wlH_Ro.js → bar.compiler-CQAu8KL8.js} +102 -84
- package/chunks/{builder-Dxo7D7c6.js → builder-CScg1TOS.js} +71 -38
- package/chunks/color-rules-DYJL4fIW.js +15 -0
- package/chunks/color-settings-DJFoFTip.js +5 -0
- package/chunks/{coloring-B-Wa8D5P.js → coloring-9jU3s_-p.js} +41 -41
- package/chunks/createSimplePaletteValueFilter-C4hZpCdn.js +2005 -0
- package/chunks/defaults-cyNhn37t.js +3 -0
- package/chunks/{definitions-DNpzD9tY.js → definitions-C4grxhye.js} +613 -401
- package/chunks/{escobar-C4Nm3eJ7.js → escobar-CjirINHP.js} +5326 -5079
- package/chunks/{extend-preset-BVKFtoe-.js → extend-preset-D-l9u_we.js} +974 -909
- package/chunks/{filter.compiler-BlS3zoy_.js → filter.compiler-lji2Acgn.js} +10 -10
- package/chunks/{filtering-CGuLpg7u.js → filtering-C1zakrrX.js} +385 -429
- package/chunks/handlers-ZviIUC-j.js +15387 -0
- package/chunks/{icon-picker-styles-DYQgVEKG.js → icon-picker-styles-Bj80ZUBK.js} +11 -11
- package/chunks/isEqual-Ch9OEye3.js +16 -0
- package/chunks/{isFocusVisible-B1_z03UT.js → isFocusVisible-CgMP0qkR.js} +1 -1
- package/chunks/label-format-type-C46pzgx7.js +17 -0
- package/chunks/{line.compiler-Bo9i9qag.js → line.compiler-De5fiKuR.js} +9 -9
- package/chunks/{logger-3lng-wOw.js → logger-CKRjhSHQ.js} +71 -64
- package/chunks/map.compiler-CKzorLgK.js +345 -0
- package/chunks/{metadata-Fmx1swpK.js → metadata-Bb9pTXrq.js} +1 -1
- package/chunks/{number.compiler-CdLd5aGW.js → number.compiler-CaTmJkmi.js} +7 -7
- package/chunks/operations-DZoY50VX.js +31297 -0
- package/chunks/{range-CzO4isKK.js → range-D1BTmFMp.js} +2 -2
- package/chunks/{react-dom-BwZT0N3F.js → react-dom-Dgv2azN2.js} +70 -70
- package/chunks/{render-wrappers-CAuvgMxi.js → render-wrappers-_P3xwu5A.js} +1 -1
- package/chunks/{requirements-CYpVh65U.js → requirements-NHNrR8Ie.js} +59 -57
- package/chunks/shared-UitWpq1J.js +1331 -0
- package/chunks/{standalone-CoQxJ6ov.js → standalone-B0U6c3su.js} +804 -804
- package/chunks/{standalone-C6XDHYAM.js → standalone-BBu90BhK.js} +109 -109
- package/chunks/standalone-BEekPuA12.js +357 -0
- package/chunks/{standalone-CPUiiWNP.js → standalone-BOzHA_d4.js} +41 -41
- package/chunks/standalone-BR2JuRIC.js +422 -0
- package/chunks/{standalone-DuwTOBXH.js → standalone-BapqaniK.js} +592 -592
- package/chunks/{standalone-DWPfdP0A.js → standalone-Bnnr87pc.js} +523 -523
- package/chunks/standalone-BwJqDj2Z.js +396 -0
- package/chunks/{standalone-LFVgLhia.js → standalone-ByKKqT5L.js} +266 -258
- package/chunks/{standalone-BDrQMxLi.js → standalone-CRdDZYeM.js} +1788 -1004
- package/chunks/standalone-CRfDOO1x.js +287 -0
- package/chunks/{standalone-BvWdpUL3.js → standalone-CVknVdUC.js} +21 -18
- package/chunks/standalone-CbPk8bKn.js +580 -0
- package/chunks/{standalone-r4ObFvys.js → standalone-Ck63MZzj.js} +218 -216
- package/chunks/{standalone-Cu73fzSr.js → standalone-DCFY1MAV.js} +6040 -5820
- package/chunks/{standalone-CiaaibTa.js → standalone-DZDGX3aa.js} +174 -174
- package/chunks/standalone-DhfgeJIk.js +1012 -0
- package/chunks/standalone-DibjA73M.js +6 -0
- package/chunks/{standalone-CXniic5x.js → standalone-DtBk_iUz.js} +6 -5
- package/chunks/standalone-DxBAyqAu.js +772 -0
- package/chunks/standalone-KMQPsNsq.js +2 -0
- package/chunks/standalone-MBLSvsrY.js +2 -0
- package/chunks/standalone-U0WJwFlG.js +354 -0
- package/chunks/{standalone-CNkHsynO.js → standalone-swGs70tD.js} +54 -56
- package/chunks/standalone-wgFAVnnm.js +355 -0
- package/chunks/standalone-xGV0dqPV.js +689 -0
- package/chunks/{table.compiler-C1qjqXaT.js → table.compiler-OWSx5MOq.js} +4 -4
- package/chunks/{useFieldName-mWrD_uk_.js → useFieldName-B8iCYyw1.js} +1 -1
- package/chunks/{utils-DYYD4Zzf.js → utils-3Igg6xmO.js} +4740 -4737
- package/chunks/{view-7fH6mGmY.js → view-DdMLZySj.js} +1988 -1632
- package/chunks/{visualization-filters-mVnsnvLP.js → visualization-filters-CzvFHE6M.js} +3158 -2417
- package/chunks/{with-html-element-B0Clt4jY.js → with-html-element-DOfkR3C1.js} +3353 -3160
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +303 -2
- package/docs/operations/combo.md +262 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +148 -1
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +1 -1
- package/docs/operations/heatMap.md +1 -1
- package/docs/operations/histogram.md +262 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +7 -7
- package/docs/operations/line.md +262 -1
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +1 -1
- package/docs/operations/radar.md +1 -1
- package/docs/operations/sankey.md +1 -1
- package/docs/operations/scatter.md +148 -1
- package/docs/operations/shape.md +1 -1
- package/docs/operations/simpleTextObject.md +1 -1
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +374 -157
- package/docs/operations/tree.md +1 -1
- package/docs/operations/treemap.md +1 -1
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +1 -1
- package/getters.js +2 -2
- package/index.js +507 -459
- package/metadata.js +2 -2
- package/operations.js +5 -5
- package/package.json +72 -67
- package/src/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/available-fields.d.ts +2 -2
- package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
- package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +188 -2
- package/src/definitions/model/definitions/index.d.ts +2 -1
- package/src/definitions/model/definitions/schema-registry.d.ts +305 -0
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +2 -0
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +4 -3
- package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
- package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
- package/src/definitions/model/definitions/types/compilation.types.d.ts +7 -2
- package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
- package/src/definitions/model/definitions/types/index.d.ts +1 -1
- package/src/index.d.ts +1 -1
- package/src/operations/index.d.ts +1 -1
- package/src/types.d.ts +45 -41
- package/chunks/FieldTypeIcon-pSVQFemC.js +0 -22
- package/chunks/ToggleButton-Br9HCPCv.js +0 -150
- package/chunks/color-rules-CN7TcGrC.js +0 -6
- package/chunks/color-settings-3VRlf_Vw.js +0 -6
- package/chunks/handlers-CMbyj5y1.js +0 -12930
- package/chunks/isEqual-DBg_b35N.js +0 -12
- package/chunks/label-format-type-weq1XfcX.js +0 -8
- package/chunks/operations-HSqnCRvv.js +0 -26324
- package/chunks/shared-DFoJxjVN.js +0 -1218
- package/chunks/standalone-530a5lvf.js +0 -1003
- package/chunks/standalone-5DnapeHH.js +0 -420
- package/chunks/standalone-B4jrf4KE.js +0 -354
- package/chunks/standalone-B6s_xG2u.js +0 -354
- package/chunks/standalone-BMoJXGYe.js +0 -2
- package/chunks/standalone-BfvGggeM2.js +0 -355
- package/chunks/standalone-CMJJIi9v.js +0 -2
- package/chunks/standalone-C_Jd4gkj.js +0 -6
- package/chunks/standalone-DBeXQrwH.js +0 -468
- package/chunks/standalone-DMCwtebn.js +0 -396
- package/chunks/standalone-DpSRmAWx.js +0 -287
- package/chunks/standalone-kzAhwH19.js +0 -689
- package/chunks/standalone-mb7LwEiq.js +0 -3874
- /package/chunks/{src-BOS6SqkZ2.js → src-BOS6SqkZ.js} +0 -0
package/index.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { o as e } from "./chunks/rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import
|
|
5
|
-
import { a as
|
|
6
|
-
import { l as
|
|
7
|
-
import {
|
|
8
|
-
|
|
2
|
+
import { Cs as t, Qc as n, Qn as r, al as i, el as a, gc as o, nl as s, oa as c } from "./chunks/visualization-filters-CzvFHE6M.js";
|
|
3
|
+
import { n as l } from "./chunks/lookup-BWllin0q.js";
|
|
4
|
+
import "./chunks/defaults-cyNhn37t.js";
|
|
5
|
+
import { a as u, i as d, n as f, o as p, r as m, t as h } from "./chunks/requirements-NHNrR8Ie.js";
|
|
6
|
+
import { l as g, t as _, u as v } from "./chunks/logger-CKRjhSHQ.js";
|
|
7
|
+
import { i as y, n as b, t as ee } from "./chunks/extend-preset-D-l9u_we.js";
|
|
8
|
+
import { BehaviorSubject as x, Observable as S, Subject as C, filter as w, of as te } from "rxjs";
|
|
9
|
+
var T = (e, t, n) => {
|
|
9
10
|
let r = e.createElement(t);
|
|
10
11
|
return r.textContent = n, r;
|
|
11
|
-
},
|
|
12
|
-
let i = e.ownerDocument, a = i.createElement("div"), o =
|
|
12
|
+
}, E = (e, t, n, r) => {
|
|
13
|
+
let i = e.ownerDocument, a = i.createElement("div"), o = T(i, "strong", n), s = T(i, "p", r);
|
|
13
14
|
a.dataset.astratoStandaloneState = t, a.style.boxSizing = "border-box", a.style.display = "flex", a.style.flexDirection = "column", a.style.justifyContent = "center", a.style.minHeight = "100%", a.style.padding = "12px", a.style.border = "1px solid #d6d9df", a.style.color = "#2f3440", a.style.background = "#f7f8fa", o.style.fontSize = "13px", o.style.lineHeight = "18px", s.style.margin = "4px 0 0", s.style.fontSize = "12px", s.style.lineHeight = "16px", a.append(o, s), e.replaceChildren(a);
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
},
|
|
15
|
+
}, D = (e, t) => {
|
|
16
|
+
E(e, "error", "Visualization failed to render", t);
|
|
17
|
+
}, O = (e) => e.hostServices ?? e.services, k = (e) => typeof e == "object" && !!e && !Array.isArray(e), A = (e) => k(e), j = (e) => {
|
|
17
18
|
let t = { ...e.dataBinding ?? {} }, n = t.queryContext;
|
|
18
19
|
return delete t.fieldMetadata, delete t.queryContext, {
|
|
19
20
|
...t,
|
|
@@ -21,7 +22,7 @@ var S = (e, t, n) => {
|
|
|
21
22
|
instanceId: e.id,
|
|
22
23
|
type: e.type
|
|
23
24
|
};
|
|
24
|
-
},
|
|
25
|
+
}, M = async (e, t, n, r, i) => {
|
|
25
26
|
if (t !== void 0 || !n) return t;
|
|
26
27
|
try {
|
|
27
28
|
return await n();
|
|
@@ -34,13 +35,13 @@ var S = (e, t, n) => {
|
|
|
34
35
|
});
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
|
-
},
|
|
38
|
-
let r =
|
|
38
|
+
}, N = (e) => e.fields !== void 0 || e.validFields !== void 0 || e.viewsFields !== void 0 || e.dimensions !== void 0 || e.measures !== void 0 || e.groupedDimensions !== void 0, P = async ({ client: e, instance: t, logger: n }) => {
|
|
39
|
+
let r = O(e), i = r?.engine?.fields, a = r?.data;
|
|
39
40
|
if (!i && !a?.getSemanticLayerMetadata && !t.dataBinding?.fieldMetadata) return t;
|
|
40
|
-
let o =
|
|
41
|
+
let o = j(t), s = t.dataBinding?.fieldMetadata ?? {};
|
|
41
42
|
if (i?.getFieldMetadata) try {
|
|
42
43
|
let e = await i.getFieldMetadata(o);
|
|
43
|
-
|
|
44
|
+
A(e) && (s = {
|
|
44
45
|
...e,
|
|
45
46
|
...s
|
|
46
47
|
});
|
|
@@ -52,9 +53,9 @@ var S = (e, t, n) => {
|
|
|
52
53
|
type: t.type
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
if (t.dataBinding?.semanticLayerId && a?.getSemanticLayerMetadata && !
|
|
56
|
+
if (t.dataBinding?.semanticLayerId && a?.getSemanticLayerMetadata && !N(s)) try {
|
|
56
57
|
let e = await a.getSemanticLayerMetadata(t.dataBinding.semanticLayerId);
|
|
57
|
-
|
|
58
|
+
A(e) && (s = {
|
|
58
59
|
...e,
|
|
59
60
|
...s
|
|
60
61
|
});
|
|
@@ -67,12 +68,12 @@ var S = (e, t, n) => {
|
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
70
|
let [c, l, u, d, f, p] = await Promise.all([
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
M("fields", s.fields, () => i?.getFields?.(o), n, t),
|
|
72
|
+
M("validFields", s.validFields, () => i?.getValidFields?.(o), n, t),
|
|
73
|
+
M("viewsFields", s.viewsFields, () => i?.getViewsFields?.(o), n, t),
|
|
74
|
+
M("dimensions", s.dimensions, () => i?.getDimensionsList?.(o), n, t),
|
|
75
|
+
M("measures", s.measures, () => i?.getMeasuresList?.(o), n, t),
|
|
76
|
+
M("groupedDimensions", s.groupedDimensions, () => i?.getGroupedDimensions?.(o), n, t)
|
|
76
77
|
]), m = {
|
|
77
78
|
fields: c,
|
|
78
79
|
validFields: l,
|
|
@@ -81,14 +82,14 @@ var S = (e, t, n) => {
|
|
|
81
82
|
measures: f,
|
|
82
83
|
groupedDimensions: p
|
|
83
84
|
};
|
|
84
|
-
return
|
|
85
|
+
return N(m) ? {
|
|
85
86
|
...t,
|
|
86
87
|
dataBinding: {
|
|
87
88
|
...t.dataBinding,
|
|
88
89
|
fieldMetadata: m
|
|
89
90
|
}
|
|
90
91
|
} : t;
|
|
91
|
-
},
|
|
92
|
+
}, F = "system-ui, sans-serif", ne = ["--astrato-font-family", "--font-family"], re = 3e3, I = 250, ie = "Aa0 ", L = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new Set([
|
|
92
93
|
"serif",
|
|
93
94
|
"sans-serif",
|
|
94
95
|
"monospace",
|
|
@@ -102,35 +103,35 @@ var S = (e, t, n) => {
|
|
|
102
103
|
"emoji",
|
|
103
104
|
"math",
|
|
104
105
|
"fangsong"
|
|
105
|
-
]),
|
|
106
|
+
]), oe = (e) => {
|
|
106
107
|
let t = e.trim().replace(/[,;\s]+$/, "");
|
|
107
|
-
return t ? /(^|,)\s*(sans-serif|system-ui)\s*(,|$)/i.test(t) ? t : `${t}, ${
|
|
108
|
-
},
|
|
108
|
+
return t ? /(^|,)\s*(sans-serif|system-ui)\s*(,|$)/i.test(t) ? t : `${t}, ${F}` : F;
|
|
109
|
+
}, se = (e) => {
|
|
109
110
|
let t = e ?? (typeof document > "u" ? void 0 : document), n = t?.defaultView;
|
|
110
111
|
if (!t || !n) return;
|
|
111
112
|
let r = n.getComputedStyle(t.documentElement);
|
|
112
|
-
for (let e of
|
|
113
|
+
for (let e of ne) {
|
|
113
114
|
let t = r.getPropertyValue(e).trim();
|
|
114
115
|
if (t) return t;
|
|
115
116
|
}
|
|
116
117
|
return (t.body ? n.getComputedStyle(t.body).fontFamily.trim() : "") || void 0;
|
|
117
|
-
},
|
|
118
|
+
}, ce = (e, t) => oe(e?.trim() || se(t) || "system-ui, sans-serif"), R = (e) => e.trim().replace(/^["']|["']$/g, "").toLowerCase(), le = (e) => (e ?? (typeof document > "u" ? void 0 : document))?.fonts, ue = (e) => (e.match(/"[^"]*"|'[^']*'|[^,]+/g) ?? []).map((e) => e.trim()).filter((e) => e && !ae.has(R(e))), de = (e, t) => {
|
|
118
119
|
let n = /* @__PURE__ */ new Set();
|
|
119
|
-
return t.forEach((e) => n.add(
|
|
120
|
-
},
|
|
121
|
-
let n =
|
|
120
|
+
return t.forEach((e) => n.add(R(e.family))), ue(e).find((e) => n.has(R(e)));
|
|
121
|
+
}, z = async (e, t) => {
|
|
122
|
+
let n = le(t), r = n?.load ? de(e, n) : void 0;
|
|
122
123
|
if (!n || !r) return;
|
|
123
|
-
let i =
|
|
124
|
-
i || (i = /* @__PURE__ */ new Map(),
|
|
125
|
-
let a =
|
|
124
|
+
let i = L.get(n);
|
|
125
|
+
i || (i = /* @__PURE__ */ new Map(), L.set(n, i));
|
|
126
|
+
let a = R(r), o = i.get(a);
|
|
126
127
|
if (!o) {
|
|
127
128
|
let e = i;
|
|
128
129
|
o = (async () => {
|
|
129
130
|
let t;
|
|
130
131
|
try {
|
|
131
|
-
let i = Promise.resolve().then(() => n.load(`12px ${r}`,
|
|
132
|
+
let i = Promise.resolve().then(() => n.load(`12px ${r}`, ie));
|
|
132
133
|
i.then(() => e.delete(a), () => e.delete(a)), await Promise.race([i, new Promise((e) => {
|
|
133
|
-
t = setTimeout(e,
|
|
134
|
+
t = setTimeout(e, re);
|
|
134
135
|
})]);
|
|
135
136
|
} catch {
|
|
136
137
|
e.delete(a);
|
|
@@ -140,50 +141,50 @@ var S = (e, t, n) => {
|
|
|
140
141
|
})(), i.set(a, o);
|
|
141
142
|
}
|
|
142
143
|
await o;
|
|
143
|
-
},
|
|
144
|
-
let r =
|
|
144
|
+
}, fe = (e, t, n) => {
|
|
145
|
+
let r = le(n), i = new Set(ue(e).map(R));
|
|
145
146
|
if (!r?.addEventListener || !i.size) return () => void 0;
|
|
146
147
|
let a = !0, o = t, s, c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), u = (e) => {
|
|
147
|
-
let t = e.filter((e) => i.has(
|
|
148
|
+
let t = e.filter((e) => i.has(R(e.family)) && !l.has(e));
|
|
148
149
|
a && t.length && (t.forEach((e) => l.add(e)), o?.());
|
|
149
150
|
}, d = (e = !1) => {
|
|
150
151
|
r.forEach((t) => {
|
|
151
|
-
!i.has(
|
|
152
|
+
!i.has(R(t.family)) || c.has(t) || (c.add(t), t.status === "loaded" ? e ? l.add(t) : u([t]) : t.loaded?.then(() => u([t]), () => void 0));
|
|
152
153
|
});
|
|
153
154
|
}, f = () => {
|
|
154
|
-
clearTimeout(s), d(), a && r.status === "loading" && (s = setTimeout(f,
|
|
155
|
+
clearTimeout(s), d(), a && r.status === "loading" && (s = setTimeout(f, I));
|
|
155
156
|
}, p = (e) => {
|
|
156
157
|
u(e.fontfaces ?? []), f();
|
|
157
158
|
};
|
|
158
159
|
return r.addEventListener("loading", f), r.addEventListener("loadingdone", p), d(!0), f(), () => {
|
|
159
160
|
a = !1, o = void 0, clearTimeout(s), c.clear(), l.clear(), r.removeEventListener("loading", f), r.removeEventListener("loadingdone", p);
|
|
160
161
|
};
|
|
161
|
-
}, pe =
|
|
162
|
-
...
|
|
162
|
+
}, pe = oe(c.fonts.general.fontFamily ?? ""), me = (e) => ({
|
|
163
|
+
...c,
|
|
163
164
|
fonts: {
|
|
164
|
-
...
|
|
165
|
+
...c.fonts,
|
|
165
166
|
general: {
|
|
166
|
-
...
|
|
167
|
+
...c.fonts.general,
|
|
167
168
|
fontFamily: e
|
|
168
169
|
},
|
|
169
170
|
title: {
|
|
170
|
-
...
|
|
171
|
+
...c.fonts.title,
|
|
171
172
|
fontFamily: e
|
|
172
173
|
}
|
|
173
174
|
},
|
|
174
175
|
navigation: {
|
|
175
|
-
...
|
|
176
|
+
...c.navigation,
|
|
176
177
|
activeItem: {
|
|
177
|
-
...
|
|
178
|
+
...c.navigation.activeItem,
|
|
178
179
|
font: {
|
|
179
|
-
...
|
|
180
|
+
...c.navigation.activeItem.font,
|
|
180
181
|
fontFamily: e
|
|
181
182
|
}
|
|
182
183
|
},
|
|
183
184
|
item: {
|
|
184
|
-
...
|
|
185
|
+
...c.navigation.item,
|
|
185
186
|
font: {
|
|
186
|
-
...
|
|
187
|
+
...c.navigation.item.font,
|
|
187
188
|
fontFamily: e
|
|
188
189
|
}
|
|
189
190
|
}
|
|
@@ -191,28 +192,28 @@ var S = (e, t, n) => {
|
|
|
191
192
|
}), he = () => ({
|
|
192
193
|
applied: [],
|
|
193
194
|
pending: []
|
|
194
|
-
}),
|
|
195
|
+
}), B = (e) => typeof e == "object" && !!e && !Array.isArray(e), ge = (e) => B(e) && Object.values(e).every((e) => typeof e == "number" && Number.isInteger(e) && e >= 0), _e = (e) => B(e) ? {
|
|
195
196
|
applied: Array.isArray(e.applied) ? e.applied : [],
|
|
196
197
|
pending: Array.isArray(e.pending) ? e.pending : []
|
|
197
|
-
} : he(),
|
|
198
|
-
if (!
|
|
198
|
+
} : he(), V = (e) => {
|
|
199
|
+
if (!B(e)) return;
|
|
199
200
|
if (typeof e.fieldKey == "string") return e.fieldKey;
|
|
200
201
|
let t = e.field;
|
|
201
|
-
return
|
|
202
|
-
}, ve = (e) => e === "ALL" || e === "ASSOCIATIVE" || e === "VALUE" ? e : "VALUE",
|
|
202
|
+
return B(t) && typeof t.fieldKey == "string" ? t.fieldKey : void 0;
|
|
203
|
+
}, ve = (e) => e === "ALL" || e === "ASSOCIATIVE" || e === "VALUE" ? e : "VALUE", H = (e) => B(e) && (e.kind === "ASSOCIATIVE" || B(e.associativeListFilter)), ye = (e, t) => t === "ALL" ? e : e.filter((e) => t === "ASSOCIATIVE" ? H(e) : !H(e)), be = (e, t) => ({
|
|
203
204
|
applied: ye(e.applied, t),
|
|
204
205
|
pending: ye(e.pending, t)
|
|
205
206
|
}), xe = (e) => {
|
|
206
207
|
if (e?.state !== void 0) return e.state === 1 || e.state === "APPLIED" || e.state === "applied" ? "applied" : "pending";
|
|
207
|
-
},
|
|
208
|
-
let t =
|
|
208
|
+
}, U = (e) => {
|
|
209
|
+
let t = V(e);
|
|
209
210
|
return t ? { fieldKey: t } : void 0;
|
|
210
211
|
}, Se = (e) => e.filter(({ enabled: e, field: t }) => e && typeof t?.fieldKey == "string").map(({ field: e, defaultValue: t }) => ({
|
|
211
212
|
fieldKey: e.fieldKey,
|
|
212
213
|
...t === void 0 ? {} : { defaultValue: t }
|
|
213
|
-
})),
|
|
214
|
-
if (!
|
|
215
|
-
let n =
|
|
214
|
+
})), W = (e, t = "VALUE") => {
|
|
215
|
+
if (!B(e)) return e;
|
|
216
|
+
let n = V(e), r = t === "ALL" ? H(e) ? "ASSOCIATIVE" : "VALUE" : t;
|
|
216
217
|
return n ? {
|
|
217
218
|
...e,
|
|
218
219
|
field: { fieldKey: n },
|
|
@@ -224,8 +225,8 @@ var S = (e, t, n) => {
|
|
|
224
225
|
kind: e.kind ?? r
|
|
225
226
|
};
|
|
226
227
|
}, Ce = (e) => {
|
|
227
|
-
if (!
|
|
228
|
-
let t = { ...e }, n =
|
|
228
|
+
if (!B(e)) return e;
|
|
229
|
+
let t = { ...e }, n = V(e);
|
|
229
230
|
return delete t.field, delete t.fieldKey, delete t.kind, delete t.sourceInstanceId, n ? {
|
|
230
231
|
...t,
|
|
231
232
|
fieldKey: n,
|
|
@@ -260,7 +261,7 @@ var S = (e, t, n) => {
|
|
|
260
261
|
info: (...e) => console.info(...e),
|
|
261
262
|
log: (...e) => console.log(...e),
|
|
262
263
|
warn: (...e) => console.warn(...e)
|
|
263
|
-
}, ke = "REFRESH_DATA", Ae = [
|
|
264
|
+
}, ke = "REFRESH_DATA", Ae = [g.HOST_BRUSH], je = (e, t = "vBackendAPI", n = /* @__PURE__ */ new WeakMap()) => {
|
|
264
265
|
let r = n.get(e);
|
|
265
266
|
if (r) return r;
|
|
266
267
|
let i = new Proxy(e, { get(e, r, i) {
|
|
@@ -270,35 +271,35 @@ var S = (e, t, n) => {
|
|
|
270
271
|
return typeof a == "function" ? a.bind(e) : a && typeof a == "object" ? je(a, `${t}.${r}`, n) : a;
|
|
271
272
|
} });
|
|
272
273
|
return n.set(e, i), i;
|
|
273
|
-
}, Me = (e) => e.hostServices ?? e.services, Ne = (e) => !!(e && typeof e == "object" && "then" in e && typeof e.then == "function"), Pe = (e) =>
|
|
274
|
-
...
|
|
274
|
+
}, Me = (e) => e.hostServices ?? e.services, Ne = (e) => !!(e && typeof e == "object" && "then" in e && typeof e.then == "function"), Pe = (e) => B(e) ? {
|
|
275
|
+
...r,
|
|
275
276
|
...e,
|
|
276
277
|
calendar: {
|
|
277
|
-
...
|
|
278
|
-
...
|
|
278
|
+
...r.calendar,
|
|
279
|
+
...B(e.calendar) ? e.calendar : {}
|
|
279
280
|
},
|
|
280
281
|
formats: {
|
|
281
|
-
...
|
|
282
|
-
...
|
|
282
|
+
...r.formats,
|
|
283
|
+
...B(e.formats) ? e.formats : {}
|
|
283
284
|
},
|
|
284
285
|
number: {
|
|
285
|
-
...
|
|
286
|
-
...
|
|
286
|
+
...r.number,
|
|
287
|
+
...B(e.number) ? e.number : {}
|
|
287
288
|
}
|
|
288
|
-
} :
|
|
289
|
+
} : r, Fe = (e) => B(e) && "response" in e ? e.response : e, G = 1e3, Ie = 1e5, Le = (e, t) => {
|
|
289
290
|
if (e !== void 0 && (!Number.isInteger(e) || e < 1)) throw RangeError(`limit must be a positive integer, received ${e}.`);
|
|
290
|
-
return Math.min(e ?? t?.limit ??
|
|
291
|
+
return Math.min(e ?? t?.limit ?? G, Ie);
|
|
291
292
|
}, Re = Symbol("exportQueryChanged"), ze = async (e, t) => {
|
|
292
293
|
if (!e?.transformQuery) throw Error("Standalone visualization query execution requires engine.getData or engine.transformQuery with data.query.");
|
|
293
294
|
return e.transformQuery(t);
|
|
294
|
-
},
|
|
295
|
-
if (
|
|
295
|
+
}, K = (e) => {
|
|
296
|
+
if (B(e) && typeof e.view == "string") return e.view;
|
|
296
297
|
}, Be = (e) => {
|
|
297
|
-
if (
|
|
298
|
+
if (B(e)) {
|
|
298
299
|
if (typeof e.fieldKey == "string") return e.fieldKey;
|
|
299
300
|
if (typeof e.key == "string") return e.key;
|
|
300
301
|
}
|
|
301
|
-
}, Ve = (e) =>
|
|
302
|
+
}, Ve = (e) => B(e) && typeof e.name == "string" ? e.name : void 0, He = (e, t, n, r = /* @__PURE__ */ new WeakSet()) => {
|
|
302
303
|
if (Array.isArray(e)) {
|
|
303
304
|
for (let i of e) {
|
|
304
305
|
let e = He(i, t, n, r);
|
|
@@ -306,8 +307,8 @@ var S = (e, t, n) => {
|
|
|
306
307
|
}
|
|
307
308
|
return;
|
|
308
309
|
}
|
|
309
|
-
if (
|
|
310
|
-
if (r.add(e), Ve(e) === t &&
|
|
310
|
+
if (B(e) && !r.has(e)) {
|
|
311
|
+
if (r.add(e), Ve(e) === t && K(e) === n) {
|
|
311
312
|
let t = Be(e);
|
|
312
313
|
if (t) return t;
|
|
313
314
|
}
|
|
@@ -316,169 +317,169 @@ var S = (e, t, n) => {
|
|
|
316
317
|
if (e) return e;
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
|
-
},
|
|
320
|
-
let n =
|
|
320
|
+
}, q = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : B(e) ? Array.isArray(e.views) ? e.views.filter((e) => typeof e == "string") : typeof e.view == "string" ? [e.view] : [] : [], Ue = (e, t) => {
|
|
321
|
+
let n = q(t);
|
|
321
322
|
return n.length ? e.filter((e) => {
|
|
322
|
-
let t =
|
|
323
|
+
let t = K(e);
|
|
323
324
|
return t ? n.includes(t) : !1;
|
|
324
325
|
}) : e;
|
|
325
|
-
},
|
|
326
|
-
let
|
|
327
|
-
|
|
328
|
-
}, ce,
|
|
329
|
-
let t =
|
|
326
|
+
}, J = ({ client: e, fontFamily: n = pe, hostBrush: r, instance: i, logger: a, onVSpecChange: o, onGroupedDimensionsChange: s }) => {
|
|
327
|
+
let c = i, l = i.groupId ?? "default", u = i.id, d = new C(), f = /* @__PURE__ */ new Map(), p = new C(), m = new C(), h = new C(), _ = new x(null), v = new x({ vSpec: i.vSpec }), y = new x(me(n)), b = new x({}), ee = new C(), T = new C(), E = new x([]), D = Me(e), O = D?.engine, k = O?.fields, A = D?.data, j = D?.model, M = D?.selections, N = c.dataBinding?.fieldMetadata, P, F, ne, re, I, ie, L = !1, ae = /* @__PURE__ */ new Set(), oe = () => {
|
|
328
|
+
ae.forEach((e) => e());
|
|
329
|
+
}, se, ce, R, le, ue = (e) => {
|
|
330
|
+
let t = k?.getGroupedDimensions?.(e);
|
|
330
331
|
if (Ne(t)) throw Error("Standalone visualization field service getters must return synchronously.");
|
|
331
|
-
return t ??
|
|
332
|
-
},
|
|
333
|
-
if (
|
|
334
|
-
let t =
|
|
335
|
-
return
|
|
336
|
-
},
|
|
337
|
-
let t =
|
|
338
|
-
return "vSpec" in t &&
|
|
339
|
-
...
|
|
332
|
+
return t ?? N?.groupedDimensions ?? {};
|
|
333
|
+
}, de = (e) => {
|
|
334
|
+
if (P && F === void 0) return P;
|
|
335
|
+
let t = ue(e);
|
|
336
|
+
return P ? F?.every((e) => t[e] === P?.[e]) ? (P = void 0, F = void 0, t) : P : t;
|
|
337
|
+
}, z = () => ({ vSpec: c.vSpec }), fe = (e) => {
|
|
338
|
+
let t = B(e) ? e : z();
|
|
339
|
+
return "vSpec" in t && B(t.vSpec) && (c = {
|
|
340
|
+
...c,
|
|
340
341
|
vSpec: t.vSpec
|
|
341
|
-
},
|
|
342
|
-
},
|
|
342
|
+
}, o?.(t.vSpec)), v.next(t), t;
|
|
343
|
+
}, V = (e, t, n) => {
|
|
343
344
|
let r = {
|
|
344
345
|
type: e,
|
|
345
346
|
action: e,
|
|
346
|
-
objectId:
|
|
347
|
+
objectId: u,
|
|
347
348
|
payload: t,
|
|
348
349
|
replay: n
|
|
349
350
|
};
|
|
350
351
|
if (e === "grouped-dimension-level-changed" && ge(t)) {
|
|
351
352
|
let e = { ...t };
|
|
352
|
-
if (
|
|
353
|
-
let t =
|
|
354
|
-
|
|
353
|
+
if (k?.setGroupedDimensions) {
|
|
354
|
+
let t = de(), n = P, r = F;
|
|
355
|
+
P = e, F = Object.keys(e).filter((n) => t[n] !== e[n]);
|
|
355
356
|
try {
|
|
356
|
-
|
|
357
|
+
k.setGroupedDimensions(e);
|
|
357
358
|
} catch (e) {
|
|
358
|
-
throw
|
|
359
|
+
throw P = n, F = r, e;
|
|
359
360
|
}
|
|
360
|
-
} else
|
|
361
|
+
} else P = e, F = void 0;
|
|
361
362
|
}
|
|
362
|
-
return Ae.includes(e) &&
|
|
363
|
+
return Ae.includes(e) && f.set(e, {
|
|
363
364
|
...r,
|
|
364
365
|
replay: !0
|
|
365
|
-
}),
|
|
366
|
-
},
|
|
366
|
+
}), d.next(r), e === "grouped-dimension-level-changed" && ge(t) && s?.({ ...t }), r;
|
|
367
|
+
}, H = (e) => {
|
|
367
368
|
let t = (t) => Te(t, e);
|
|
368
|
-
return new
|
|
369
|
-
let n = [...
|
|
369
|
+
return new S((e) => {
|
|
370
|
+
let n = [...f.values()].filter(t), r = d.pipe(w(t)).subscribe(e);
|
|
370
371
|
return n.forEach((t) => e.next(t)), r;
|
|
371
372
|
});
|
|
372
373
|
}, Ce = (e) => {
|
|
373
|
-
|
|
374
|
+
V(g.HOST_BRUSH, { fields: e });
|
|
374
375
|
};
|
|
375
|
-
|
|
376
|
-
let
|
|
377
|
-
if (!
|
|
378
|
-
return
|
|
379
|
-
}, Ie = (e = "ALL") =>
|
|
380
|
-
if (e) return e(
|
|
376
|
+
r?.length && Ce(r);
|
|
377
|
+
let G = () => {
|
|
378
|
+
if (!M) throw Error("Standalone visualization selection service is not configured. Provide hostServices.selections.");
|
|
379
|
+
return M;
|
|
380
|
+
}, Ie = (e = "ALL") => M ? M.getActiveSelection ? _e(M.getActiveSelection(e, l)) : be(_e(M.getSelection(l)), e) : he(), q = (e = "ALL") => we(Ie(e)), J = new x(q()), Y = new x(q()), X = new x(q()), We = new x([]), Ge = (e, t, n) => {
|
|
381
|
+
if (e) return e(l).subscribe((e) => {
|
|
381
382
|
t.next(we(_e(e))), n?.();
|
|
382
383
|
});
|
|
383
|
-
}, Ke = Ge(
|
|
384
|
-
|
|
385
|
-
}), Je = Ge(
|
|
384
|
+
}, Ke = Ge(M?.onActiveSelectionChange, J), qe = Ge(M?.onActiveSelectionChangeApplied, Y, () => {
|
|
385
|
+
c.type !== "filter" && V(ke);
|
|
386
|
+
}), Je = Ge(M?.onActiveSelectionChangePending, X), Ye = [
|
|
386
387
|
Ke,
|
|
387
388
|
qe,
|
|
388
389
|
Je,
|
|
389
|
-
|
|
390
|
+
M?.singleSelectFields$?.subscribe((e) => {
|
|
390
391
|
We.next(Se(e));
|
|
391
392
|
})
|
|
392
|
-
].filter((e) => !!e),
|
|
393
|
-
let t =
|
|
394
|
-
Ke ||
|
|
393
|
+
].filter((e) => !!e), Z = (e = "all") => {
|
|
394
|
+
let t = q("ALL");
|
|
395
|
+
Ke || J.next(t), (e === "all" || e === "applied") && !qe && Y.next(t), (e === "all" || e === "pending") && !Je && X.next(t);
|
|
395
396
|
}, Xe = (e, t) => {
|
|
396
397
|
let n = Ie("ALL");
|
|
397
398
|
if (t === "ALL") return e;
|
|
398
399
|
let r = t === "VALUE" ? "ASSOCIATIVE" : "VALUE";
|
|
399
400
|
return {
|
|
400
|
-
applied: [...ye(n.applied, r), ...e.applied.map((e) =>
|
|
401
|
-
pending: [...ye(n.pending, r), ...e.pending.map((e) =>
|
|
401
|
+
applied: [...ye(n.applied, r), ...e.applied.map((e) => W(e, t))],
|
|
402
|
+
pending: [...ye(n.pending, r), ...e.pending.map((e) => W(e, t))]
|
|
402
403
|
};
|
|
403
404
|
}, Ze = (e) => {
|
|
404
|
-
let t =
|
|
405
|
+
let t = G();
|
|
405
406
|
if (!t.setNewSelectionState) throw Error("Standalone visualization selection service requires setNewSelectionState.");
|
|
406
|
-
t.setNewSelectionState(
|
|
407
|
+
t.setNewSelectionState(l, e);
|
|
407
408
|
}, Qe = (e) => {
|
|
408
|
-
let t =
|
|
409
|
+
let t = G();
|
|
409
410
|
if (!t.declineSelection) throw Error("Standalone visualization selection service requires declineSelection.");
|
|
410
|
-
t.declineSelection(
|
|
411
|
+
t.declineSelection(l, e);
|
|
411
412
|
}, $e = (e) => {
|
|
412
|
-
let t =
|
|
413
|
+
let t = G();
|
|
413
414
|
if (!t.removeSelection) throw Error("Standalone visualization selection service requires removeSelection.");
|
|
414
|
-
t.removeSelection(
|
|
415
|
-
},
|
|
416
|
-
if (!
|
|
417
|
-
return
|
|
418
|
-
},
|
|
419
|
-
let r = (await
|
|
415
|
+
t.removeSelection(l, e);
|
|
416
|
+
}, et = () => {
|
|
417
|
+
if (!D?.variables) throw Error("Standalone visualization variable service is not configured. Provide hostServices.variables.");
|
|
418
|
+
return D.variables;
|
|
419
|
+
}, tt = async (e, t, n) => {
|
|
420
|
+
let r = (await et().getVariables(e)).find(t);
|
|
420
421
|
if (!r) throw Error(`Standalone visualization variable ${n} was not found.`);
|
|
421
422
|
return r;
|
|
422
423
|
}, Q = {
|
|
423
|
-
getSelectionMode: () =>
|
|
424
|
+
getSelectionMode: () => M?.getSelectionMode?.(l) ?? M?.selectionMode ?? "manual",
|
|
424
425
|
get canLock() {
|
|
425
|
-
return !!(
|
|
426
|
+
return !!(M?.toggleFieldLocked || M?.setFieldLocked);
|
|
426
427
|
},
|
|
427
428
|
singleSelectFields$: We.asObservable(),
|
|
428
|
-
selectionChange:
|
|
429
|
-
selectionCommitted$:
|
|
429
|
+
selectionChange: ee,
|
|
430
|
+
selectionCommitted$: T.asObservable(),
|
|
430
431
|
get onActiveSelectionChange() {
|
|
431
|
-
return
|
|
432
|
+
return G(), J.asObservable();
|
|
432
433
|
},
|
|
433
434
|
get onActiveSelectionChangeApplied() {
|
|
434
|
-
return
|
|
435
|
+
return G(), Y.asObservable();
|
|
435
436
|
},
|
|
436
437
|
get onActiveSelectionChangePending() {
|
|
437
|
-
return
|
|
438
|
+
return G(), X.asObservable();
|
|
438
439
|
},
|
|
439
440
|
get lockedFields() {
|
|
440
|
-
return
|
|
441
|
+
return E.value;
|
|
441
442
|
},
|
|
442
443
|
get lockedFields$() {
|
|
443
|
-
return
|
|
444
|
+
return E.asObservable();
|
|
444
445
|
},
|
|
445
446
|
getSingleSelectedFields: () => We.value,
|
|
446
|
-
getActiveSelection: (e) =>
|
|
447
|
+
getActiveSelection: (e) => q(ve(e)),
|
|
447
448
|
getAllSelectedFields: () => [],
|
|
448
449
|
getNumberOfSelectedValuesForField: () => 0,
|
|
449
450
|
getFewFirstSelectedValues: () => [],
|
|
450
451
|
getCurrentSelectionFilters: () => [],
|
|
451
452
|
getCurrentSelectionValueFilters: () => [],
|
|
452
453
|
selectValues: (e, t) => {
|
|
453
|
-
let n = xe(t), r =
|
|
454
|
-
|
|
454
|
+
let n = xe(t), r = W(e);
|
|
455
|
+
G().selectValues(l, r, n ? { state: n } : void 0), Z(n ?? "all");
|
|
455
456
|
},
|
|
456
457
|
batchSelectValues: (e, t) => {
|
|
457
458
|
e.forEach((e) => Q.selectValues(e, t));
|
|
458
459
|
},
|
|
459
460
|
selectAssociative: (e, t) => {
|
|
460
|
-
Q.selectValues(
|
|
461
|
+
Q.selectValues(W(e, "ASSOCIATIVE"), t ?? { state: 1 });
|
|
461
462
|
},
|
|
462
463
|
setNewSelectionState: (e, t) => {
|
|
463
464
|
let n = ve(t ?? "ALL"), r = Xe({
|
|
464
|
-
applied: e.applied.map((e) =>
|
|
465
|
-
pending: e.pending.map((e) =>
|
|
465
|
+
applied: e.applied.map((e) => W(e, n)),
|
|
466
|
+
pending: e.pending.map((e) => W(e, n))
|
|
466
467
|
}, n);
|
|
467
|
-
Ze(r),
|
|
468
|
+
Ze(r), Z();
|
|
468
469
|
},
|
|
469
470
|
confirmSelection: () => {
|
|
470
|
-
|
|
471
|
+
G().applyPendingSelections(l), Z(), T.next();
|
|
471
472
|
},
|
|
472
473
|
confirmSelectionAll: () => {
|
|
473
474
|
Q.confirmSelection();
|
|
474
475
|
},
|
|
475
476
|
declineSelection: (e) => {
|
|
476
|
-
let t =
|
|
477
|
+
let t = U(e);
|
|
477
478
|
if (t) {
|
|
478
|
-
Qe(t),
|
|
479
|
+
Qe(t), Z("pending");
|
|
479
480
|
return;
|
|
480
481
|
}
|
|
481
|
-
|
|
482
|
+
G().clearPendingSelections(l), Z("pending");
|
|
482
483
|
},
|
|
483
484
|
declineSelectionAll: (e) => {
|
|
484
485
|
if (Array.isArray(e) && e.length) {
|
|
@@ -488,15 +489,15 @@ var S = (e, t, n) => {
|
|
|
488
489
|
Q.declineSelection();
|
|
489
490
|
},
|
|
490
491
|
removeSelection: (e) => {
|
|
491
|
-
let t =
|
|
492
|
+
let t = U(e);
|
|
492
493
|
if (t) {
|
|
493
|
-
$e(t),
|
|
494
|
+
$e(t), Z("applied");
|
|
494
495
|
return;
|
|
495
496
|
}
|
|
496
497
|
Ze({
|
|
497
498
|
applied: [],
|
|
498
|
-
pending:
|
|
499
|
-
}),
|
|
499
|
+
pending: q("ALL").pending
|
|
500
|
+
}), Z("applied");
|
|
500
501
|
},
|
|
501
502
|
removeSelectionByField: (e) => {
|
|
502
503
|
Q.removeSelection(e);
|
|
@@ -509,69 +510,72 @@ var S = (e, t, n) => {
|
|
|
509
510
|
Q.removeSelection();
|
|
510
511
|
},
|
|
511
512
|
clearAllSelection: () => {
|
|
512
|
-
|
|
513
|
+
G().clearAllSelections(l), Z();
|
|
513
514
|
},
|
|
514
515
|
isFieldLocked: (e) => {
|
|
515
|
-
let t =
|
|
516
|
-
return t &&
|
|
516
|
+
let t = U(e);
|
|
517
|
+
return t && M?.isFieldLocked ? M.isFieldLocked(t, l) : !1;
|
|
517
518
|
},
|
|
518
519
|
isFieldLocked$: (e) => {
|
|
519
|
-
let t =
|
|
520
|
-
return n ? new
|
|
520
|
+
let t = U(e), n = t && M?.isFieldLocked$?.(t, l);
|
|
521
|
+
return n ? new S((e) => {
|
|
521
522
|
let t = n.subscribe((t) => e.next(t));
|
|
522
523
|
return () => t.unsubscribe();
|
|
523
|
-
}) :
|
|
524
|
+
}) : te(!1);
|
|
524
525
|
},
|
|
525
526
|
setFieldLocked: (e, t) => {
|
|
526
|
-
let n =
|
|
527
|
-
n &&
|
|
527
|
+
let n = U(e);
|
|
528
|
+
n && M?.setFieldLocked?.(n, t, l);
|
|
528
529
|
},
|
|
529
530
|
setLockedFields: (e) => {
|
|
530
|
-
|
|
531
|
+
E.next(e);
|
|
531
532
|
},
|
|
532
533
|
toggleFieldLocked: (e) => {
|
|
533
|
-
let t =
|
|
534
|
-
t && (
|
|
534
|
+
let t = U(e);
|
|
535
|
+
t && (M?.toggleFieldLocked ? M.toggleFieldLocked(t, l) : M?.setFieldLocked?.(t, !Q.isFieldLocked(e), l));
|
|
535
536
|
}
|
|
536
|
-
},
|
|
537
|
-
get: async (e) =>
|
|
538
|
-
getByObjectIdAndByName: async (e, t) =>
|
|
539
|
-
getVariables: async () =>
|
|
540
|
-
getVariablesByObjectId: async (e) =>
|
|
541
|
-
onCreate: new
|
|
537
|
+
}, nt = {
|
|
538
|
+
get: async (e) => tt(u, (t) => B(t) && t.id === e, `with id "${e}"`),
|
|
539
|
+
getByObjectIdAndByName: async (e, t) => tt(e, (e) => B(e) && e.name === t, `named "${t}"`),
|
|
540
|
+
getVariables: async () => et().getVariables(u),
|
|
541
|
+
getVariablesByObjectId: async (e) => et().getVariables(e),
|
|
542
|
+
onCreate: new C(),
|
|
542
543
|
updateByObjectId: async () => {
|
|
543
544
|
throw Error("Standalone visualization variable updates are not supported by the current host service.");
|
|
544
545
|
},
|
|
545
|
-
watchByObjectId: async (e) =>
|
|
546
|
-
},
|
|
546
|
+
watchByObjectId: async (e) => te(await et().getVariables(e))
|
|
547
|
+
}, rt = {
|
|
547
548
|
editable: !1,
|
|
548
549
|
embeddable: !1,
|
|
549
550
|
hasContextMenu: !1,
|
|
550
551
|
animable: !0,
|
|
551
552
|
isPrintMode: !1
|
|
552
|
-
},
|
|
553
|
-
let t = { ...
|
|
553
|
+
}, it = (e) => {
|
|
554
|
+
let t = { ...c.dataBinding ?? {} }, n = t.queryContext;
|
|
554
555
|
return delete t.fieldMetadata, delete t.queryContext, {
|
|
555
556
|
...t,
|
|
556
|
-
context:
|
|
557
|
+
context: {
|
|
558
|
+
...typeof n == "object" && n && !Array.isArray(n) ? n : {},
|
|
559
|
+
objectType: c.type
|
|
560
|
+
},
|
|
557
561
|
query: e
|
|
558
562
|
};
|
|
559
|
-
}, it = (e) => {
|
|
560
|
-
let t = A?.fields ?? A?.validFields;
|
|
561
|
-
return t ? Ue(t, e) : void 0;
|
|
562
563
|
}, at = (e) => {
|
|
563
|
-
let t =
|
|
564
|
+
let t = N?.fields ?? N?.validFields;
|
|
564
565
|
return t ? Ue(t, e) : void 0;
|
|
565
566
|
}, ot = (e) => {
|
|
566
|
-
let t =
|
|
567
|
+
let t = N?.validFields ?? N?.fields;
|
|
567
568
|
return t ? Ue(t, e) : void 0;
|
|
568
569
|
}, st = (e) => {
|
|
569
|
-
|
|
570
|
-
|
|
570
|
+
let t = N?.viewsFields ?? N?.fields ?? N?.validFields;
|
|
571
|
+
return t ? Ue(t, e) : void 0;
|
|
572
|
+
}, ct = (e) => {
|
|
573
|
+
if (!B(e) || Be(e)) return e;
|
|
574
|
+
let t = K(e), n = Ve(e);
|
|
571
575
|
if (!t || !n) return e;
|
|
572
|
-
let r = He(
|
|
576
|
+
let r = He(N, n, t);
|
|
573
577
|
return r ? { fieldKey: r } : e;
|
|
574
|
-
},
|
|
578
|
+
}, lt = (e) => Array.isArray(e) ? e.map(ct) : e, ut = (e, ...t) => {
|
|
575
579
|
for (let e of t) {
|
|
576
580
|
let t = e();
|
|
577
581
|
if (Ne(t)) throw Error("Standalone visualization field service getters must return synchronously.");
|
|
@@ -580,175 +584,175 @@ var S = (e, t, n) => {
|
|
|
580
584
|
return e;
|
|
581
585
|
}, $ = {
|
|
582
586
|
getAssociatedViews: async (e) => {
|
|
583
|
-
if (
|
|
584
|
-
let t =
|
|
587
|
+
if (O?.getAssociatedViews) return O.getAssociatedViews(e, c.dataBinding);
|
|
588
|
+
let t = O?.areViewsConnected ? $.getFields() : [];
|
|
585
589
|
if (t.length > 0) {
|
|
586
|
-
let n =
|
|
590
|
+
let n = K(t.find((t) => Be(t) === e));
|
|
587
591
|
if (!n) throw Error(`Associative filtering could not find field "${e}".`);
|
|
588
|
-
return [...new Set(t.map(
|
|
592
|
+
return [...new Set(t.map(K).filter((e) => !!e))].filter((e) => $.areViewsConnected([n], [e]));
|
|
589
593
|
}
|
|
590
|
-
if (!
|
|
594
|
+
if (!O?.getData && !A?.query) throw Error("Associative filtering requires engine.getAssociatedViews or query view metadata.");
|
|
591
595
|
let n = await $.getData({
|
|
592
596
|
dimensions: [{ fieldKey: e }],
|
|
593
597
|
measures: [],
|
|
594
598
|
filters: [],
|
|
595
599
|
limit: 1
|
|
596
600
|
});
|
|
597
|
-
if (!
|
|
598
|
-
let r = n.viewStates.filter(
|
|
599
|
-
return r.flatMap((e) => (i ? e.alfStatus === "nonVia" :
|
|
601
|
+
if (!B(n) || !Array.isArray(n.viewStates)) throw Error("The engine did not return associative view metadata. Provide engine.getAssociatedViews.");
|
|
602
|
+
let r = n.viewStates.filter(B), i = r.some((e) => typeof e.alfStatus == "string");
|
|
603
|
+
return r.flatMap((e) => (i ? e.alfStatus === "nonVia" : B(e.compatibleTypeFlags) && e.compatibleTypeFlags.associativeListFilter === !0) && typeof e.view == "string" ? [e.view] : []);
|
|
600
604
|
},
|
|
601
605
|
get capabilities() {
|
|
602
606
|
return {
|
|
603
607
|
...De(),
|
|
604
|
-
...
|
|
608
|
+
...O?.capabilities ?? {}
|
|
605
609
|
};
|
|
606
610
|
},
|
|
607
611
|
get databaseInfo() {
|
|
608
|
-
return
|
|
612
|
+
return O?.databaseInfo;
|
|
609
613
|
},
|
|
610
614
|
get localeSettings() {
|
|
611
|
-
return Pe(
|
|
615
|
+
return Pe(O?.localeSettings);
|
|
612
616
|
},
|
|
613
617
|
getData: async (e) => {
|
|
614
|
-
let t =
|
|
615
|
-
if (
|
|
616
|
-
else if (
|
|
617
|
-
let e = await ze(
|
|
618
|
+
let t = it(e), n;
|
|
619
|
+
if (O?.getData) n = await O.getData(t);
|
|
620
|
+
else if (A?.query) {
|
|
621
|
+
let e = await ze(O, t), r = {
|
|
618
622
|
...t,
|
|
619
623
|
query: e
|
|
620
624
|
};
|
|
621
|
-
n = await
|
|
625
|
+
n = await A.query(r);
|
|
622
626
|
} else throw Error("Standalone visualization data service is not configured. Provide engine.getData or data.query.");
|
|
623
627
|
return Fe(n);
|
|
624
628
|
},
|
|
625
|
-
getDimensionsList: (e) =>
|
|
626
|
-
getGroupedDimensions:
|
|
627
|
-
getMeasuresList: (e) =>
|
|
629
|
+
getDimensionsList: (e) => ut([], () => k?.getDimensionsList?.(e), () => N?.dimensions),
|
|
630
|
+
getGroupedDimensions: de,
|
|
631
|
+
getMeasuresList: (e) => ut([], () => k?.getMeasuresList?.(e), () => N?.measures),
|
|
628
632
|
getValidFields: (e) => {
|
|
629
|
-
let t =
|
|
630
|
-
return
|
|
633
|
+
let t = lt(e);
|
|
634
|
+
return ut([], () => k?.getValidFields?.(t), () => ot(t));
|
|
631
635
|
},
|
|
632
|
-
getViewsFields: (e) =>
|
|
633
|
-
getFields: (e) =>
|
|
636
|
+
getViewsFields: (e) => ut([], () => k?.getViewsFields?.(e), () => st(e)),
|
|
637
|
+
getFields: (e) => ut([], () => k?.getFields?.(e), () => at(e)),
|
|
634
638
|
areFieldsConnected: (...e) => {
|
|
635
|
-
let t =
|
|
639
|
+
let t = O?.areFieldsConnected?.(...e.map(ct));
|
|
636
640
|
if (Ne(t)) throw Error("Standalone visualization field connectivity service must return synchronously.");
|
|
637
641
|
return typeof t == "boolean" && t;
|
|
638
642
|
},
|
|
639
643
|
areViewsConnected: (...e) => {
|
|
640
|
-
let t =
|
|
644
|
+
let t = O?.areViewsConnected?.(...e);
|
|
641
645
|
if (Ne(t)) throw Error("Standalone visualization view connectivity service must return synchronously.");
|
|
642
646
|
return typeof t == "boolean" && t;
|
|
643
647
|
}
|
|
644
|
-
},
|
|
645
|
-
properties:
|
|
646
|
-
metaSubject: new
|
|
647
|
-
calculationsInProgress: new
|
|
648
|
+
}, dt = {
|
|
649
|
+
properties: v.asObservable(),
|
|
650
|
+
metaSubject: new C(),
|
|
651
|
+
calculationsInProgress: new C(),
|
|
648
652
|
getObject: () => ({
|
|
649
|
-
id:
|
|
650
|
-
type:
|
|
651
|
-
properties:
|
|
653
|
+
id: u,
|
|
654
|
+
type: c.type,
|
|
655
|
+
properties: z(),
|
|
652
656
|
meta: {}
|
|
653
657
|
}),
|
|
654
|
-
getLayout: async () => ({ properties:
|
|
658
|
+
getLayout: async () => ({ properties: z() }),
|
|
655
659
|
saveProperties: async (e, t) => {
|
|
656
|
-
let n =
|
|
657
|
-
return await
|
|
660
|
+
let n = z(), r = typeof e == "function" ? e(n) : e, i = fe(r);
|
|
661
|
+
return await j?.saveProperties(i, t), i;
|
|
658
662
|
},
|
|
659
|
-
undoSaveProperties: async () =>
|
|
660
|
-
redoSaveProperties: async () =>
|
|
661
|
-
getProperties:
|
|
662
|
-
getCurrentProperties: async () =>
|
|
663
|
+
undoSaveProperties: async () => z(),
|
|
664
|
+
redoSaveProperties: async () => z(),
|
|
665
|
+
getProperties: z,
|
|
666
|
+
getCurrentProperties: async () => z(),
|
|
663
667
|
getReferences: () => [],
|
|
664
668
|
saveLocalVSpec: async (e) => {
|
|
665
|
-
|
|
669
|
+
fe({ vSpec: e }), await j?.saveLocalVSpec(e);
|
|
666
670
|
},
|
|
667
671
|
overwriteLocalProperties: (e) => {
|
|
668
|
-
|
|
672
|
+
fe(e);
|
|
669
673
|
},
|
|
670
|
-
resetLocalVSpec: async () =>
|
|
671
|
-
},
|
|
672
|
-
getVisualizationStore: () =>
|
|
673
|
-
saveVisualizationStore: (e) => (
|
|
674
|
-
|
|
675
|
-
}),
|
|
674
|
+
resetLocalVSpec: async () => z()
|
|
675
|
+
}, ft = {
|
|
676
|
+
getVisualizationStore: () => ne,
|
|
677
|
+
saveVisualizationStore: (e) => (re?.(), ne = e, re = (e?.store)?.subscribe?.((e) => {
|
|
678
|
+
B(e.vSpec) && fe({ vSpec: e.vSpec });
|
|
679
|
+
}), ne),
|
|
676
680
|
get exportDataQuery() {
|
|
677
|
-
return
|
|
681
|
+
return I;
|
|
678
682
|
},
|
|
679
683
|
getEngine: async () => $,
|
|
680
684
|
get engine() {
|
|
681
685
|
return $;
|
|
682
686
|
},
|
|
683
|
-
theme: { current:
|
|
684
|
-
model:
|
|
687
|
+
theme: { current: y },
|
|
688
|
+
model: dt,
|
|
685
689
|
daedalus: {
|
|
686
690
|
clearTimeTravel: () => void 0,
|
|
687
|
-
emitEvent:
|
|
691
|
+
emitEvent: V,
|
|
688
692
|
engineConfig: {},
|
|
689
693
|
featureFlagsAPI: {
|
|
690
|
-
featureFlags$: new
|
|
694
|
+
featureFlags$: new C(),
|
|
691
695
|
getVariantValue: () => ({}),
|
|
692
696
|
isEnabled: () => !1
|
|
693
697
|
},
|
|
694
698
|
getLoggerObject: () => Oe,
|
|
695
|
-
getEvents:
|
|
699
|
+
getEvents: H,
|
|
696
700
|
getWorkbookProperties: () => ({}),
|
|
697
|
-
objectCapabilities:
|
|
698
|
-
onEngineConfigChange:
|
|
701
|
+
objectCapabilities: rt,
|
|
702
|
+
onEngineConfigChange: b,
|
|
699
703
|
options: { workbookContextOptions: {
|
|
700
704
|
isMockWorkbook: !1,
|
|
701
705
|
useStorage: !1
|
|
702
706
|
} },
|
|
703
707
|
setTimeTravel: () => void 0,
|
|
704
|
-
themeApi: { current:
|
|
705
|
-
variablesApi:
|
|
706
|
-
workbookAPI: { variables:
|
|
708
|
+
themeApi: { current: y },
|
|
709
|
+
variablesApi: nt,
|
|
710
|
+
workbookAPI: { variables: nt }
|
|
707
711
|
},
|
|
708
712
|
selection: Q,
|
|
709
|
-
getObjectCapabilities: () =>
|
|
710
|
-
onChange: () =>
|
|
711
|
-
focus$:
|
|
712
|
-
focusOut$:
|
|
713
|
-
lastQuery$:
|
|
713
|
+
getObjectCapabilities: () => rt,
|
|
714
|
+
onChange: () => d.asObservable(),
|
|
715
|
+
focus$: p.asObservable(),
|
|
716
|
+
focusOut$: m.asObservable(),
|
|
717
|
+
lastQuery$: h.asObservable(),
|
|
714
718
|
isFocused: !1,
|
|
715
719
|
registerExportDataQuery: (e, t) => {
|
|
716
|
-
|
|
720
|
+
I = e, ie = B(t) ? t : void 0, oe();
|
|
717
721
|
},
|
|
718
722
|
registerOperationsData: (e, t, n, r) => {
|
|
719
|
-
|
|
723
|
+
se = e, ce = t, R = n, le = r;
|
|
720
724
|
},
|
|
721
725
|
get operationsManifest() {
|
|
722
|
-
return
|
|
726
|
+
return se;
|
|
723
727
|
},
|
|
724
728
|
get vSpecSchema() {
|
|
725
|
-
return
|
|
729
|
+
return ce;
|
|
726
730
|
},
|
|
727
731
|
get filterOperatorsManifest() {
|
|
728
|
-
return
|
|
732
|
+
return R;
|
|
729
733
|
},
|
|
730
734
|
get chartRequirementsManifest() {
|
|
731
|
-
return
|
|
735
|
+
return le;
|
|
732
736
|
},
|
|
733
|
-
genericError: (e) => (
|
|
734
|
-
instanceId:
|
|
737
|
+
genericError: (e) => (a?.error && a.error("[astrato-visualizations] visualization reported an error", {
|
|
738
|
+
instanceId: u,
|
|
735
739
|
message: e,
|
|
736
|
-
type:
|
|
737
|
-
}),
|
|
740
|
+
type: c.type
|
|
741
|
+
}), V("generic-error", { message: e })),
|
|
738
742
|
showToast: () => void 0,
|
|
739
|
-
showComponentToast: (e) => (
|
|
740
|
-
hideToast: () => (
|
|
741
|
-
availableFonts: Ee(
|
|
743
|
+
showComponentToast: (e) => (_.next(e), V("component-toast", e)),
|
|
744
|
+
hideToast: () => (_.next(null), V("component-toast-hidden")),
|
|
745
|
+
availableFonts: Ee(n),
|
|
742
746
|
logger: Oe,
|
|
743
|
-
emitEvent:
|
|
744
|
-
getEvents:
|
|
747
|
+
emitEvent: V,
|
|
748
|
+
getEvents: H,
|
|
745
749
|
exportData: async () => void 0,
|
|
746
|
-
toastState$:
|
|
747
|
-
objectId:
|
|
750
|
+
toastState$: _.asObservable(),
|
|
751
|
+
objectId: u,
|
|
748
752
|
object: {
|
|
749
|
-
id:
|
|
750
|
-
type:
|
|
751
|
-
properties:
|
|
753
|
+
id: u,
|
|
754
|
+
type: c.type,
|
|
755
|
+
properties: z(),
|
|
752
756
|
meta: {}
|
|
753
757
|
},
|
|
754
758
|
activate: () => void 0,
|
|
@@ -758,95 +762,95 @@ var S = (e, t, n) => {
|
|
|
758
762
|
getObjectPropertiesById: async () => void 0,
|
|
759
763
|
getResolvedAdvancedTextValue: (e) => e,
|
|
760
764
|
getObjectRegistryURL: async () => null
|
|
761
|
-
},
|
|
762
|
-
if (
|
|
763
|
-
let e,
|
|
765
|
+
}, pt = async () => {
|
|
766
|
+
if (L) return null;
|
|
767
|
+
let e, n, r;
|
|
764
768
|
do {
|
|
765
|
-
e =
|
|
766
|
-
let
|
|
767
|
-
|
|
769
|
+
e = I, n = ie;
|
|
770
|
+
let t = () => void 0, i = new Promise((e) => {
|
|
771
|
+
t = () => e(Re), ae.add(t);
|
|
768
772
|
});
|
|
769
773
|
try {
|
|
770
|
-
|
|
774
|
+
r = await Promise.race([e, i]);
|
|
771
775
|
} finally {
|
|
772
|
-
|
|
776
|
+
ae.delete(t);
|
|
773
777
|
}
|
|
774
|
-
} while (!
|
|
775
|
-
return
|
|
776
|
-
instanceId:
|
|
777
|
-
query:
|
|
778
|
-
config:
|
|
779
|
-
};
|
|
778
|
+
} while (!L && (r === Re || e !== I));
|
|
779
|
+
return L || !B(r) ? null : t({
|
|
780
|
+
instanceId: i.id,
|
|
781
|
+
query: r,
|
|
782
|
+
config: n
|
|
783
|
+
});
|
|
780
784
|
};
|
|
781
785
|
return {
|
|
782
|
-
instanceId:
|
|
783
|
-
groupId:
|
|
784
|
-
vBackendAPI: je(
|
|
785
|
-
getExportQuery:
|
|
786
|
+
instanceId: i.id,
|
|
787
|
+
groupId: l,
|
|
788
|
+
vBackendAPI: je(ft),
|
|
789
|
+
getExportQuery: pt,
|
|
786
790
|
getData: async (e) => {
|
|
787
|
-
let t = await
|
|
791
|
+
let t = await pt();
|
|
788
792
|
if (!t) return null;
|
|
789
793
|
let n = {
|
|
790
794
|
...t.query,
|
|
791
795
|
limit: Le(e?.limit, t.config)
|
|
792
796
|
}, r = await $.getData(n);
|
|
793
|
-
return
|
|
797
|
+
return L ? null : {
|
|
794
798
|
...t,
|
|
795
799
|
query: n,
|
|
796
800
|
data: r
|
|
797
801
|
};
|
|
798
802
|
},
|
|
799
803
|
onVisualizationState: (e) => {
|
|
800
|
-
let t =
|
|
804
|
+
let t = H({ type: g.VISUALIZATION_STATE }).subscribe((t) => {
|
|
801
805
|
t.payload?.state && e(t.payload.state);
|
|
802
806
|
});
|
|
803
807
|
return () => t.unsubscribe();
|
|
804
808
|
},
|
|
805
809
|
setHostBrush: Ce,
|
|
806
810
|
syncGroupedDimensions: (e) => {
|
|
807
|
-
|
|
811
|
+
P = { ...e }, F = void 0, d.next({
|
|
808
812
|
type: "grouped-dimension-level-changed",
|
|
809
813
|
action: "grouped-dimension-level-changed",
|
|
810
|
-
objectId:
|
|
814
|
+
objectId: u,
|
|
811
815
|
payload: { ...e }
|
|
812
816
|
});
|
|
813
817
|
},
|
|
814
818
|
updateInstance: (e) => {
|
|
815
|
-
let t = e.dataBinding !==
|
|
816
|
-
|
|
819
|
+
let t = e.dataBinding !== c.dataBinding;
|
|
820
|
+
c = e, t && (N = e.dataBinding?.fieldMetadata, P = void 0, F = void 0), v.next(z());
|
|
817
821
|
},
|
|
818
822
|
updateVSpec: (e) => {
|
|
819
|
-
(
|
|
823
|
+
(ne?.store)?.getState?.().updateVSpec?.(e, u);
|
|
820
824
|
},
|
|
821
825
|
refreshTheme: () => {
|
|
822
|
-
|
|
826
|
+
L || y.next(me(n));
|
|
823
827
|
},
|
|
824
828
|
destroy: () => {
|
|
825
|
-
|
|
829
|
+
L = !0, oe(), re?.(), d.complete(), p.complete(), m.complete(), h.complete(), _.complete(), v.complete(), y.complete(), b.complete(), ee.complete(), T.complete(), Ye.forEach((e) => e.unsubscribe()), E.complete(), We.complete(), J.complete(), Y.complete(), X.complete();
|
|
826
830
|
}
|
|
827
831
|
};
|
|
828
|
-
},
|
|
829
|
-
let n =
|
|
832
|
+
}, Y = (e, t) => {
|
|
833
|
+
let n = y(e.vSpec);
|
|
830
834
|
return {
|
|
831
835
|
instanceId: e.id,
|
|
832
836
|
type: e.type,
|
|
833
837
|
requirementsMet: n,
|
|
834
|
-
requirements: t.requirements ??
|
|
838
|
+
requirements: t.requirements ?? h(e.type),
|
|
835
839
|
...n ? {} : { reason: `Visualization ${e.type} vSpec does not currently satisfy the required data items.` }
|
|
836
840
|
};
|
|
837
|
-
},
|
|
841
|
+
}, X = /* @__PURE__ */ e(_(), 1), We = (e) => (n(e) && (e.columns = []), a(e) && (e.dimensions = []), s(e) && (e.measures = []), i(e) && (e.referencedData = {}), e), Ge = (e, t) => ee(We((0, X.default)({}, t.createDefaultVSpec(), b(void 0, e).vSpec)), t.type), Ke = (e, t) => {
|
|
838
842
|
if (e.vSpec) {
|
|
839
843
|
if (e.type === "table") {
|
|
840
|
-
let
|
|
844
|
+
let t = e.vSpec;
|
|
841
845
|
return {
|
|
842
|
-
...
|
|
843
|
-
dataStructure:
|
|
846
|
+
...t,
|
|
847
|
+
dataStructure: t.dataStructure ?? o.Normal
|
|
844
848
|
};
|
|
845
849
|
}
|
|
846
850
|
return e.vSpec;
|
|
847
851
|
}
|
|
848
|
-
return e.preset ? Ge(e.preset,
|
|
849
|
-
}, qe = "default", Je = 4e4, Ye = 2147483647,
|
|
852
|
+
return e.preset ? Ge(e.preset, t) : t.createDefaultVSpec();
|
|
853
|
+
}, qe = "default", Je = 4e4, Ye = 2147483647, Z = {
|
|
850
854
|
warn: (e, t) => {
|
|
851
855
|
console.warn(e, t);
|
|
852
856
|
},
|
|
@@ -856,72 +860,86 @@ var S = (e, t, n) => {
|
|
|
856
860
|
}, Xe = (e) => ({
|
|
857
861
|
...e,
|
|
858
862
|
groupId: e.groupId ?? qe
|
|
859
|
-
}), Ze = (e
|
|
863
|
+
}), Ze = (e, t = []) => {
|
|
864
|
+
if (e === null || typeof e == "string" || typeof e == "boolean") return !0;
|
|
865
|
+
if (typeof e == "number") return Number.isFinite(e);
|
|
866
|
+
if (typeof e != "object" || t.includes(e)) return !1;
|
|
867
|
+
let n = [...t, e];
|
|
868
|
+
if (Array.isArray(e)) return Array.from(e).every((e) => Ze(e, n));
|
|
869
|
+
let r = Object.getPrototypeOf(e);
|
|
870
|
+
return r !== Object.prototype && r !== null ? !1 : Object.values(e).every((e) => Ze(e, n));
|
|
871
|
+
}, Qe = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean", $e = (e) => {
|
|
860
872
|
if (!Array.isArray(e)) throw TypeError("Brush fields must be an array of { fieldKey, values }.");
|
|
861
873
|
return e.map(({ fieldKey: e, values: t }) => {
|
|
862
874
|
if (typeof e != "string" || !e || !Array.isArray(t)) throw TypeError("Each brush field needs a fieldKey string and a values array.");
|
|
863
875
|
return {
|
|
864
876
|
fieldKey: e,
|
|
865
|
-
values: t.filter(
|
|
877
|
+
values: t.filter(Qe)
|
|
866
878
|
};
|
|
867
879
|
}).filter(({ values: e }) => e.length);
|
|
868
|
-
},
|
|
880
|
+
}, et = (e) => e instanceof Error ? e.message : "Unknown visualization runtime error.", tt = (e) => {
|
|
869
881
|
e.replaceChildren(), delete e.dataset.astratoInstanceId, delete e.dataset.astratoVisualizationType, delete e.dataset.astratoMountStatus;
|
|
870
|
-
},
|
|
882
|
+
}, Q = (e) => {
|
|
871
883
|
let t = e.getBoundingClientRect();
|
|
872
884
|
return {
|
|
873
885
|
height: t.height || e.clientHeight,
|
|
874
886
|
width: t.width || e.clientWidth
|
|
875
887
|
};
|
|
876
|
-
},
|
|
877
|
-
let
|
|
878
|
-
|
|
879
|
-
}),
|
|
880
|
-
|
|
888
|
+
}, nt = "astrato-standalone", rt = (e, t, n, r, i) => {
|
|
889
|
+
let a = !1, o, s = () => void 0, c = new Promise((e) => {
|
|
890
|
+
s = e;
|
|
891
|
+
}), l = (t) => {
|
|
892
|
+
a || (a = !0, clearTimeout(o), n.removeEventListener("visibilitychange", u), s({
|
|
881
893
|
instanceId: e,
|
|
882
894
|
status: t
|
|
883
895
|
}), r());
|
|
884
|
-
},
|
|
885
|
-
clearTimeout(
|
|
896
|
+
}, u = () => {
|
|
897
|
+
clearTimeout(o), n.visibilityState !== "hidden" && (o = setTimeout(() => {
|
|
898
|
+
try {
|
|
899
|
+
i?.();
|
|
900
|
+
} finally {
|
|
901
|
+
l("timeout");
|
|
902
|
+
}
|
|
903
|
+
}, t));
|
|
886
904
|
};
|
|
887
|
-
return n.addEventListener("visibilitychange",
|
|
888
|
-
ready:
|
|
889
|
-
settle:
|
|
905
|
+
return n.addEventListener("visibilitychange", u), u(), {
|
|
906
|
+
ready: c,
|
|
907
|
+
settle: l
|
|
890
908
|
};
|
|
891
|
-
},
|
|
909
|
+
}, it = (e) => `${nt}-${e.toLowerCase().replace(/[^a-z0-9-]/g, "-")}`, at = (e, t) => e.preset ? e.preset : t.presets?.find((e) => e.enabled)?.id ?? t.presets?.[0]?.id, ot = (e) => {
|
|
892
910
|
let t = e.readyTimeoutMs ?? Je;
|
|
893
911
|
if (!Number.isInteger(t) || t < 1 || t > Ye) throw RangeError(`readyTimeoutMs must be an integer from 1 to ${Ye} milliseconds.`);
|
|
894
|
-
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(),
|
|
912
|
+
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = e.logger ?? Z, h = 0, g = (e) => {
|
|
895
913
|
let t = (r.get(e) ?? 0) + 1;
|
|
896
914
|
return r.set(e, t), t;
|
|
897
|
-
},
|
|
898
|
-
|
|
915
|
+
}, _ = (e) => (h += 1, u.set(e, h), h), y = (e, t) => u.get(e) === t, b = (e) => {
|
|
916
|
+
d.get(e.instanceId)?.forEach((t) => {
|
|
899
917
|
t(e);
|
|
900
918
|
});
|
|
901
919
|
}, ee = (e, t) => {
|
|
902
920
|
let r = n.get(e);
|
|
903
921
|
if (!r || !t || r.vSpec === t) return;
|
|
904
|
-
let
|
|
922
|
+
let i = Xe({
|
|
905
923
|
...r,
|
|
906
924
|
vSpec: t
|
|
907
925
|
});
|
|
908
|
-
n.set(e,
|
|
909
|
-
instance:
|
|
926
|
+
n.set(e, i), g(e), o.get(e)?.updateInstance(i), b({
|
|
927
|
+
instance: i,
|
|
910
928
|
instanceId: e,
|
|
911
929
|
reason: "vspec-updated"
|
|
912
930
|
});
|
|
913
|
-
},
|
|
914
|
-
|
|
915
|
-
},
|
|
931
|
+
}, x = (e, t) => {
|
|
932
|
+
c.get(e)?.hostAdapter?.updateVSpec(t);
|
|
933
|
+
}, S = (e) => {
|
|
916
934
|
if (e.isUnmounted) return;
|
|
917
|
-
e.isUnmounted = !0, e.settleReady("unmounted"), e.stopFontWatch?.(), e.visualizationElement?.visualisationDestroy?.(), e.hostAdapter?.destroy(),
|
|
918
|
-
let t =
|
|
919
|
-
|
|
920
|
-
},
|
|
921
|
-
t.length ?
|
|
935
|
+
e.isUnmounted = !0, e.settleReady("unmounted"), e.stopFontWatch?.(), e.visualizationElement?.visualisationDestroy?.(), e.hostAdapter?.destroy(), o.get(e.instanceId) === e.hostAdapter && o.delete(e.instanceId), c.get(e.instanceId) === e && c.delete(e.instanceId);
|
|
936
|
+
let t = y(e.container, e.generation);
|
|
937
|
+
s.get(e.container) === e && s.delete(e.container), t && (u.delete(e.container), tt(e.container));
|
|
938
|
+
}, C = (e, t) => {
|
|
939
|
+
t.length ? f.set(e, t) : f.delete(e), o.forEach((n) => {
|
|
922
940
|
n.groupId === e && n.setHostBrush(t);
|
|
923
941
|
});
|
|
924
|
-
},
|
|
942
|
+
}, w = (e, t) => ({
|
|
925
943
|
instanceId: e,
|
|
926
944
|
ready: Promise.resolve({
|
|
927
945
|
instanceId: e,
|
|
@@ -932,7 +950,7 @@ var S = (e, t, n) => {
|
|
|
932
950
|
getExportQuery: async () => null,
|
|
933
951
|
getData: async () => null,
|
|
934
952
|
unmount: () => void 0
|
|
935
|
-
}),
|
|
953
|
+
}), te = (e) => (s.set(e.container, e), c.set(e.instanceId, e), e.hostAdapter && o.set(e.instanceId, e.hostAdapter), {
|
|
936
954
|
instanceId: e.instanceId,
|
|
937
955
|
ready: e.ready,
|
|
938
956
|
requirements: e.requirements,
|
|
@@ -940,187 +958,217 @@ var S = (e, t, n) => {
|
|
|
940
958
|
getExportQuery: async () => e.isUnmounted ? null : e.hostAdapter?.getExportQuery() ?? null,
|
|
941
959
|
getData: async (t) => e.isUnmounted ? null : e.hostAdapter?.getData(t) ?? null,
|
|
942
960
|
unmount: () => {
|
|
943
|
-
|
|
961
|
+
S(e);
|
|
944
962
|
}
|
|
945
|
-
}),
|
|
963
|
+
}), T = (e, t, n, r, i) => {
|
|
946
964
|
let a = e.ownerDocument.defaultView?.customElements ?? globalThis.customElements;
|
|
947
965
|
if (!a) throw Error("Custom elements registry is not available.");
|
|
948
|
-
let o =
|
|
966
|
+
let o = it(t.type);
|
|
949
967
|
a.get(o) || a.define(o, i);
|
|
950
968
|
let s = e.ownerDocument.createElement(o);
|
|
951
969
|
s.type = t.type, s.vBackendAPI = n.vBackendAPI, s.style.display = "block", s.style.height = "100%", s.style.width = "100%", e.appendChild(s), s.visualisationInit?.();
|
|
952
|
-
let c = n.vBackendAPI.getVisualizationStore?.()?.store?.getState?.(), l =
|
|
970
|
+
let c = n.vBackendAPI.getVisualizationStore?.()?.store?.getState?.(), l = at(t, r);
|
|
953
971
|
return l && c?.setPreset?.(l), c?.updateVSpec?.(t.vSpec, t.id), s;
|
|
954
|
-
},
|
|
955
|
-
|
|
972
|
+
}, E = (e) => {
|
|
973
|
+
if (!n.has(e)) return;
|
|
974
|
+
let t = c.get(e);
|
|
975
|
+
t && S(t), o.get(e)?.destroy(), o.delete(e), n.delete(e), i.delete(e), g(e), b({
|
|
976
|
+
instanceId: e,
|
|
977
|
+
reason: "removed"
|
|
978
|
+
});
|
|
979
|
+
}, O = (e) => {
|
|
980
|
+
try {
|
|
981
|
+
let t = Xe(e);
|
|
982
|
+
return Object.values(t).every((e) => e === void 0 || Ze(e)) ? JSON.stringify(t, (e, t) => t && typeof t == "object" && !Array.isArray(t) ? Object.fromEntries(Object.entries(t).sort(([e], [t]) => e < t ? -1 : +(e > t))) : t) : void 0;
|
|
983
|
+
} catch {
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
}, k = (e) => {
|
|
987
|
+
clearTimeout(a.get(e)), a.delete(e);
|
|
988
|
+
}, A = (t) => {
|
|
989
|
+
if (a.has(t.id)) {
|
|
990
|
+
let e = O(t), r = n.get(t.id);
|
|
991
|
+
if (r && e !== void 0 && e === i.get(t.id)) return k(t.id), r;
|
|
992
|
+
k(t.id), E(t.id);
|
|
993
|
+
}
|
|
994
|
+
let r = l(t.type, e.registry), o = Xe({
|
|
956
995
|
...t,
|
|
957
996
|
vSpec: Ke(t, r)
|
|
958
997
|
});
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
998
|
+
n.set(o.id, o);
|
|
999
|
+
let s = O(t);
|
|
1000
|
+
return s === void 0 ? i.delete(o.id) : i.set(o.id, s), g(o.id), b({
|
|
1001
|
+
instance: o,
|
|
1002
|
+
instanceId: o.id,
|
|
962
1003
|
reason: "created"
|
|
963
|
-
}),
|
|
1004
|
+
}), o;
|
|
964
1005
|
};
|
|
965
|
-
e.instances?.forEach(
|
|
966
|
-
let
|
|
1006
|
+
e.instances?.forEach(A);
|
|
1007
|
+
let j = (e) => {
|
|
967
1008
|
let t = n.get(e);
|
|
968
1009
|
if (!t) throw Error(`Unknown visualization instance: ${e}`);
|
|
969
1010
|
return t;
|
|
970
|
-
},
|
|
971
|
-
let n =
|
|
972
|
-
return
|
|
1011
|
+
}, M = (t) => {
|
|
1012
|
+
let n = j(t);
|
|
1013
|
+
return Y(n, l(n.type, e.registry));
|
|
973
1014
|
};
|
|
974
1015
|
return {
|
|
975
1016
|
client: e.client,
|
|
976
1017
|
registry: e.registry,
|
|
977
|
-
createInstance:
|
|
1018
|
+
createInstance: A,
|
|
978
1019
|
updateInstance: (t, r) => {
|
|
979
|
-
let a =
|
|
1020
|
+
let a = j(t), s = Object.keys(r), c = s.length === 1 && s[0] === "vSpec", u = r.type !== void 0 && r.type !== a.type, d = r.type ?? a.type, f = l(d, e.registry), p = {
|
|
980
1021
|
...a,
|
|
981
1022
|
...r,
|
|
982
1023
|
id: t,
|
|
983
|
-
type:
|
|
984
|
-
vSpec: r.vSpec ?? (
|
|
985
|
-
},
|
|
986
|
-
...
|
|
987
|
-
vSpec: Ke(
|
|
1024
|
+
type: d,
|
|
1025
|
+
vSpec: r.vSpec ?? (u ? void 0 : a.vSpec)
|
|
1026
|
+
}, m = Xe({
|
|
1027
|
+
...p,
|
|
1028
|
+
vSpec: Ke(p, f)
|
|
988
1029
|
});
|
|
989
|
-
return n.set(t,
|
|
990
|
-
instance:
|
|
1030
|
+
return n.set(t, m), g(t), c || i.delete(t), o.get(t)?.updateInstance(m), c && x(t, m.vSpec), b({
|
|
1031
|
+
instance: m,
|
|
991
1032
|
instanceId: t,
|
|
992
|
-
reason:
|
|
993
|
-
}),
|
|
1033
|
+
reason: c ? "vspec-updated" : "updated"
|
|
1034
|
+
}), m;
|
|
994
1035
|
},
|
|
995
|
-
getInstance: (e) =>
|
|
1036
|
+
getInstance: (e) => j(e),
|
|
996
1037
|
listInstances: () => Array.from(n.values()),
|
|
997
|
-
removeInstance: (e) => {
|
|
998
|
-
if (
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1038
|
+
removeInstance: (e, t) => {
|
|
1039
|
+
if (n.has(e)) {
|
|
1040
|
+
if (t?.immediate) {
|
|
1041
|
+
k(e), E(e);
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
a.has(e) || a.set(e, setTimeout(() => {
|
|
1045
|
+
a.delete(e), E(e);
|
|
1046
|
+
}, 0));
|
|
1047
|
+
}
|
|
1004
1048
|
},
|
|
1005
|
-
validateInstanceRequirements:
|
|
1049
|
+
validateInstanceRequirements: M,
|
|
1006
1050
|
brush: (e, t) => {
|
|
1007
|
-
|
|
1051
|
+
C(e, $e(t));
|
|
1008
1052
|
},
|
|
1009
1053
|
clearBrush: (e) => {
|
|
1010
|
-
|
|
1054
|
+
C(e, []);
|
|
1011
1055
|
},
|
|
1012
|
-
mount: async (
|
|
1013
|
-
let
|
|
1014
|
-
|
|
1015
|
-
let
|
|
1016
|
-
(
|
|
1017
|
-
instanceId:
|
|
1018
|
-
size:
|
|
1019
|
-
type:
|
|
1056
|
+
mount: async (i, a) => {
|
|
1057
|
+
let u = j(a), d, h, g = M(a), b = _(i), x = s.get(i), C = c.get(a);
|
|
1058
|
+
x && S(x), C && C !== x && S(C), i.replaceChildren(), i.dataset.astratoInstanceId = u.id, i.dataset.astratoVisualizationType = u.type;
|
|
1059
|
+
let E = Q(i), O = ce(e.theme?.fontFamily, i.ownerDocument);
|
|
1060
|
+
(E.width === 0 || E.height === 0) && m.warn("[astrato-visualizations] visualization mount container has zero size", {
|
|
1061
|
+
instanceId: u.id,
|
|
1062
|
+
size: E,
|
|
1063
|
+
type: u.type
|
|
1020
1064
|
});
|
|
1021
1065
|
try {
|
|
1022
|
-
let
|
|
1066
|
+
let s, c;
|
|
1023
1067
|
for (;;) {
|
|
1024
|
-
let t =
|
|
1068
|
+
let t = j(a), o = await P({
|
|
1025
1069
|
client: e.client,
|
|
1026
1070
|
instance: t,
|
|
1027
|
-
logger:
|
|
1071
|
+
logger: m
|
|
1028
1072
|
});
|
|
1029
|
-
if (!
|
|
1030
|
-
let
|
|
1031
|
-
if (!(
|
|
1032
|
-
let
|
|
1033
|
-
|
|
1034
|
-
...
|
|
1073
|
+
if (!y(i, b) || !n.has(a)) return w(a, g);
|
|
1074
|
+
let d = j(a);
|
|
1075
|
+
if (!(d.type === t.type && d.dataBinding?.tenantId === t.dataBinding?.tenantId && d.dataBinding?.semanticLayerId === t.dataBinding?.semanticLayerId && d.dataBinding?.datasourceType === t.dataBinding?.datasourceType && d.dataBinding?.queryContext === t.dataBinding?.queryContext)) continue;
|
|
1076
|
+
let f = o.dataBinding?.fieldMetadata;
|
|
1077
|
+
u = f ? {
|
|
1078
|
+
...d,
|
|
1035
1079
|
dataBinding: {
|
|
1036
|
-
...
|
|
1080
|
+
...d.dataBinding,
|
|
1037
1081
|
fieldMetadata: {
|
|
1038
|
-
...
|
|
1039
|
-
...
|
|
1082
|
+
...f,
|
|
1083
|
+
...d.dataBinding?.fieldMetadata
|
|
1040
1084
|
}
|
|
1041
1085
|
}
|
|
1042
|
-
} :
|
|
1043
|
-
let
|
|
1044
|
-
if (
|
|
1045
|
-
if (r.get(
|
|
1046
|
-
if (await
|
|
1047
|
-
if (r.get(
|
|
1048
|
-
|
|
1086
|
+
} : d, n.set(a, u);
|
|
1087
|
+
let p = r.get(a);
|
|
1088
|
+
if (s = l(u.type, e.registry), c = await s.load(), !y(i, b) || !n.has(a)) return w(a, g);
|
|
1089
|
+
if (r.get(a) === p) {
|
|
1090
|
+
if (await z(O, i.ownerDocument), !y(i, b) || !n.has(a)) return w(a, g);
|
|
1091
|
+
if (r.get(a) === p) {
|
|
1092
|
+
u = j(a), g = M(a);
|
|
1049
1093
|
break;
|
|
1050
1094
|
}
|
|
1051
1095
|
}
|
|
1052
1096
|
}
|
|
1053
|
-
if (!
|
|
1054
|
-
|
|
1055
|
-
let
|
|
1097
|
+
if (!c.element) throw Error(`Standalone visualization module is not renderable: ${u.type}`);
|
|
1098
|
+
i.dataset.astratoInstanceId = u.id, i.dataset.astratoVisualizationType = u.type;
|
|
1099
|
+
let _ = u.groupId ?? qe, x = f.get(_), S = J({
|
|
1056
1100
|
client: e.client,
|
|
1057
1101
|
fontFamily: O,
|
|
1058
|
-
hostBrush:
|
|
1059
|
-
instance:
|
|
1060
|
-
logger:
|
|
1061
|
-
onVSpecChange: (e) => ee(
|
|
1102
|
+
hostBrush: x,
|
|
1103
|
+
instance: u,
|
|
1104
|
+
logger: m,
|
|
1105
|
+
onVSpecChange: (e) => ee(a, e),
|
|
1062
1106
|
onGroupedDimensionsChange: (e) => {
|
|
1063
|
-
|
|
1064
|
-
t.groupId ===
|
|
1107
|
+
p.set(_, e), o.forEach((t) => {
|
|
1108
|
+
t.groupId === _ && t.instanceId !== a && t.syncGroupedDimensions(e);
|
|
1065
1109
|
});
|
|
1066
1110
|
}
|
|
1067
|
-
}),
|
|
1068
|
-
|
|
1069
|
-
|
|
1111
|
+
}), C = p.get(_);
|
|
1112
|
+
C && S.syncGroupedDimensions(C), d = rt(a, t, i.ownerDocument, () => h?.(), () => m.warn("[astrato-visualizations] visualization did not report ready before the timeout", {
|
|
1113
|
+
instanceId: u.id,
|
|
1114
|
+
timeoutMs: t,
|
|
1115
|
+
type: u.type
|
|
1116
|
+
})), h = S.onVisualizationState((e) => {
|
|
1117
|
+
e === v.RENDERED ? d?.settle("rendered") : e === v.ERROR && d?.settle("error");
|
|
1070
1118
|
});
|
|
1071
1119
|
try {
|
|
1072
|
-
let e =
|
|
1073
|
-
|
|
1074
|
-
let t =
|
|
1075
|
-
container:
|
|
1120
|
+
let e = T(i, u, S, s, c.element);
|
|
1121
|
+
i.dataset.astratoMountStatus = "mounted";
|
|
1122
|
+
let t = te({
|
|
1123
|
+
container: i,
|
|
1076
1124
|
generation: b,
|
|
1077
1125
|
hostAdapter: S,
|
|
1078
|
-
instanceId:
|
|
1079
|
-
requirements:
|
|
1080
|
-
ready:
|
|
1081
|
-
settleReady:
|
|
1126
|
+
instanceId: a,
|
|
1127
|
+
requirements: g,
|
|
1128
|
+
ready: d.ready,
|
|
1129
|
+
settleReady: d.settle,
|
|
1082
1130
|
status: "mounted",
|
|
1083
1131
|
visualizationElement: e,
|
|
1084
|
-
stopFontWatch:
|
|
1085
|
-
}), n =
|
|
1086
|
-
n !==
|
|
1087
|
-
let r =
|
|
1088
|
-
return r && r !==
|
|
1132
|
+
stopFontWatch: fe(O, () => S.refreshTheme(), i.ownerDocument)
|
|
1133
|
+
}), n = f.get(_);
|
|
1134
|
+
n !== x && S.setHostBrush(n ?? []);
|
|
1135
|
+
let r = p.get(_);
|
|
1136
|
+
return r && r !== C && S.syncGroupedDimensions(r), t;
|
|
1089
1137
|
} catch (e) {
|
|
1090
|
-
throw
|
|
1138
|
+
throw d.settle("error"), S.destroy(), e;
|
|
1091
1139
|
}
|
|
1092
1140
|
} catch (e) {
|
|
1093
|
-
if (!
|
|
1094
|
-
let r =
|
|
1095
|
-
return
|
|
1141
|
+
if (!y(i, b) || !n.has(a)) return w(a, g);
|
|
1142
|
+
let r = et(e);
|
|
1143
|
+
return i.dataset.astratoMountStatus = "error", D(i, r), m.error?.("[astrato-visualizations] visualization failed to mount", {
|
|
1096
1144
|
error: e,
|
|
1097
|
-
instanceId:
|
|
1098
|
-
type:
|
|
1099
|
-
}),
|
|
1100
|
-
container:
|
|
1145
|
+
instanceId: u.id,
|
|
1146
|
+
type: u.type
|
|
1147
|
+
}), d ??= rt(a, t, i.ownerDocument, () => h?.()), d.settle("error"), te({
|
|
1148
|
+
container: i,
|
|
1101
1149
|
generation: b,
|
|
1102
|
-
instanceId:
|
|
1103
|
-
ready:
|
|
1104
|
-
requirements:
|
|
1105
|
-
settleReady:
|
|
1150
|
+
instanceId: a,
|
|
1151
|
+
ready: d.ready,
|
|
1152
|
+
requirements: g,
|
|
1153
|
+
settleReady: d.settle,
|
|
1106
1154
|
status: "error"
|
|
1107
1155
|
});
|
|
1108
1156
|
}
|
|
1109
1157
|
},
|
|
1110
1158
|
unmount: (e) => {
|
|
1111
|
-
let t =
|
|
1112
|
-
|
|
1159
|
+
let t = s.get(e);
|
|
1160
|
+
_(e), t && S(t), tt(e), u.delete(e);
|
|
1113
1161
|
},
|
|
1114
|
-
getExportQuery: async (e) =>
|
|
1115
|
-
getData: async (e, t) =>
|
|
1162
|
+
getExportQuery: async (e) => c.get(e)?.hostAdapter?.getExportQuery() ?? null,
|
|
1163
|
+
getData: async (e, t) => c.get(e)?.hostAdapter?.getData(t) ?? null,
|
|
1116
1164
|
onInstanceChange: (e, t) => {
|
|
1117
|
-
let n =
|
|
1118
|
-
return n || (n = /* @__PURE__ */ new Set(),
|
|
1119
|
-
n?.delete(t), n?.size === 0 &&
|
|
1165
|
+
let n = d.get(e);
|
|
1166
|
+
return n || (n = /* @__PURE__ */ new Set(), d.set(e, n)), n.add(t), () => {
|
|
1167
|
+
n?.delete(t), n?.size === 0 && d.delete(e);
|
|
1120
1168
|
};
|
|
1121
1169
|
}
|
|
1122
1170
|
};
|
|
1123
|
-
},
|
|
1171
|
+
}, st = (e) => {
|
|
1124
1172
|
let t = e.tagName ?? "astrato-visualization", n = e.customElementsRegistry ?? globalThis.customElements;
|
|
1125
1173
|
if (!n || n.get(t)) return;
|
|
1126
1174
|
class r extends HTMLElement {
|
|
@@ -1179,7 +1227,7 @@ var S = (e, t, n) => {
|
|
|
1179
1227
|
}
|
|
1180
1228
|
});
|
|
1181
1229
|
} catch (e) {
|
|
1182
|
-
r.unmount(this), this.dataset.astratoInstanceId = t, this.dataset.astratoMountStatus = "error",
|
|
1230
|
+
r.unmount(this), this.dataset.astratoInstanceId = t, this.dataset.astratoMountStatus = "error", D(this, e instanceof Error ? e.message : "Unknown visualization mount error.");
|
|
1183
1231
|
}
|
|
1184
1232
|
}
|
|
1185
1233
|
unmountRuntimeInstance() {
|
|
@@ -1188,4 +1236,4 @@ var S = (e, t, n) => {
|
|
|
1188
1236
|
}
|
|
1189
1237
|
n.define(t, r);
|
|
1190
1238
|
};
|
|
1191
|
-
export {
|
|
1239
|
+
export { f as createDefaultVSpec, ot as createVisualizationRuntime, m as getVisualizationRegistryEntry, d as listVisualizationRegistryEntries, st as registerAstratoElements, u as registry, p as standaloneVisualizationRegistry };
|