@milaboratories/graph-maker 1.1.139 → 1.1.141
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/Chart.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/Chart.vue.js +1 -0
- package/dist/GraphMaker/components/Chart.vue.js.map +1 -1
- package/dist/GraphMaker/dataBindAes.d.ts +5 -5
- package/dist/GraphMaker/dataBindAes.d.ts.map +1 -1
- package/dist/GraphMaker/dataBindAes.js +52 -49
- package/dist/GraphMaker/dataBindAes.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js +14 -14
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js.map +1 -1
- package/dist/GraphMaker/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/index.vue.js +115 -113
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/store.js +9 -9
- package/dist/GraphMaker/types.d.ts +1 -1
- package/dist/GraphMaker/types.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +3 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts +4 -8
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +2 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +5 -5
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +7 -7
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +9 -9
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +20 -16
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +65 -69
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +20 -16
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +20 -19
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.js +4 -3
- 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 +57 -54
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -5
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js +5 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +8 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +22 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.js +4 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +53 -53
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +6 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +45 -45
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +71 -70
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +117 -112
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +6 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js +36 -36
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +24 -24
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js +23 -26
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +13 -10
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +67 -73
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +44 -39
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js +18 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js +68 -64
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +23 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +23 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js +7 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/_commonjsHelpers.js +9 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/canonicalize.js +8 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/canonicalize.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/lodash.js +8 -0
- package/dist/{_virtual → node_modules/@milaboratories/pf-plots/dist/_virtual}/lodash.js.map +1 -1
- package/dist/{_virtual/lodash.js → node_modules/@milaboratories/pf-plots/dist/_virtual/lodash2.js} +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/lodash2.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/stringify.js +3 -0
- package/dist/{_virtual → node_modules/@milaboratories/pf-plots/dist/_virtual}/stringify.js.map +1 -1
- package/dist/{_virtual/stringify.js → node_modules/@milaboratories/pf-plots/dist/_virtual/stringify2.js} +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/stringify2.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +15 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +198 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +342 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +278 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +453 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js +203 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +432 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +170 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +315 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +323 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/demoStore.js +11 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/demoStore.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +36 -3420
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/{pl-error-like → pf-plots/dist/node_modules/@milaboratories/pl-error-like}/dist/index.js +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +979 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js +1599 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/canonicalize/lib/canonicalize.js +19 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/canonicalize/lib/canonicalize.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/json-stringify-safe/stringify.js +26 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/json-stringify-safe/stringify.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/lodash/lodash.js +3678 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/lodash/lodash.js.map +1 -0
- package/dist/node_modules/{zod → @milaboratories/pf-plots/dist/node_modules/zod}/lib/index.js +1141 -1141
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/zod/lib/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +247 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js +62 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +286 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -0
- package/package.json +3 -3
- package/dist/node_modules/@milaboratories/pl-error-like/dist/index.js.map +0 -1
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +0 -584
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +0 -1
- package/dist/node_modules/@platforma-sdk/model/dist/index.js +0 -1559
- package/dist/node_modules/@platforma-sdk/model/dist/index.js.map +0 -1
- package/dist/node_modules/json-stringify-safe/stringify.js +0 -20
- package/dist/node_modules/json-stringify-safe/stringify.js.map +0 -1
- package/dist/node_modules/lodash/lodash.js +0 -3678
- package/dist/node_modules/lodash/lodash.js.map +0 -1
- package/dist/node_modules/zod/lib/index.js.map +0 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { deriveLabels as P } from "../node_modules/@platforma-sdk/model/dist/index.js";
|
|
2
|
+
import { DISCRETE_VALUES_KEY as M, HIGH_CARDINALITY as V } from "../constants.js";
|
|
3
|
+
import { columnOrAxisIdFromString as k, isColumnId as L, AxisId as A, ColumnId as T } from "../spec.js";
|
|
4
|
+
import { getStateCopy as D, addSourceInfoToMap as U, getDefaultInfo as j, dataColumnPredicateDefault as q, createLinkerMap as $, getColumnOrAxisValueLabelsId as G } from "../utils.js";
|
|
5
|
+
var N = Object.defineProperty, H = (b, e, t) => e in b ? N(b, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : b[e] = t, F = (b, e, t) => H(b, typeof e != "symbol" ? e + "" : e, t);
|
|
6
|
+
class z {
|
|
7
|
+
constructor(e, t) {
|
|
8
|
+
F(this, "ignoredOptionIdNames", []), F(this, "dataInputs", []), F(this, "dontAllowUnfilteredHighCardinality", !1), this.simpleComponentControllers = e, this.filterComponentControllers = t;
|
|
9
|
+
}
|
|
10
|
+
get requiredComponents() {
|
|
11
|
+
const e = [];
|
|
12
|
+
for (const t of Object.keys(this.simpleComponentControllers))
|
|
13
|
+
this.simpleComponentControllers[t].isRequired && e.push(t);
|
|
14
|
+
return e;
|
|
15
|
+
}
|
|
16
|
+
get dimensionsConsumerComponents() {
|
|
17
|
+
const e = [];
|
|
18
|
+
for (const t of Object.keys(this.simpleComponentControllers))
|
|
19
|
+
this.simpleComponentControllers[t].isDimensionsConsumer && e.push(t);
|
|
20
|
+
for (const t of Object.keys(this.filterComponentControllers))
|
|
21
|
+
this.filterComponentControllers[t].isDimensionsConsumer && e.push(t);
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
addSelected(e, t, n) {
|
|
25
|
+
if (e in this.simpleComponentControllers)
|
|
26
|
+
return this.simpleComponentControllers[e].addSelected(t, n);
|
|
27
|
+
if (e in this.filterComponentControllers)
|
|
28
|
+
return this.filterComponentControllers[e].addSelected(t, n);
|
|
29
|
+
throw Error(`Unknown input name: ${String(e)}`);
|
|
30
|
+
}
|
|
31
|
+
deleteSelected(e, t, n, o) {
|
|
32
|
+
if (e in this.simpleComponentControllers)
|
|
33
|
+
return this.simpleComponentControllers[e].deleteSelected(n, o.selectedSource);
|
|
34
|
+
if (e in this.filterComponentControllers)
|
|
35
|
+
return this.filterComponentControllers[e].deleteSelected(n, o.selectedSource);
|
|
36
|
+
throw Error(`Unknown input name: ${String(e)}`);
|
|
37
|
+
}
|
|
38
|
+
changeSelected(e, t, n, o) {
|
|
39
|
+
const s = n.components[e].selectorStates, l = s.filter((r) => !o.find((d) => d.selectedSource === r.selectedSource)), C = o.filter((r) => !s.find((d) => d.selectedSource === r.selectedSource));
|
|
40
|
+
let i = D(n);
|
|
41
|
+
return l.forEach((r) => {
|
|
42
|
+
i = this.deleteSelected(e, t, i, r);
|
|
43
|
+
}), C.forEach((r) => {
|
|
44
|
+
i = this.addSelected(e, i, r);
|
|
45
|
+
}), n.components[e].selectorStates = o.map(
|
|
46
|
+
(r) => n.components[e].selectorStates.find(
|
|
47
|
+
(d) => d.selectedSource === r.selectedSource
|
|
48
|
+
)
|
|
49
|
+
).filter(Boolean), i;
|
|
50
|
+
}
|
|
51
|
+
switchDividableAxis(e, t) {
|
|
52
|
+
return D(e);
|
|
53
|
+
}
|
|
54
|
+
async getMustBeConsumedAxes(e, t) {
|
|
55
|
+
return Promise.resolve(/* @__PURE__ */ new Set());
|
|
56
|
+
}
|
|
57
|
+
createEmptyComponentsGuide(e) {
|
|
58
|
+
return Object.fromEntries(
|
|
59
|
+
Object.entries(e.components).map(
|
|
60
|
+
([t, n]) => [
|
|
61
|
+
t,
|
|
62
|
+
{
|
|
63
|
+
options: [],
|
|
64
|
+
optionsInfo: /* @__PURE__ */ new Map(),
|
|
65
|
+
stateConsistency: {},
|
|
66
|
+
required: !1,
|
|
67
|
+
multipleSelectors: !1
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
async getSelectedSourcesInfo(e, t, n, o) {
|
|
74
|
+
const s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), C = [];
|
|
75
|
+
for (const i of this.dataInputs)
|
|
76
|
+
for (const r of t.components[i].selectorStates) {
|
|
77
|
+
const d = k(r.selectedSource);
|
|
78
|
+
if (L(d)) {
|
|
79
|
+
const a = await e.pFrameProvider.getColumnSpecById(d);
|
|
80
|
+
a && a.axesSpec.forEach((c) => {
|
|
81
|
+
const p = A.fromAxisSpec(c).toCanonicalString();
|
|
82
|
+
l.has(p) || (l.add(p), C.push(c));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
for (const [i, { selectorStates: r }] of Object.entries(t.components)) {
|
|
87
|
+
const d = (this.simpleComponentControllers[i] ?? this.filterComponentControllers[i]).settings.columnsWithExtraAxesAllowed;
|
|
88
|
+
for (const { selectedSource: a } of r)
|
|
89
|
+
await U(
|
|
90
|
+
e,
|
|
91
|
+
a,
|
|
92
|
+
n[a],
|
|
93
|
+
s,
|
|
94
|
+
C,
|
|
95
|
+
l,
|
|
96
|
+
d,
|
|
97
|
+
o
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return s;
|
|
101
|
+
}
|
|
102
|
+
getEmptyInputGuide(e) {
|
|
103
|
+
return {
|
|
104
|
+
components: this.createEmptyComponentsGuide(e),
|
|
105
|
+
getSourceInfo: (t) => j(t),
|
|
106
|
+
freeOptionsSet: /* @__PURE__ */ new Set(),
|
|
107
|
+
axesToBeFixedSet: /* @__PURE__ */ new Set(),
|
|
108
|
+
readyData: !1,
|
|
109
|
+
ready: !1,
|
|
110
|
+
consistent: !0
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
getConsumedOptionsSet(e) {
|
|
114
|
+
const t = /* @__PURE__ */ new Set();
|
|
115
|
+
for (const n of this.dimensionsConsumerComponents)
|
|
116
|
+
for (const { selectedSource: o } of e.components[n].selectorStates)
|
|
117
|
+
t.add(o);
|
|
118
|
+
return t;
|
|
119
|
+
}
|
|
120
|
+
async getLabelsMap(e, t) {
|
|
121
|
+
const n = await e.pFrameProvider.getColumnsFull(
|
|
122
|
+
this.dataInputs.reduce((o, s) => {
|
|
123
|
+
const l = t.components[s].selectorStates.map((C) => k(C.selectedSource));
|
|
124
|
+
return o.concat(l);
|
|
125
|
+
}, []),
|
|
126
|
+
!1
|
|
127
|
+
);
|
|
128
|
+
return P(n, (o) => o.spec).reduce((o, s) => {
|
|
129
|
+
const l = new T({ name: s.value.columnId, type: s.value.spec.valueType }).toCanonicalString();
|
|
130
|
+
return o[l] = s.label, o;
|
|
131
|
+
}, {});
|
|
132
|
+
}
|
|
133
|
+
async calculateOptions(e, t, n = [], o = q) {
|
|
134
|
+
var s;
|
|
135
|
+
const l = this.createEmptyComponentsGuide(t), C = this.getConsumedOptionsSet(t), i = new Set(this.ignoredOptionIdNames), r = new Set(n), d = await $(e), a = await this.getLabelsMap(e, t), c = await this.getSelectedSourcesInfo(e, t, a, d), p = /* @__PURE__ */ new Map(), g = { ...this.simpleComponentControllers, ...this.filterComponentControllers }, h = /* @__PURE__ */ new Set();
|
|
136
|
+
for (const [u, f] of Object.entries(g)) {
|
|
137
|
+
const m = await f.getOptions(
|
|
138
|
+
e,
|
|
139
|
+
t,
|
|
140
|
+
a,
|
|
141
|
+
C,
|
|
142
|
+
d,
|
|
143
|
+
o,
|
|
144
|
+
i,
|
|
145
|
+
r
|
|
146
|
+
);
|
|
147
|
+
this.dataInputs.includes(u) || m.options.forEach((v) => {
|
|
148
|
+
h.add(v.value);
|
|
149
|
+
});
|
|
150
|
+
for (const [v, S] of m.optionsInfo)
|
|
151
|
+
p.set(v, S);
|
|
152
|
+
l[u] = m;
|
|
153
|
+
}
|
|
154
|
+
const y = (u) => {
|
|
155
|
+
const f = p.get(u);
|
|
156
|
+
f && f.kind === "axis" && (f.mustBeConsumed = !0);
|
|
157
|
+
const m = c.get(u);
|
|
158
|
+
m && m.kind === "axis" && (m.mustBeConsumed = !0);
|
|
159
|
+
}, E = await this.getMustBeConsumedAxes(e, t);
|
|
160
|
+
for (const u of E)
|
|
161
|
+
y(u);
|
|
162
|
+
if (this.dontAllowUnfilteredHighCardinality) {
|
|
163
|
+
const u = (m) => {
|
|
164
|
+
var v;
|
|
165
|
+
return ((v = m == null ? void 0 : m.annotations) == null ? void 0 : v[V]) === "true";
|
|
166
|
+
}, f = ((s = t.components.filters) == null ? void 0 : s.selectorStates.reduce((m, v) => {
|
|
167
|
+
const S = c.get(v.selectedSource);
|
|
168
|
+
return (S == null ? void 0 : S.kind) === "column" && S.spec.axesSpec.filter(u).forEach((w) => m.add(A.fromAxisSpec(w).toCanonicalString())), (S == null ? void 0 : S.kind) === "axis" && u(S.spec) && m.add(A.fromAxisSpec(S.spec).toCanonicalString()), m;
|
|
169
|
+
}, /* @__PURE__ */ new Set())) ?? /* @__PURE__ */ new Set();
|
|
170
|
+
this.dataInputs.forEach((m) => {
|
|
171
|
+
for (const { selectedSource: v } of t.components[m].selectorStates) {
|
|
172
|
+
const S = c.get(v);
|
|
173
|
+
if ((S == null ? void 0 : S.kind) === "column" && S.spec.axesSpec.filter(u).forEach((w) => {
|
|
174
|
+
const O = A.fromAxisSpec(w).toCanonicalString();
|
|
175
|
+
!h.has(O) && !f.has(O) && h.add(O), f.has(O) || y(O);
|
|
176
|
+
}), (S == null ? void 0 : S.kind) === "axis" && u(S.spec)) {
|
|
177
|
+
const w = A.fromAxisSpec(S.spec).toCanonicalString();
|
|
178
|
+
h.has(w) || h.add(w), f.has(w) || y(w);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
const x = /* @__PURE__ */ new Set();
|
|
184
|
+
for (const { selectorStates: u } of Object.values(t.components))
|
|
185
|
+
for (const { selectedSource: f } of u) {
|
|
186
|
+
const m = c.get(f);
|
|
187
|
+
m && m.kind === "column" && m.axesToBeFixed.forEach((v) => {
|
|
188
|
+
x.add(v);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
const B = await this.isConsistent(e, t, d), I = (u) => {
|
|
192
|
+
const f = k(u).toCanonicalString() ?? u;
|
|
193
|
+
return p.get(f) ?? c.get(f) ?? j(u);
|
|
194
|
+
};
|
|
195
|
+
return {
|
|
196
|
+
components: l,
|
|
197
|
+
getSourceInfo: I,
|
|
198
|
+
freeOptionsSet: h,
|
|
199
|
+
axesToBeFixedSet: x,
|
|
200
|
+
readyData: this.readyDataInputs(t),
|
|
201
|
+
ready: this.readyForPlotBuilding(e, t, B, h, I),
|
|
202
|
+
consistent: B
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
async getUniqueSourceValuesWithLabels(e, t, n, o, s, l) {
|
|
206
|
+
var C;
|
|
207
|
+
const i = (a) => a.sort((c, p) => c.label.localeCompare(p.label, "en", { numeric: !0 })), r = t.getSourceInfo(n), d = (C = r.annotations) == null ? void 0 : C[M];
|
|
208
|
+
try {
|
|
209
|
+
const a = d ? JSON.parse(d).map((c) => String(c)) : null;
|
|
210
|
+
if (a) {
|
|
211
|
+
const c = a.map((p) => ({ value: p, label: p }));
|
|
212
|
+
return i(c), { values: c, overflow: !1 };
|
|
213
|
+
}
|
|
214
|
+
} catch {
|
|
215
|
+
console.error(`Parsing error: discrete values annotation ${d} in ${n}`);
|
|
216
|
+
}
|
|
217
|
+
if (r.kind === "axis") {
|
|
218
|
+
const a = k(n), c = r.parentSources.map(k), p = await G(e, n, r.parentSources);
|
|
219
|
+
let g = [];
|
|
220
|
+
if (p) {
|
|
221
|
+
s && (g = [{
|
|
222
|
+
type: "bySingleColumnV2",
|
|
223
|
+
column: {
|
|
224
|
+
type: "column",
|
|
225
|
+
id: p.name
|
|
226
|
+
},
|
|
227
|
+
predicate: {
|
|
228
|
+
operator: "StringIContains",
|
|
229
|
+
substring: s
|
|
230
|
+
}
|
|
231
|
+
}]), l && (g = [{
|
|
232
|
+
type: "bySingleColumnV2",
|
|
233
|
+
column: {
|
|
234
|
+
type: "axis",
|
|
235
|
+
id: a.toPFrameId()
|
|
236
|
+
},
|
|
237
|
+
predicate: {
|
|
238
|
+
operator: "StringIContains",
|
|
239
|
+
substring: l
|
|
240
|
+
}
|
|
241
|
+
}]);
|
|
242
|
+
const { data: x, axesData: B } = await e.pFrameProvider.getSingleColumnData(p, g), I = B[a.toCanonicalString()], u = [];
|
|
243
|
+
for (let f = 0; f < Math.min(I.length, o ?? I.length); f++)
|
|
244
|
+
u.push({ value: String(I[f]), label: String(x[f]) });
|
|
245
|
+
return i(u), { values: u, overflow: !(o === void 0 || I.length < o) };
|
|
246
|
+
}
|
|
247
|
+
const h = s ?? l;
|
|
248
|
+
h && (g = [{
|
|
249
|
+
type: "bySingleColumnV2",
|
|
250
|
+
column: {
|
|
251
|
+
type: "axis",
|
|
252
|
+
id: a.toPFrameId()
|
|
253
|
+
},
|
|
254
|
+
predicate: {
|
|
255
|
+
operator: "StringIContains",
|
|
256
|
+
substring: h
|
|
257
|
+
}
|
|
258
|
+
}]);
|
|
259
|
+
const y = await e.pFrameProvider.getAxisUniqueValues(a, [c[0]], o, g), E = y.values.map((x) => ({ value: String(x), label: String(x) }));
|
|
260
|
+
return i(E), { values: E, overflow: y.overflow };
|
|
261
|
+
}
|
|
262
|
+
if (r.kind === "column") {
|
|
263
|
+
const a = s ?? l, c = k(n), p = a ? [{
|
|
264
|
+
type: "bySingleColumnV2",
|
|
265
|
+
column: {
|
|
266
|
+
type: "column",
|
|
267
|
+
id: c.name
|
|
268
|
+
},
|
|
269
|
+
predicate: {
|
|
270
|
+
operator: "StringIContains",
|
|
271
|
+
substring: a
|
|
272
|
+
}
|
|
273
|
+
}] : [], g = await e.pFrameProvider.getColumnUniqueValues(c, o, p), h = g.values.map((y) => ({ value: String(y), label: String(y) }));
|
|
274
|
+
return i(h), { values: h, overflow: g.overflow };
|
|
275
|
+
}
|
|
276
|
+
return { values: [], overflow: !1 };
|
|
277
|
+
}
|
|
278
|
+
async checkStateConsistency(e, t, n) {
|
|
279
|
+
const o = /* @__PURE__ */ new Map();
|
|
280
|
+
for (const s of Object.keys(this.simpleComponentControllers))
|
|
281
|
+
o.set(
|
|
282
|
+
s,
|
|
283
|
+
await this.simpleComponentControllers[s].checkStateConsistency(e, t, n)
|
|
284
|
+
);
|
|
285
|
+
for (const s of Object.keys(this.filterComponentControllers))
|
|
286
|
+
o.set(
|
|
287
|
+
s,
|
|
288
|
+
await this.filterComponentControllers[s].checkStateConsistency(e, t, n)
|
|
289
|
+
);
|
|
290
|
+
return o;
|
|
291
|
+
}
|
|
292
|
+
async isConsistent(e, t, n) {
|
|
293
|
+
const o = await this.checkStateConsistency(e, t, n);
|
|
294
|
+
for (const s of o.values())
|
|
295
|
+
if (Object.values(s).some((l) => !l))
|
|
296
|
+
return !1;
|
|
297
|
+
return !0;
|
|
298
|
+
}
|
|
299
|
+
readyDataInputs(e) {
|
|
300
|
+
return this.dataInputs.every((t) => e.components[t].selectorStates.length > 0);
|
|
301
|
+
}
|
|
302
|
+
readyForPlotBuilding(e, t, n, o, s) {
|
|
303
|
+
if (!n || !this.readyDataInputs(t))
|
|
304
|
+
return !1;
|
|
305
|
+
let l = !1;
|
|
306
|
+
for (const i of o) {
|
|
307
|
+
const r = s(i);
|
|
308
|
+
if (r && r.kind === "axis" && r.mustBeConsumed) {
|
|
309
|
+
l = !0;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
let C = !1;
|
|
314
|
+
for (const { selectorStates: i } of Object.values(t.components)) {
|
|
315
|
+
for (const { selectedSource: r, fixedAxes: d } of i) {
|
|
316
|
+
const a = s(r);
|
|
317
|
+
if (a && a.kind === "column" && a.axesToBeFixed.some(
|
|
318
|
+
(c) => {
|
|
319
|
+
var p;
|
|
320
|
+
return ((p = (d ?? []).find((g) => g.axisSource === c)) == null ? void 0 : p.axisValue) === void 0;
|
|
321
|
+
}
|
|
322
|
+
)) {
|
|
323
|
+
C = !0;
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (C)
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
return this.requiredComponents.every((i) => t.components[i].selectorStates.length > 0) && !l && !C;
|
|
331
|
+
}
|
|
332
|
+
async createDataForPlot(e, t) {
|
|
333
|
+
return {
|
|
334
|
+
data: await this.createDataByColumns(e, t),
|
|
335
|
+
settings: await this.createChartSettings(e, t)
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
export {
|
|
340
|
+
z as ControllerBase
|
|
341
|
+
};
|
|
342
|
+
//# sourceMappingURL=ControllerBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ControllerBase.js","sources":["../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/ControllerBase.ts"],"sourcesContent":["import {\n AxisSpec,\n LinkerMap,\n PColumnSpec,\n PObjectId,\n PTableRecordSingleValueFilterV2\n} from '@milaboratories/pl-model-common';\nimport {deriveLabels} from '@platforma-sdk/model';\nimport type {\n AxisData,\n ColumnData,\n ComponentGuideFilter,\n ComponentGuideSimple,\n ComponentsGuide,\n DataByColumns,\n FilterComponentControllers,\n FilterComponents,\n InputGuide,\n InputState,\n SelectorState,\n SelectorStateFilter,\n SelectorStateSimple,\n SimpleComponentControllers,\n SimpleComponents,\n} from '../common';\nimport { DISCRETE_VALUES_KEY, HIGH_CARDINALITY } from '../constants';\nimport { PValue } from '../store';\nimport type { DataStore } from '../store';\nimport type { ColumnOrAxisIdString } from '../spec';\nimport { AxisId, ColumnId, columnOrAxisIdFromString, isColumnId } from '../spec';\nimport {\n addSourceInfoToMap,\n createLinkerMap,\n dataColumnPredicateDefault,\n getColumnOrAxisValueLabelsId,\n getDefaultInfo,\n getStateCopy,\n} from '../utils';\nimport { ComponentController } from './ComponentController';\n\ntype InputOptionsUnion<State extends InputState> = Record<\n SimpleComponents<State> | FilterComponents<State>,\n ComponentGuideSimple | ComponentGuideFilter\n>;\nexport interface Controller<State extends InputState> {\n calculateOptions(\n store: DataStore,\n state: State,\n fixedIds?: string[],\n dataColumnPredicate?: (spec: PColumnSpec) => boolean\n ): Promise<InputGuide<State>>;\n\n getUniqueSourceValuesWithLabels(\n store: DataStore,\n inputGuide: InputGuide<State>,\n selectedSource: ColumnOrAxisIdString,\n limit?:number,\n searchQuery?: string,\n searchQueryByValue?: string,\n ): Promise<{\n values: {\n value: string;\n label: string;\n }[],\n overflow: boolean;\n }>;\n\n getEmptyInputGuide(state: State): InputGuide<State>;\n\n createDataForPlot(store: DataStore, state: State): Promise<PlotDataAndSettings>;\n\n changeSelected(\n inputName: keyof State['components'],\n store: DataStore,\n state: State,\n nextSelectorStates: SelectorStateFilter[] | SelectorStateSimple[]\n ): State;\n}\n\nexport interface PlotDataAndSettings {\n data: {\n byColumns: DataByColumns,\n axesData?: Record<string, PValue[]>\n };\n settings: Record<string, unknown>;\n}\n\nexport abstract class ControllerBase<State extends InputState> implements Controller<State> {\n readonly ignoredOptionIdNames: string[] = [];\n readonly dataInputs: string[] = [];\n readonly dontAllowUnfilteredHighCardinality: boolean = false;\n\n protected constructor(\n readonly simpleComponentControllers: SimpleComponentControllers<State>,\n readonly filterComponentControllers: FilterComponentControllers<State>\n ) {}\n\n get requiredComponents(): (keyof State['components'])[] {\n const components: (keyof State['components'])[] = [];\n for (const componentName of Object.keys(this.simpleComponentControllers) as SimpleComponents<State>[]) {\n if (this.simpleComponentControllers[componentName].isRequired) {\n components.push(componentName);\n }\n }\n return components;\n }\n\n get dimensionsConsumerComponents(): (keyof State['components'])[] {\n const components: (keyof State['components'])[] = [];\n for (const componentName of Object.keys(this.simpleComponentControllers) as SimpleComponents<State>[]) {\n if (this.simpleComponentControllers[componentName].isDimensionsConsumer) {\n components.push(componentName);\n }\n }\n for (const componentName of Object.keys(this.filterComponentControllers) as FilterComponents<State>[]) {\n if (this.filterComponentControllers[componentName].isDimensionsConsumer) {\n components.push(componentName);\n }\n }\n return components;\n }\n\n addSelected(\n inputName: keyof State['components'],\n state: State,\n selectorState: SelectorStateFilter | SelectorStateSimple\n ) {\n if (inputName in this.simpleComponentControllers) {\n return (\n this.simpleComponentControllers[\n inputName as keyof typeof this.simpleComponentControllers\n ] as ComponentController<State, typeof inputName>\n ).addSelected(state, selectorState);\n }\n if (inputName in this.filterComponentControllers) {\n return (\n this.filterComponentControllers[\n inputName as keyof typeof this.filterComponentControllers\n ] as ComponentController<State, typeof inputName>\n ).addSelected(state, selectorState);\n }\n throw Error(`Unknown input name: ${String(inputName)}`);\n }\n\n deleteSelected(\n inputName: keyof State['components'],\n store: DataStore,\n state: State,\n selectorState: SelectorStateFilter | SelectorStateSimple\n ) {\n if (inputName in this.simpleComponentControllers) {\n return (\n this.simpleComponentControllers[\n inputName as keyof typeof this.simpleComponentControllers\n ] as ComponentController<State, typeof inputName>\n ).deleteSelected(state, selectorState.selectedSource);\n }\n if (inputName in this.filterComponentControllers) {\n return (\n this.filterComponentControllers[\n inputName as keyof typeof this.filterComponentControllers\n ] as ComponentController<State, typeof inputName>\n ).deleteSelected(state, selectorState.selectedSource);\n }\n throw Error(`Unknown input name: ${String(inputName)}`);\n }\n\n changeSelected(\n inputName: keyof State['components'],\n store: DataStore,\n state: State,\n nextSelectorStates: SelectorState[]\n ) {\n const currentStates: SelectorState[] = state.components[inputName].selectorStates;\n const deletedStates = currentStates.filter(currentState => {\n return !nextSelectorStates.find(s => s.selectedSource === currentState.selectedSource);\n });\n const addedStates = nextSelectorStates.filter(nextState => {\n return !currentStates.find(s => s.selectedSource === nextState.selectedSource);\n });\n let nextState = getStateCopy(state);\n deletedStates.forEach(selectorState => {\n nextState = this.deleteSelected(inputName, store, nextState, selectorState);\n });\n addedStates.forEach(selectorState => {\n nextState = this.addSelected(inputName, nextState, selectorState);\n });\n // reorder\n state.components[inputName].selectorStates = nextSelectorStates\n .map(st =>\n (state.components[inputName].selectorStates as SelectorState[]).find(\n s => s.selectedSource === st.selectedSource\n )\n )\n .filter(Boolean) as SelectorStateFilter[] | SelectorStateSimple[];\n return nextState;\n }\n\n switchDividableAxis(state: State, axis: AxisId): State {\n // ***\n // logic for axis dividing/collapsing\n // ***\n return getStateCopy(state);\n }\n\n async getMustBeConsumedAxes(store: DataStore, state: State): Promise<Set<ColumnOrAxisIdString>> {\n return Promise.resolve(new Set());\n }\n\n private createEmptyComponentsGuide(state: State): InputOptionsUnion<State> {\n return Object.fromEntries(\n Object.entries(state.components).map(\n ([key, value]): [string, ComponentGuideSimple | ComponentGuideFilter] => {\n return [\n key,\n {\n options: [],\n optionsInfo: new Map(),\n stateConsistency: {},\n required: false,\n multipleSelectors: false,\n },\n ];\n }\n )\n ) as InputOptionsUnion<State>;\n }\n\n async getSelectedSourcesInfo(\n store: DataStore,\n state: State,\n labelsMap: Record<string, string>,\n linkerMap: LinkerMap\n ): Promise<Map<ColumnOrAxisIdString, AxisData | ColumnData>> {\n const result: Map<ColumnOrAxisIdString, AxisData> = new Map();\n\n const dataAxes = new Set<string>();\n const dataAxesList: AxisSpec[] = [];\n for (const inputName of this.dataInputs) {\n for (const selectorState of state.components[inputName].selectorStates) {\n const id = columnOrAxisIdFromString(selectorState.selectedSource);\n if (isColumnId(id)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(id);\n if (columnSpec) {\n columnSpec.axesSpec.forEach(axisSpec => {\n const idStr = AxisId.fromAxisSpec(axisSpec).toCanonicalString();\n if (!dataAxes.has(idStr)) {\n dataAxes.add(idStr);\n dataAxesList.push(axisSpec);\n }\n });\n }\n }\n }\n }\n for (const [inputName , {selectorStates}] of Object.entries(state.components)) {\n const component = this.simpleComponentControllers[inputName as keyof typeof this.simpleComponentControllers]\n ?? this.filterComponentControllers[inputName as keyof typeof this.filterComponentControllers] as ComponentController<State, typeof inputName>;\n const fixedAxesAllowed = component.settings.columnsWithExtraAxesAllowed;\n for (const {selectedSource} of selectorStates) {\n await addSourceInfoToMap(\n store,\n selectedSource,\n labelsMap[selectedSource],\n result,\n dataAxesList,\n dataAxes,\n fixedAxesAllowed,\n linkerMap\n );\n }\n }\n return result;\n }\n\n getEmptyInputGuide(state: State): InputGuide<State> {\n return {\n components: this.createEmptyComponentsGuide(state) as ComponentsGuide<State['components']>,\n getSourceInfo: (sourceIdStr: ColumnOrAxisIdString) => getDefaultInfo(sourceIdStr),\n freeOptionsSet: new Set(),\n axesToBeFixedSet: new Set(),\n readyData: false,\n ready: false,\n consistent: true,\n };\n }\n\n getConsumedOptionsSet(state: State) {\n const consumedSourcesSet: Set<ColumnOrAxisIdString> = new Set();\n for (const componentName of this.dimensionsConsumerComponents) {\n for (const {selectedSource} of state.components[componentName].selectorStates) {\n consumedSourcesSet.add(selectedSource);\n }\n }\n return consumedSourcesSet;\n }\n\n async getLabelsMap(store: DataStore, state: State) {\n const availableColumns = await store.pFrameProvider.getColumnsFull(\n this.dataInputs.reduce((res: (ColumnId | AxisId)[], inputName) => {\n const componentState = state.components[inputName];\n const sources = componentState.selectorStates.map(st => columnOrAxisIdFromString(st.selectedSource));\n return res.concat(sources);\n }, []),\n false\n );\n return deriveLabels(availableColumns, el => el.spec).reduce((res: Record<string, string>, el) => {\n const id = new ColumnId({name: el.value.columnId, type: el.value.spec.valueType}).toCanonicalString();\n res[id] = el.label;\n return res;\n }, {});\n }\n\n async calculateOptions(\n store: DataStore,\n state: State,\n fixedIds: string[] = [],\n dataColumnPredicate = dataColumnPredicateDefault\n ): Promise<InputGuide<State>> {\n // creating empty options object corresponding to the provided state\n const resultComponentsGuide: InputOptionsUnion<State> = this.createEmptyComponentsGuide(state);\n\n // set of columns and axes that selected in consumer-dimensions components\n const consumedSourcesSet = this.getConsumedOptionsSet(state);\n // for trees block - to ignore treeId and donorId in the interface\n const ignoredNamesSet = new Set<string>(this.ignoredOptionIdNames);\n const fixedSelectedSet = new Set<ColumnOrAxisIdString>(fixedIds);\n\n const linkerMap = await createLinkerMap(store)\n\n const labelsMap = await this.getLabelsMap(store, state); // improved labels with name separation for different columns with the same name; for axes - name from spec or labels column\n const selectedColumnsOrAxesInfo = await this.getSelectedSourcesInfo(store, state, labelsMap, linkerMap);\n const optionsInfo: Map<ColumnOrAxisIdString, ColumnData | AxisData> = new Map();\n\n const allControllers = {...this.simpleComponentControllers, ...this.filterComponentControllers};\n const freeOptionsSet = new Set<ColumnOrAxisIdString>();\n for (const [name, componentController] of Object.entries(allControllers)) {\n const options = await (\n componentController as ComponentController<State, SimpleComponents<State> | FilterComponents<State>>\n ).getOptions(\n store,\n state,\n labelsMap,\n consumedSourcesSet,\n linkerMap,\n dataColumnPredicate,\n ignoredNamesSet,\n fixedSelectedSet\n );\n if (!this.dataInputs.includes(name as string)) {\n options.options.forEach(item => {\n freeOptionsSet.add(item.value);\n });\n }\n for (const [key, v] of options.optionsInfo) {\n optionsInfo.set(key, v);\n }\n resultComponentsGuide[name as keyof InputOptionsUnion<State>] =\n options as (typeof resultComponentsGuide)[keyof InputOptionsUnion<State>];\n }\n\n const markMustBeConsumed = (id: string) => {\n const option = optionsInfo.get(id);\n if (option && option.kind === 'axis') {\n option.mustBeConsumed = true;\n }\n const selected = selectedColumnsOrAxesInfo.get(id);\n if (selected && selected.kind === 'axis') {\n selected.mustBeConsumed = true;\n }\n };\n // axes from heatmap data column, to make visible what axes should be; hanging axes from scatterplot\n const mustBeConsumedAxes = await this.getMustBeConsumedAxes(store, state);\n for (const id of mustBeConsumedAxes) {\n markMustBeConsumed(id);\n }\n\n if (this.dontAllowUnfilteredHighCardinality) {\n // Axes marked 'high cardinality' should be in the filter. Or some column that has this axis should be in the filter.\n // If not - they are marked 'mustBeConsumed'.\n // But also they can be anywhere else.\n const isHighCardinality = (spec: AxisSpec) => spec?.annotations?.[HIGH_CARDINALITY] === 'true';\n const consumedHighCardinalityAxes =\n state.components['filters']?.selectorStates.reduce((consumed: Set<string>, s) => {\n const info = selectedColumnsOrAxesInfo.get(s.selectedSource);\n if (info?.kind === 'column') {\n const axes = info.spec.axesSpec.filter(isHighCardinality);\n axes.forEach(spec => consumed.add(AxisId.fromAxisSpec(spec).toCanonicalString()));\n }\n if (info?.kind === 'axis' && isHighCardinality(info.spec)) {\n consumed.add(AxisId.fromAxisSpec(info.spec).toCanonicalString());\n }\n return consumed;\n }, new Set<string>()) ?? new Set<string>();\n this.dataInputs.forEach(inputName => {\n for (const {selectedSource} of state.components[inputName].selectorStates) {\n const info = selectedColumnsOrAxesInfo.get(selectedSource);\n if (info?.kind === 'column') {\n const axes = info.spec.axesSpec.filter(isHighCardinality);\n axes.forEach(spec => {\n const idStr = AxisId.fromAxisSpec(spec).toCanonicalString();\n if (!freeOptionsSet.has(idStr) && !consumedHighCardinalityAxes.has(idStr)) {\n // return axis to the list of free axis if it is selected somewhere, but nothing with this axis is in the filters\n freeOptionsSet.add(idStr);\n }\n if (!consumedHighCardinalityAxes.has(idStr)) {\n markMustBeConsumed(idStr);\n }\n });\n }\n if (info?.kind === 'axis' && isHighCardinality(info.spec)) {\n const idStr = AxisId.fromAxisSpec(info.spec).toCanonicalString();\n if (!freeOptionsSet.has(idStr)) {\n freeOptionsSet.add(idStr);\n }\n if (!consumedHighCardinalityAxes.has(idStr)) {\n markMustBeConsumed(idStr);\n }\n }\n }\n });\n }\n\n const axesToBeFixedSet = new Set<ColumnOrAxisIdString>();\n for (const {selectorStates} of Object.values(state.components)) {\n for (const {selectedSource} of selectorStates) {\n const info = selectedColumnsOrAxesInfo.get(selectedSource);\n if (info && info.kind === 'column') {\n info.axesToBeFixed.forEach(axisIdStr => {\n axesToBeFixedSet.add(axisIdStr);\n });\n }\n }\n }\n\n const consistent = await this.isConsistent(store, state, linkerMap);\n const getSourceInfo = (sourceIdStr: ColumnOrAxisIdString) => {\n const id = columnOrAxisIdFromString(sourceIdStr).toCanonicalString() ?? sourceIdStr;\n return optionsInfo.get(id) ?? selectedColumnsOrAxesInfo.get(id) ?? getDefaultInfo(sourceIdStr);\n };\n return {\n components: resultComponentsGuide as ComponentsGuide<State['components']>,\n getSourceInfo,\n freeOptionsSet,\n axesToBeFixedSet,\n readyData: this.readyDataInputs(state),\n ready: this.readyForPlotBuilding(store, state, consistent, freeOptionsSet, getSourceInfo),\n consistent,\n };\n }\n\n async getUniqueSourceValuesWithLabels(\n store: DataStore,\n inputGuide: InputGuide<State>,\n selectedSource: ColumnOrAxisIdString,\n limit?:number,\n searchQuery?: string, // search by labels if axis labels exist\n searchQueryValue?: string // search by value, not by label\n ): Promise<{\n values: {\n value: string;\n label: string;\n }[],\n overflow: boolean;\n }> {\n const sortValues = (values:{value:string, label:string}[]) => values.sort((a, b) => a.label.localeCompare(b.label, 'en', {numeric: true}))\n const info = inputGuide.getSourceInfo(selectedSource);\n const discreteValuesStr = info.annotations?.[DISCRETE_VALUES_KEY];\n\n // if column's annotation contains discrete values - take them from it\n try {\n const discreteValues: string[] | null = discreteValuesStr\n ? (JSON.parse(discreteValuesStr) as (string | number)[]).map(v => String(v))\n : null;\n if (discreteValues) {\n const values = discreteValues.map(v => ({value: v, label: v}));\n sortValues(values);\n return {values, overflow: false};\n }\n } catch (err) {\n console.error(`Parsing error: discrete values annotation ${discreteValuesStr} in ${selectedSource}`)\n }\n\n // consider label column for axis\n if (info.kind === 'axis') {\n const axisId = columnOrAxisIdFromString(selectedSource) as AxisId;\n const parentSources = info.parentSources.map(columnOrAxisIdFromString) as ColumnId[];\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, info.parentSources);\n let filters:PTableRecordSingleValueFilterV2[] = [];\n if (labelsColumnId) {\n if (searchQuery) {\n filters = [{\n type: 'bySingleColumnV2',\n column: {\n type: 'column',\n id: labelsColumnId.name as PObjectId\n },\n predicate: {\n operator: 'StringIContains',\n substring: searchQuery\n }\n }];\n }\n if (searchQueryValue) {\n filters = [{\n type: 'bySingleColumnV2',\n column: {\n type: 'axis',\n id: axisId.toPFrameId()\n },\n predicate: {\n operator: 'StringIContains',\n substring: searchQueryValue\n }\n }];\n }\n const {data: dataValues, axesData} = await store.pFrameProvider.getSingleColumnData(labelsColumnId, filters);\n const axisKeys = axesData[axisId.toCanonicalString()];\n const values:{value: string, label: string}[] = [];\n for (let i = 0; i < Math.min(axisKeys.length, limit ?? axisKeys.length); i++) {\n values.push({value: String(axisKeys[i]), label: String(dataValues[i])});\n }\n sortValues(values);\n return {values, overflow: !(limit === undefined || axisKeys.length < limit)};\n }\n const searchInLabelsOrValue = searchQuery ?? searchQueryValue;\n if (searchInLabelsOrValue) {\n filters = [{\n type: 'bySingleColumnV2',\n column: {\n type: 'axis',\n id: axisId.toPFrameId()\n },\n predicate: {\n operator: 'StringIContains',\n substring: searchInLabelsOrValue\n }\n }];\n }\n const response = await store.pFrameProvider.getAxisUniqueValues(axisId, [parentSources[0]], limit, filters);\n const values = response.values.map(v => ({value: String(v), label: String(v)}));\n sortValues(values);\n return {values, overflow: response.overflow};\n }\n if (info.kind === 'column') {\n const searchInLabelsOrValue = searchQuery ?? searchQueryValue;\n const columnId = columnOrAxisIdFromString(selectedSource) as ColumnId;\n const filters:PTableRecordSingleValueFilterV2[] = searchInLabelsOrValue ? [{\n type: 'bySingleColumnV2',\n column: {\n type: 'column',\n id: columnId.name as PObjectId\n },\n predicate: {\n operator: 'StringIContains',\n substring: searchInLabelsOrValue\n }\n }] : [];\n const response = await store.pFrameProvider.getColumnUniqueValues(columnId, limit, filters);\n const values = response.values.map(v => ({value: String(v), label: String(v)}));\n sortValues(values);\n return {values, overflow: response.overflow};\n }\n return {values: [], overflow: false};\n }\n\n async checkStateConsistency(\n store: DataStore,\n state: State,\n linkerMap: LinkerMap\n ): Promise<Map<keyof State['components'], Record<string, boolean>>> {\n const result: Map<keyof State['components'], Record<string, boolean>> = new Map();\n for (const component of Object.keys(this.simpleComponentControllers) as SimpleComponents<State>[]) {\n result.set(\n component as keyof State['components'],\n await this.simpleComponentControllers[component].checkStateConsistency(store, state, linkerMap)\n );\n }\n for (const component of Object.keys(this.filterComponentControllers) as FilterComponents<State>[]) {\n result.set(\n component as keyof State['components'],\n await this.filterComponentControllers[component].checkStateConsistency(store, state, linkerMap)\n );\n }\n return result;\n }\n\n async isConsistent(store: DataStore, state: State, linkerMap: LinkerMap): Promise<boolean> {\n const consistency = await this.checkStateConsistency(store, state, linkerMap);\n for (const value of consistency.values()) {\n if (Object.values(value).some(item => !item)) {\n return false;\n }\n }\n return true;\n }\n\n readyDataInputs(state: State): boolean {\n return this.dataInputs.every(name => state.components[name].selectorStates.length > 0);\n }\n\n readyForPlotBuilding(\n store: DataStore,\n state: State,\n consistent: boolean,\n freeOptionsSet: Set<ColumnOrAxisIdString>,\n getSourceInfo: (id: ColumnOrAxisIdString) => ColumnData | AxisData\n ): boolean {\n if (!consistent || !this.readyDataInputs(state)) {\n return false;\n }\n let hasFreeDimensions: boolean = false;\n for (const optionId of freeOptionsSet) {\n const info = getSourceInfo(optionId);\n if (info && info.kind === 'axis' && info.mustBeConsumed) {\n hasFreeDimensions = true;\n break;\n }\n }\n let hasNotSelectedAxisToBeFixed: boolean = false;\n for (const {selectorStates} of Object.values(state.components)) {\n for (const {selectedSource, fixedAxes} of selectorStates) {\n const info = getSourceInfo(selectedSource);\n if (\n info &&\n info.kind === 'column' &&\n info.axesToBeFixed.some(\n id => (fixedAxes ?? []).find(el => el.axisSource === id)?.axisValue === undefined\n )\n ) {\n hasNotSelectedAxisToBeFixed = true;\n break;\n }\n }\n if (hasNotSelectedAxisToBeFixed) {\n break;\n }\n }\n return (\n this.requiredComponents.every(name => state.components[name].selectorStates.length > 0) &&\n !hasFreeDimensions &&\n !hasNotSelectedAxisToBeFixed\n );\n }\n\n abstract createDataByColumns(store: DataStore, state: State): Promise<PlotDataAndSettings['data']>;\n\n abstract createChartSettings(store: DataStore, state: State): Promise<PlotDataAndSettings['settings']>;\n\n async createDataForPlot(store: DataStore, state: State): Promise<PlotDataAndSettings> {\n return {\n data: await this.createDataByColumns(store, state),\n settings: await this.createChartSettings(store, state),\n };\n }\n}\n"],"names":["ControllerBase","simpleComponentControllers","filterComponentControllers","__publicField","components","componentName","inputName","state","selectorState","store","nextSelectorStates","currentStates","deletedStates","currentState","s","addedStates","nextState","h","getStateCopy","st","axis","key","value","labelsMap","linkerMap","result","dataAxes","dataAxesList","id","columnOrAxisIdFromString","isColumnId","columnSpec","axisSpec","idStr","AxisId","selectorStates","fixedAxesAllowed","selectedSource","addSourceInfoToMap","sourceIdStr","getDefaultInfo","consumedSourcesSet","availableColumns","res","sources","a","deriveLabels","el","ColumnId","fixedIds","dataColumnPredicate","dataColumnPredicateDefault","resultComponentsGuide","ignoredNamesSet","fixedSelectedSet","createLinkerMap","selectedColumnsOrAxesInfo","optionsInfo","allControllers","freeOptionsSet","name","componentController","options","item","v","markMustBeConsumed","option","selected","mustBeConsumedAxes","isHighCardinality","spec","_a","HIGH_CARDINALITY","consumedHighCardinalityAxes","consumed","info","axesToBeFixedSet","axisIdStr","consistent","getSourceInfo","inputGuide","limit","searchQuery","searchQueryValue","sortValues","values","b","discreteValuesStr","DISCRETE_VALUES_KEY","discreteValues","axisId","parentSources","labelsColumnId","getColumnOrAxisValueLabelsId","filters","dataValues","axesData","axisKeys","i","searchInLabelsOrValue","response","w","columnId","component","consistency","hasFreeDimensions","optionId","hasNotSelectedAxisToBeFixed","fixedAxes","S"],"mappings":";;;;;AAuFO,MAAeA,EAAsE;AAAA,EAK9E,YACGC,GACAC,GACX;AAPOC,MAAA,8BAAiC,EAAC,GAClCA,EAAA,oBAAuB,EAAC,GACxBA,EAAA,MAAA,sCAA8C,EAAA,GAG1C,KAAA,6BAAAF,GACA,KAAA,6BAAAC;AAAAA,EAAA;AAAA,EAGb,IAAI,qBAAoD;AACpD,UAAME,IAA4C,CAAA;AAClD,eAAWC,KAAiB,OAAO,KAAK,KAAK,0BAA0B;AAC/D,WAAK,2BAA2BA,CAAa,EAAE,cAC/CD,EAAW,KAAKC,CAAa;AAG9B,WAAAD;AAAAA,EAAA;AAAA,EAGX,IAAI,+BAA8D;AAC9D,UAAMA,IAA4C,CAAA;AAClD,eAAWC,KAAiB,OAAO,KAAK,KAAK,0BAA0B;AAC/D,WAAK,2BAA2BA,CAAa,EAAE,wBAC/CD,EAAW,KAAKC,CAAa;AAGrC,eAAWA,KAAiB,OAAO,KAAK,KAAK,0BAA0B;AAC/D,WAAK,2BAA2BA,CAAa,EAAE,wBAC/CD,EAAW,KAAKC,CAAa;AAG9B,WAAAD;AAAAA,EAAA;AAAA,EAGX,YACIE,GACAC,GACAC,GACF;AACM,QAAAF,KAAa,KAAK;AAClB,aACI,KAAK,2BACDA,CACJ,EACF,YAAYC,GAAOC,CAAa;AAElC,QAAAF,KAAa,KAAK;AAClB,aACI,KAAK,2BACDA,CACJ,EACF,YAAYC,GAAOC,CAAa;AAEtC,UAAM,MAAM,uBAAuB,OAAOF,CAAS,CAAC,EAAE;AAAA,EAAA;AAAA,EAG1D,eACIA,GACAG,GACAF,GACAC,GACF;AACM,QAAAF,KAAa,KAAK;A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