@milaboratories/graph-maker 1.1.150 → 1.1.151
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/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.d.ts +3 -10
- package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.js +42 -83
- package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.js.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.d.ts +1 -5
- package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.js +43 -85
- package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.js.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.d.ts +1 -3
- package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.js +73 -85
- package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.js.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts +1 -5
- package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js +51 -91
- package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/types.d.ts +0 -19
- package/dist/GraphMaker/components/DragAndDrop/types.d.ts.map +1 -1
- package/dist/GraphMaker/constantsCommon.d.ts +0 -1
- package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
- package/dist/GraphMaker/constantsCommon.js +45 -46
- package/dist/GraphMaker/constantsCommon.js.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.js +115 -145
- package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.js.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/useBaskets.d.ts.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/useBaskets.js +95 -125
- package/dist/GraphMaker/forms/DataMappingForm/useBaskets.js.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/utils.d.ts.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/utils.js +77 -153
- package/dist/GraphMaker/forms/DataMappingForm/utils.js.map +1 -1
- package/dist/GraphMaker/store.d.ts.map +1 -1
- package/dist/GraphMaker/store.js +41 -43
- package/dist/GraphMaker/store.js.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.d.ts +1 -2
- package/dist/GraphMaker/utils/loadDefaultSources.d.ts.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.js +43 -47
- package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +34 -36
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +6 -5
- package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +146 -149
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +165 -218
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +95 -102
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +145 -156
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js +68 -75
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +154 -159
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +48 -55
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +114 -122
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +111 -119
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +4 -4
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +70 -69
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js +2 -2
- package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +183 -187
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,69 +1,52 @@
|
|
|
1
|
+
import { DISCRETE_VALUES_KEY as E, HIGH_CARDINALITY as D } from "../constants.js";
|
|
2
|
+
import { AxisId as b, columnOrAxisIdFromString as A } from "../spec.js";
|
|
3
|
+
import { getStateCopy as k, getDefaultInfo as O, dataColumnPredicateDefault as B, createLinkerMap as P, createMultipliesByMap as j, getColumnOrAxisValueLabelsId as M } from "../utils.js";
|
|
1
4
|
import "../node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js";
|
|
2
5
|
import "../node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js";
|
|
3
6
|
import "../_virtual/canonicalize.js";
|
|
4
7
|
import "../node_modules/@milaboratories/pl-model-common/dist/plid.js";
|
|
5
8
|
import "../node_modules/@milaboratories/pl-model-common/dist/ref.js";
|
|
6
|
-
import { deriveLabels as
|
|
9
|
+
import { deriveLabels as H } from "../node_modules/@platforma-sdk/model/dist/render/util/label.js";
|
|
7
10
|
import "../node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { getStateCopy as D, addSourceInfoToMap as U, getDefaultInfo as j, dataColumnPredicateDefault as $, createLinkerMap as q, getColumnOrAxisValueLabelsId as G } from "../utils.js";
|
|
11
|
-
var H = Object.defineProperty, N = (b, e, t) => e in b ? H(b, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : b[e] = t, F = (b, e, t) => N(b, typeof e != "symbol" ? e + "" : e, t);
|
|
12
|
-
class ee {
|
|
11
|
+
var F = Object.defineProperty, V = (h, e, t) => e in h ? F(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t, x = (h, e, t) => V(h, typeof e != "symbol" ? e + "" : e, t);
|
|
12
|
+
class T {
|
|
13
13
|
constructor(e, t) {
|
|
14
|
-
|
|
14
|
+
x(this, "ignoredOptionIdNames", []), x(this, "dataInputs", []), x(this, "dontAllowUnfilteredHighCardinality", !1), x(this, "allowHangingAxes", !1), this.simpleComponentControllers = e, this.filterComponentControllers = t;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
const e = [];
|
|
18
|
-
for (const t of Object.keys(this.simpleComponentControllers))
|
|
19
|
-
this.simpleComponentControllers[t].isRequired && e.push(t);
|
|
20
|
-
return e;
|
|
21
|
-
}
|
|
22
|
-
get dimensionsConsumerComponents() {
|
|
23
|
-
const e = [];
|
|
24
|
-
for (const t of Object.keys(this.simpleComponentControllers))
|
|
25
|
-
this.simpleComponentControllers[t].isDimensionsConsumer && e.push(t);
|
|
26
|
-
for (const t of Object.keys(this.filterComponentControllers))
|
|
27
|
-
this.filterComponentControllers[t].isDimensionsConsumer && e.push(t);
|
|
28
|
-
return e;
|
|
29
|
-
}
|
|
30
|
-
addSelected(e, t, n) {
|
|
16
|
+
addSelected(e, t, o) {
|
|
31
17
|
if (e in this.simpleComponentControllers)
|
|
32
|
-
return this.simpleComponentControllers[e].addSelected(t,
|
|
18
|
+
return this.simpleComponentControllers[e].addSelected(t, o);
|
|
33
19
|
if (e in this.filterComponentControllers)
|
|
34
|
-
return this.filterComponentControllers[e].addSelected(t,
|
|
20
|
+
return this.filterComponentControllers[e].addSelected(t, o);
|
|
35
21
|
throw Error(`Unknown input name: ${String(e)}`);
|
|
36
22
|
}
|
|
37
|
-
deleteSelected(e, t,
|
|
23
|
+
deleteSelected(e, t, o, n) {
|
|
38
24
|
if (e in this.simpleComponentControllers)
|
|
39
|
-
return this.simpleComponentControllers[e].deleteSelected(
|
|
25
|
+
return this.simpleComponentControllers[e].deleteSelected(o, n.selectedSource);
|
|
40
26
|
if (e in this.filterComponentControllers)
|
|
41
|
-
return this.filterComponentControllers[e].deleteSelected(
|
|
27
|
+
return this.filterComponentControllers[e].deleteSelected(o, n.selectedSource);
|
|
42
28
|
throw Error(`Unknown input name: ${String(e)}`);
|
|
43
29
|
}
|
|
44
|
-
changeSelected(e, t,
|
|
45
|
-
const s =
|
|
46
|
-
let
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
}),
|
|
52
|
-
(r) =>
|
|
53
|
-
(
|
|
30
|
+
changeSelected(e, t, o, n) {
|
|
31
|
+
const s = o.components[e].selectorStates, c = s.filter((r) => !n.find((l) => l.selectedSource === r.selectedSource)), u = n.filter((r) => !s.find((l) => l.selectedSource === r.selectedSource));
|
|
32
|
+
let p = k(o);
|
|
33
|
+
return c.forEach((r) => {
|
|
34
|
+
p = this.deleteSelected(e, t, p, r);
|
|
35
|
+
}), u.forEach((r) => {
|
|
36
|
+
p = this.addSelected(e, p, r);
|
|
37
|
+
}), o.components[e].selectorStates = n.map(
|
|
38
|
+
(r) => o.components[e].selectorStates.find(
|
|
39
|
+
(l) => l.selectedSource === r.selectedSource
|
|
54
40
|
)
|
|
55
|
-
).filter(Boolean),
|
|
41
|
+
).filter(Boolean), p;
|
|
56
42
|
}
|
|
57
43
|
switchDividableAxis(e, t) {
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
async getMustBeConsumedAxes(e, t) {
|
|
61
|
-
return Promise.resolve(/* @__PURE__ */ new Set());
|
|
44
|
+
return k(e);
|
|
62
45
|
}
|
|
63
46
|
createEmptyComponentsGuide(e) {
|
|
64
47
|
return Object.fromEntries(
|
|
65
48
|
Object.entries(e.components).map(
|
|
66
|
-
([t,
|
|
49
|
+
([t, o]) => [
|
|
67
50
|
t,
|
|
68
51
|
{
|
|
69
52
|
options: [],
|
|
@@ -76,165 +59,148 @@ class ee {
|
|
|
76
59
|
)
|
|
77
60
|
);
|
|
78
61
|
}
|
|
79
|
-
async getSelectedSourcesInfo(e, t, n, o) {
|
|
80
|
-
const s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), C = [];
|
|
81
|
-
for (const a of this.dataInputs)
|
|
82
|
-
for (const r of t.components[a].selectorStates) {
|
|
83
|
-
const p = k(r.selectedSource);
|
|
84
|
-
if (L(p)) {
|
|
85
|
-
const i = await e.pFrameProvider.getColumnSpecById(p);
|
|
86
|
-
i && i.axesSpec.forEach((c) => {
|
|
87
|
-
const d = A.fromAxisSpec(c).toCanonicalString();
|
|
88
|
-
l.has(d) || (l.add(d), C.push(c));
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
for (const [a, { selectorStates: r }] of Object.entries(t.components)) {
|
|
93
|
-
const p = (this.simpleComponentControllers[a] ?? this.filterComponentControllers[a]).settings.columnsWithExtraAxesAllowed;
|
|
94
|
-
for (const { selectedSource: i } of r)
|
|
95
|
-
await U(
|
|
96
|
-
e,
|
|
97
|
-
i,
|
|
98
|
-
n[i],
|
|
99
|
-
s,
|
|
100
|
-
C,
|
|
101
|
-
l,
|
|
102
|
-
p,
|
|
103
|
-
o
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
return s;
|
|
107
|
-
}
|
|
108
62
|
getEmptyInputGuide(e) {
|
|
109
63
|
return {
|
|
110
64
|
components: this.createEmptyComponentsGuide(e),
|
|
111
|
-
getSourceInfo: (t) =>
|
|
112
|
-
|
|
113
|
-
axesToBeFixedSet: /* @__PURE__ */ new Set(),
|
|
65
|
+
getSourceInfo: (t) => O(t),
|
|
66
|
+
fullOptionsSet: /* @__PURE__ */ new Set(),
|
|
114
67
|
readyData: !1,
|
|
115
68
|
ready: !1,
|
|
116
69
|
consistent: !0
|
|
117
70
|
};
|
|
118
71
|
}
|
|
119
72
|
getConsumedOptionsSet(e) {
|
|
120
|
-
const t =
|
|
121
|
-
for (const n of this.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
73
|
+
const t = [];
|
|
74
|
+
for (const n of Object.keys(this.simpleComponentControllers))
|
|
75
|
+
this.simpleComponentControllers[n].isDimensionsConsumer && t.push(n);
|
|
76
|
+
for (const n of Object.keys(this.filterComponentControllers))
|
|
77
|
+
this.filterComponentControllers[n].isDimensionsConsumer && t.push(n);
|
|
78
|
+
const o = /* @__PURE__ */ new Set();
|
|
79
|
+
for (const n of t)
|
|
80
|
+
for (const { selectedSource: s } of e.components[n].selectorStates)
|
|
81
|
+
o.add(s);
|
|
82
|
+
return o;
|
|
125
83
|
}
|
|
126
|
-
async
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return
|
|
135
|
-
const l = new T({ name: s.value.columnId, type: s.value.spec.valueType }).toCanonicalString();
|
|
136
|
-
return o[l] = s.label, o;
|
|
137
|
-
}, {});
|
|
84
|
+
async getParentAndHangingAxesByInputs(e, t, o, n) {
|
|
85
|
+
const s = { ...this.simpleComponentControllers, ...this.filterComponentControllers }, c = {};
|
|
86
|
+
for (const [u, p] of Object.entries(s))
|
|
87
|
+
c[u] = await p.getParentAndHangingAxes(e, t, o, n);
|
|
88
|
+
return c;
|
|
89
|
+
}
|
|
90
|
+
/** Depends on chart type. */
|
|
91
|
+
getMustBeConsumedAxes(e, t) {
|
|
92
|
+
return /* @__PURE__ */ new Set();
|
|
138
93
|
}
|
|
139
|
-
|
|
94
|
+
/** Axes that go to the "Drag to build the chart" section.
|
|
95
|
+
* If some of them is not moved to 'filters', 'tabBy' or 'facetBy' (dimension reducers) chart can't be rendered */
|
|
96
|
+
markMustBeConsumedAxes(e, t, o, n) {
|
|
140
97
|
var s;
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
h.add(v.value);
|
|
155
|
-
});
|
|
156
|
-
for (const [v, S] of m.optionsInfo)
|
|
157
|
-
d.set(v, S);
|
|
158
|
-
l[u] = m;
|
|
98
|
+
const c = this.getConsumedOptionsSet(e), u = (r) => {
|
|
99
|
+
const l = t.get(r);
|
|
100
|
+
l && l.kind === "axis" && (l.mustBeConsumed = !0);
|
|
101
|
+
}, p = this.getMustBeConsumedAxes(e, t);
|
|
102
|
+
for (const r of p)
|
|
103
|
+
c.has(r) || u(r);
|
|
104
|
+
this.allowHangingAxes || Object.entries(n).forEach(([r, { hangingAxes: l }]) => {
|
|
105
|
+
for (const i of l.keys())
|
|
106
|
+
c.has(i) || u(i);
|
|
107
|
+
});
|
|
108
|
+
for (const r of o) {
|
|
109
|
+
const l = t.get(r);
|
|
110
|
+
(l == null ? void 0 : l.kind) === "axis" && l.isNonHomogenous && !c.has(r) && u(r);
|
|
159
111
|
}
|
|
160
|
-
const y = (u) => {
|
|
161
|
-
const f = d.get(u);
|
|
162
|
-
f && f.kind === "axis" && (f.mustBeConsumed = !0);
|
|
163
|
-
const m = c.get(u);
|
|
164
|
-
m && m.kind === "axis" && (m.mustBeConsumed = !0);
|
|
165
|
-
}, E = await this.getMustBeConsumedAxes(e, t);
|
|
166
|
-
for (const u of E)
|
|
167
|
-
y(u);
|
|
168
112
|
if (this.dontAllowUnfilteredHighCardinality) {
|
|
169
|
-
const
|
|
170
|
-
var
|
|
171
|
-
return ((
|
|
172
|
-
},
|
|
173
|
-
const
|
|
174
|
-
return (
|
|
113
|
+
const r = (i) => {
|
|
114
|
+
var m;
|
|
115
|
+
return ((m = i == null ? void 0 : i.annotations) == null ? void 0 : m[D]) === "true";
|
|
116
|
+
}, l = ((s = e.components.filters) == null ? void 0 : s.selectorStates.reduce((i, m) => {
|
|
117
|
+
const a = t.get(m.selectedSource);
|
|
118
|
+
return (a == null ? void 0 : a.kind) === "column" && a.spec.axesSpec.filter(r).forEach((d) => i.add(b.fromAxisSpec(d).toCanonicalString())), (a == null ? void 0 : a.kind) === "axis" && r(a.spec) && i.add(b.fromAxisSpec(a.spec).toCanonicalString()), i;
|
|
175
119
|
}, /* @__PURE__ */ new Set())) ?? /* @__PURE__ */ new Set();
|
|
176
|
-
this.dataInputs.forEach((
|
|
177
|
-
for (const { selectedSource:
|
|
178
|
-
const
|
|
179
|
-
if ((
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
}), (
|
|
183
|
-
const
|
|
184
|
-
|
|
120
|
+
this.dataInputs.forEach((i) => {
|
|
121
|
+
for (const { selectedSource: m } of e.components[i].selectorStates) {
|
|
122
|
+
const a = t.get(m);
|
|
123
|
+
if ((a == null ? void 0 : a.kind) === "column" && a.spec.axesSpec.filter(r).forEach((d) => {
|
|
124
|
+
const f = b.fromAxisSpec(d).toCanonicalString();
|
|
125
|
+
l.has(f) || u(f);
|
|
126
|
+
}), (a == null ? void 0 : a.kind) === "axis" && r(a.spec)) {
|
|
127
|
+
const d = b.fromAxisSpec(a.spec).toCanonicalString();
|
|
128
|
+
l.has(d) || u(d);
|
|
185
129
|
}
|
|
186
130
|
}
|
|
187
131
|
});
|
|
188
132
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
133
|
+
}
|
|
134
|
+
setColumnLabels(e, t) {
|
|
135
|
+
const o = [...e].filter((s) => {
|
|
136
|
+
var c;
|
|
137
|
+
return ((c = t.get(s)) == null ? void 0 : c.kind) === "column";
|
|
138
|
+
}), n = H(o, (s) => t.get(s).spec);
|
|
139
|
+
o.forEach((s, c) => {
|
|
140
|
+
t.get(s).label = n[c].label;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/** Calculates information for data-mapping interface:
|
|
144
|
+
* options for every input (basket),
|
|
145
|
+
* information for every option (label, value type, must be consumed etc),
|
|
146
|
+
* information about full data-mapping state (ready to data loading and rendering or not, contains inconsistency or not) */
|
|
147
|
+
async calculateOptions(e, t, o = [], n = B) {
|
|
148
|
+
const s = this.createEmptyComponentsGuide(t), c = new Set(this.ignoredOptionIdNames), u = new Set(o), p = await P(e), r = await j(e), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), m = await this.getParentAndHangingAxesByInputs(e, t, p, r), a = { ...this.simpleComponentControllers, ...this.filterComponentControllers };
|
|
149
|
+
for (const [C, y] of Object.entries(a)) {
|
|
150
|
+
const S = await y.getOptions(
|
|
151
|
+
e,
|
|
152
|
+
t,
|
|
153
|
+
p,
|
|
154
|
+
r,
|
|
155
|
+
m,
|
|
156
|
+
n,
|
|
157
|
+
c,
|
|
158
|
+
u
|
|
159
|
+
);
|
|
160
|
+
for (const g of S.options)
|
|
161
|
+
i.add(g.value);
|
|
162
|
+
for (const g of S.optionsInfo)
|
|
163
|
+
l.set(...g);
|
|
164
|
+
s[C] = S;
|
|
165
|
+
}
|
|
166
|
+
this.markMustBeConsumedAxes(t, l, i, m), this.setColumnLabels(i, l);
|
|
167
|
+
const d = this.isConsistent(t, s), f = (C) => l.get(C) ?? O(C);
|
|
201
168
|
return {
|
|
202
|
-
components:
|
|
203
|
-
getSourceInfo:
|
|
204
|
-
|
|
205
|
-
axesToBeFixedSet: x,
|
|
169
|
+
components: s,
|
|
170
|
+
getSourceInfo: f,
|
|
171
|
+
fullOptionsSet: i,
|
|
206
172
|
readyData: this.readyDataInputs(t),
|
|
207
|
-
ready: this.readyForPlotBuilding(
|
|
208
|
-
consistent:
|
|
173
|
+
ready: this.readyForPlotBuilding(t, d, i, f),
|
|
174
|
+
consistent: d
|
|
209
175
|
};
|
|
210
176
|
}
|
|
211
|
-
async getUniqueSourceValuesWithLabels(e, t,
|
|
212
|
-
var
|
|
213
|
-
const
|
|
177
|
+
async getUniqueSourceValuesWithLabels(e, t, o, n, s, c) {
|
|
178
|
+
var u;
|
|
179
|
+
const p = (i) => i.sort((m, a) => m.label.localeCompare(a.label, "en", { numeric: !0 })), r = t.getSourceInfo(o), l = (u = r.annotations) == null ? void 0 : u[E];
|
|
214
180
|
try {
|
|
215
|
-
const i =
|
|
181
|
+
const i = l ? JSON.parse(l).map((m) => String(m)) : null;
|
|
216
182
|
if (i) {
|
|
217
|
-
const
|
|
218
|
-
return
|
|
183
|
+
const m = i.map((a) => ({ value: a, label: a }));
|
|
184
|
+
return p(m), { values: m, overflow: !1 };
|
|
219
185
|
}
|
|
220
186
|
} catch {
|
|
221
|
-
console.error(`Parsing error: discrete values annotation ${
|
|
187
|
+
console.error(`Parsing error: discrete values annotation ${l} in ${o}`);
|
|
222
188
|
}
|
|
223
189
|
if (r.kind === "axis") {
|
|
224
|
-
const i =
|
|
225
|
-
let
|
|
226
|
-
if (
|
|
227
|
-
s && (
|
|
190
|
+
const i = A(o), m = r.parentSources.map(A), a = await M(e, o, r.parentSources);
|
|
191
|
+
let d = [];
|
|
192
|
+
if (a) {
|
|
193
|
+
s && (d = [{
|
|
228
194
|
type: "bySingleColumnV2",
|
|
229
195
|
column: {
|
|
230
196
|
type: "column",
|
|
231
|
-
id:
|
|
197
|
+
id: a.name
|
|
232
198
|
},
|
|
233
199
|
predicate: {
|
|
234
200
|
operator: "StringIContains",
|
|
235
201
|
substring: s
|
|
236
202
|
}
|
|
237
|
-
}]),
|
|
203
|
+
}]), c && (d = [{
|
|
238
204
|
type: "bySingleColumnV2",
|
|
239
205
|
column: {
|
|
240
206
|
type: "axis",
|
|
@@ -242,16 +208,16 @@ class ee {
|
|
|
242
208
|
},
|
|
243
209
|
predicate: {
|
|
244
210
|
operator: "StringIContains",
|
|
245
|
-
substring:
|
|
211
|
+
substring: c
|
|
246
212
|
}
|
|
247
213
|
}]);
|
|
248
|
-
const { data:
|
|
249
|
-
for (let
|
|
250
|
-
|
|
251
|
-
return
|
|
214
|
+
const { data: S, axesData: g } = await e.pFrameProvider.getSingleColumnData(a, d), v = g[i.toCanonicalString()], I = [];
|
|
215
|
+
for (let w = 0; w < Math.min(v.length, n ?? v.length); w++)
|
|
216
|
+
I.push({ value: String(v[w]), label: String(S[w]) });
|
|
217
|
+
return p(I), { values: I, overflow: !(n === void 0 || v.length < n) };
|
|
252
218
|
}
|
|
253
|
-
const
|
|
254
|
-
|
|
219
|
+
const f = s ?? c;
|
|
220
|
+
f && (d = [{
|
|
255
221
|
type: "bySingleColumnV2",
|
|
256
222
|
column: {
|
|
257
223
|
type: "axis",
|
|
@@ -259,81 +225,62 @@ class ee {
|
|
|
259
225
|
},
|
|
260
226
|
predicate: {
|
|
261
227
|
operator: "StringIContains",
|
|
262
|
-
substring:
|
|
228
|
+
substring: f
|
|
263
229
|
}
|
|
264
230
|
}]);
|
|
265
|
-
const
|
|
266
|
-
return
|
|
231
|
+
const C = await e.pFrameProvider.getAxisUniqueValues(i, [m[0]], n, d), y = C.values.map((S) => ({ value: String(S), label: String(S) }));
|
|
232
|
+
return p(y), { values: y, overflow: C.overflow };
|
|
267
233
|
}
|
|
268
234
|
if (r.kind === "column") {
|
|
269
|
-
const i = s ??
|
|
235
|
+
const i = s ?? c, m = A(o), a = i ? [{
|
|
270
236
|
type: "bySingleColumnV2",
|
|
271
237
|
column: {
|
|
272
238
|
type: "column",
|
|
273
|
-
id:
|
|
239
|
+
id: m.name
|
|
274
240
|
},
|
|
275
241
|
predicate: {
|
|
276
242
|
operator: "StringIContains",
|
|
277
243
|
substring: i
|
|
278
244
|
}
|
|
279
|
-
}] : [],
|
|
280
|
-
return
|
|
245
|
+
}] : [], d = await e.pFrameProvider.getColumnUniqueValues(m, n, a), f = d.values.map((C) => ({ value: String(C), label: String(C) }));
|
|
246
|
+
return p(f), { values: f, overflow: d.overflow };
|
|
281
247
|
}
|
|
282
248
|
return { values: [], overflow: !1 };
|
|
283
249
|
}
|
|
284
|
-
|
|
285
|
-
const o = /* @__PURE__ */ new Map();
|
|
286
|
-
for (const s of Object.keys(
|
|
250
|
+
checkStateConsistency(e, t) {
|
|
251
|
+
const o = /* @__PURE__ */ new Map(), n = { ...this.simpleComponentControllers, ...this.filterComponentControllers };
|
|
252
|
+
for (const s of Object.keys(n))
|
|
287
253
|
o.set(
|
|
288
254
|
s,
|
|
289
|
-
|
|
290
|
-
);
|
|
291
|
-
for (const s of Object.keys(this.filterComponentControllers))
|
|
292
|
-
o.set(
|
|
293
|
-
s,
|
|
294
|
-
await this.filterComponentControllers[s].checkStateConsistency(e, t, n)
|
|
255
|
+
n[s].checkStateConsistency(e, t[s].options)
|
|
295
256
|
);
|
|
296
257
|
return o;
|
|
297
258
|
}
|
|
298
|
-
|
|
299
|
-
const o =
|
|
300
|
-
for (const
|
|
301
|
-
if (Object.values(
|
|
259
|
+
isConsistent(e, t) {
|
|
260
|
+
const o = this.checkStateConsistency(e, t);
|
|
261
|
+
for (const n of o.values())
|
|
262
|
+
if (Object.values(n).some((s) => !s))
|
|
302
263
|
return !1;
|
|
303
264
|
return !0;
|
|
304
265
|
}
|
|
305
266
|
readyDataInputs(e) {
|
|
306
267
|
return this.dataInputs.every((t) => e.components[t].selectorStates.length > 0);
|
|
307
268
|
}
|
|
308
|
-
readyForPlotBuilding(e, t,
|
|
309
|
-
if (!
|
|
269
|
+
readyForPlotBuilding(e, t, o, n) {
|
|
270
|
+
if (!t || !this.readyDataInputs(e))
|
|
310
271
|
return !1;
|
|
311
|
-
let
|
|
312
|
-
for (const
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
|
|
272
|
+
let s = !1;
|
|
273
|
+
for (const u of o) {
|
|
274
|
+
const p = n(u);
|
|
275
|
+
if (p && p.kind === "axis" && p.mustBeConsumed) {
|
|
276
|
+
s = !0;
|
|
316
277
|
break;
|
|
317
278
|
}
|
|
318
279
|
}
|
|
319
|
-
|
|
320
|
-
for (const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (i && i.kind === "column" && i.axesToBeFixed.some(
|
|
324
|
-
(c) => {
|
|
325
|
-
var d;
|
|
326
|
-
return ((d = (p ?? []).find((g) => g.axisSource === c)) == null ? void 0 : d.axisValue) === void 0;
|
|
327
|
-
}
|
|
328
|
-
)) {
|
|
329
|
-
C = !0;
|
|
330
|
-
break;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
if (C)
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
336
|
-
return this.requiredComponents.every((a) => t.components[a].selectorStates.length > 0) && !l && !C;
|
|
280
|
+
const c = [];
|
|
281
|
+
for (const u of Object.keys(this.simpleComponentControllers))
|
|
282
|
+
this.simpleComponentControllers[u].isRequired && c.push(u);
|
|
283
|
+
return c.every((u) => e.components[u].selectorStates.length > 0) && !s;
|
|
337
284
|
}
|
|
338
285
|
async createDataForPlot(e, t) {
|
|
339
286
|
return {
|
|
@@ -343,6 +290,6 @@ class ee {
|
|
|
343
290
|
}
|
|
344
291
|
}
|
|
345
292
|
export {
|
|
346
|
-
|
|
293
|
+
T as ControllerBase
|
|
347
294
|
};
|
|
348
295
|
//# sourceMappingURL=ControllerBase.js.map
|