@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.
Files changed (69) hide show
  1. package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.d.ts +3 -10
  2. package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.d.ts.map +1 -1
  3. package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.js +42 -83
  4. package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.js.map +1 -1
  5. package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.d.ts +1 -5
  6. package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.d.ts.map +1 -1
  7. package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.js +43 -85
  8. package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.js.map +1 -1
  9. package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.d.ts +1 -3
  10. package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.d.ts.map +1 -1
  11. package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.js +73 -85
  12. package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.js.map +1 -1
  13. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts +1 -5
  14. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts.map +1 -1
  15. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js +51 -91
  16. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js.map +1 -1
  17. package/dist/GraphMaker/components/DragAndDrop/types.d.ts +0 -19
  18. package/dist/GraphMaker/components/DragAndDrop/types.d.ts.map +1 -1
  19. package/dist/GraphMaker/constantsCommon.d.ts +0 -1
  20. package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
  21. package/dist/GraphMaker/constantsCommon.js +45 -46
  22. package/dist/GraphMaker/constantsCommon.js.map +1 -1
  23. package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.d.ts.map +1 -1
  24. package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.js +115 -145
  25. package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.js.map +1 -1
  26. package/dist/GraphMaker/forms/DataMappingForm/useBaskets.d.ts.map +1 -1
  27. package/dist/GraphMaker/forms/DataMappingForm/useBaskets.js +95 -125
  28. package/dist/GraphMaker/forms/DataMappingForm/useBaskets.js.map +1 -1
  29. package/dist/GraphMaker/forms/DataMappingForm/utils.d.ts.map +1 -1
  30. package/dist/GraphMaker/forms/DataMappingForm/utils.js +77 -153
  31. package/dist/GraphMaker/forms/DataMappingForm/utils.js.map +1 -1
  32. package/dist/GraphMaker/store.d.ts.map +1 -1
  33. package/dist/GraphMaker/store.js +41 -43
  34. package/dist/GraphMaker/store.js.map +1 -1
  35. package/dist/GraphMaker/utils/loadDefaultSources.d.ts +1 -2
  36. package/dist/GraphMaker/utils/loadDefaultSources.d.ts.map +1 -1
  37. package/dist/GraphMaker/utils/loadDefaultSources.js +43 -47
  38. package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
  39. package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
  40. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +34 -36
  41. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
  42. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +6 -5
  43. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +1 -1
  44. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +146 -149
  45. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -1
  46. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +165 -218
  47. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -1
  48. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +95 -102
  49. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -1
  50. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +145 -156
  51. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js.map +1 -1
  52. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js +68 -75
  53. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js.map +1 -1
  54. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +154 -159
  55. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -1
  56. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +48 -55
  57. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js.map +1 -1
  58. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +114 -122
  59. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -1
  60. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +111 -119
  61. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -1
  62. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +4 -4
  63. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +70 -69
  64. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -1
  65. package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js +2 -2
  66. package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js.map +1 -1
  67. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +183 -187
  68. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
  69. 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 P } from "../node_modules/@platforma-sdk/model/dist/render/util/label.js";
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
- import { DISCRETE_VALUES_KEY as M, HIGH_CARDINALITY as V } from "../constants.js";
9
- import { columnOrAxisIdFromString as k, isColumnId as L, AxisId as A, ColumnId as T } from "../spec.js";
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
- F(this, "ignoredOptionIdNames", []), F(this, "dataInputs", []), F(this, "dontAllowUnfilteredHighCardinality", !1), this.simpleComponentControllers = e, this.filterComponentControllers = t;
14
+ x(this, "ignoredOptionIdNames", []), x(this, "dataInputs", []), x(this, "dontAllowUnfilteredHighCardinality", !1), x(this, "allowHangingAxes", !1), this.simpleComponentControllers = e, this.filterComponentControllers = t;
15
15
  }
16
- get requiredComponents() {
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, n);
18
+ return this.simpleComponentControllers[e].addSelected(t, o);
33
19
  if (e in this.filterComponentControllers)
34
- return this.filterComponentControllers[e].addSelected(t, n);
20
+ return this.filterComponentControllers[e].addSelected(t, o);
35
21
  throw Error(`Unknown input name: ${String(e)}`);
36
22
  }
37
- deleteSelected(e, t, n, o) {
23
+ deleteSelected(e, t, o, n) {
38
24
  if (e in this.simpleComponentControllers)
39
- return this.simpleComponentControllers[e].deleteSelected(n, o.selectedSource);
25
+ return this.simpleComponentControllers[e].deleteSelected(o, n.selectedSource);
40
26
  if (e in this.filterComponentControllers)
41
- return this.filterComponentControllers[e].deleteSelected(n, o.selectedSource);
27
+ return this.filterComponentControllers[e].deleteSelected(o, n.selectedSource);
42
28
  throw Error(`Unknown input name: ${String(e)}`);
43
29
  }
44
- changeSelected(e, t, n, o) {
45
- const s = n.components[e].selectorStates, l = s.filter((r) => !o.find((p) => p.selectedSource === r.selectedSource)), C = o.filter((r) => !s.find((p) => p.selectedSource === r.selectedSource));
46
- let a = D(n);
47
- return l.forEach((r) => {
48
- a = this.deleteSelected(e, t, a, r);
49
- }), C.forEach((r) => {
50
- a = this.addSelected(e, a, r);
51
- }), n.components[e].selectorStates = o.map(
52
- (r) => n.components[e].selectorStates.find(
53
- (p) => p.selectedSource === r.selectedSource
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), a;
41
+ ).filter(Boolean), p;
56
42
  }
57
43
  switchDividableAxis(e, t) {
58
- return D(e);
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, n]) => [
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) => j(t),
112
- freeOptionsSet: /* @__PURE__ */ new Set(),
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 = /* @__PURE__ */ new Set();
121
- for (const n of this.dimensionsConsumerComponents)
122
- for (const { selectedSource: o } of e.components[n].selectorStates)
123
- t.add(o);
124
- return t;
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 getLabelsMap(e, t) {
127
- const n = await e.pFrameProvider.getColumnsFull(
128
- this.dataInputs.reduce((o, s) => {
129
- const l = t.components[s].selectorStates.map((C) => k(C.selectedSource));
130
- return o.concat(l);
131
- }, []),
132
- !1
133
- );
134
- return P(n, (o) => o.spec).reduce((o, s) => {
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
- async calculateOptions(e, t, n = [], o = $) {
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 l = this.createEmptyComponentsGuide(t), C = this.getConsumedOptionsSet(t), a = new Set(this.ignoredOptionIdNames), r = new Set(n), p = await q(e), i = await this.getLabelsMap(e, t), c = await this.getSelectedSourcesInfo(e, t, i, p), d = /* @__PURE__ */ new Map(), g = { ...this.simpleComponentControllers, ...this.filterComponentControllers }, h = /* @__PURE__ */ new Set();
142
- for (const [u, f] of Object.entries(g)) {
143
- const m = await f.getOptions(
144
- e,
145
- t,
146
- i,
147
- C,
148
- p,
149
- o,
150
- a,
151
- r
152
- );
153
- this.dataInputs.includes(u) || m.options.forEach((v) => {
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 u = (m) => {
170
- var v;
171
- return ((v = m == null ? void 0 : m.annotations) == null ? void 0 : v[V]) === "true";
172
- }, f = ((s = t.components.filters) == null ? void 0 : s.selectorStates.reduce((m, v) => {
173
- const S = c.get(v.selectedSource);
174
- 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;
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((m) => {
177
- for (const { selectedSource: v } of t.components[m].selectorStates) {
178
- const S = c.get(v);
179
- if ((S == null ? void 0 : S.kind) === "column" && S.spec.axesSpec.filter(u).forEach((w) => {
180
- const O = A.fromAxisSpec(w).toCanonicalString();
181
- !h.has(O) && !f.has(O) && h.add(O), f.has(O) || y(O);
182
- }), (S == null ? void 0 : S.kind) === "axis" && u(S.spec)) {
183
- const w = A.fromAxisSpec(S.spec).toCanonicalString();
184
- h.has(w) || h.add(w), f.has(w) || y(w);
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
- const x = /* @__PURE__ */ new Set();
190
- for (const { selectorStates: u } of Object.values(t.components))
191
- for (const { selectedSource: f } of u) {
192
- const m = c.get(f);
193
- m && m.kind === "column" && m.axesToBeFixed.forEach((v) => {
194
- x.add(v);
195
- });
196
- }
197
- const B = await this.isConsistent(e, t, p), I = (u) => {
198
- const f = k(u).toCanonicalString() ?? u;
199
- return d.get(f) ?? c.get(f) ?? j(u);
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: l,
203
- getSourceInfo: I,
204
- freeOptionsSet: h,
205
- axesToBeFixedSet: x,
169
+ components: s,
170
+ getSourceInfo: f,
171
+ fullOptionsSet: i,
206
172
  readyData: this.readyDataInputs(t),
207
- ready: this.readyForPlotBuilding(e, t, B, h, I),
208
- consistent: B
173
+ ready: this.readyForPlotBuilding(t, d, i, f),
174
+ consistent: d
209
175
  };
210
176
  }
211
- async getUniqueSourceValuesWithLabels(e, t, n, o, s, l) {
212
- var C;
213
- const a = (i) => i.sort((c, d) => c.label.localeCompare(d.label, "en", { numeric: !0 })), r = t.getSourceInfo(n), p = (C = r.annotations) == null ? void 0 : C[M];
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 = p ? JSON.parse(p).map((c) => String(c)) : null;
181
+ const i = l ? JSON.parse(l).map((m) => String(m)) : null;
216
182
  if (i) {
217
- const c = i.map((d) => ({ value: d, label: d }));
218
- return a(c), { values: c, overflow: !1 };
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 ${p} in ${n}`);
187
+ console.error(`Parsing error: discrete values annotation ${l} in ${o}`);
222
188
  }
223
189
  if (r.kind === "axis") {
224
- const i = k(n), c = r.parentSources.map(k), d = await G(e, n, r.parentSources);
225
- let g = [];
226
- if (d) {
227
- s && (g = [{
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: d.name
197
+ id: a.name
232
198
  },
233
199
  predicate: {
234
200
  operator: "StringIContains",
235
201
  substring: s
236
202
  }
237
- }]), l && (g = [{
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: l
211
+ substring: c
246
212
  }
247
213
  }]);
248
- const { data: x, axesData: B } = await e.pFrameProvider.getSingleColumnData(d, g), I = B[i.toCanonicalString()], u = [];
249
- for (let f = 0; f < Math.min(I.length, o ?? I.length); f++)
250
- u.push({ value: String(I[f]), label: String(x[f]) });
251
- return a(u), { values: u, overflow: !(o === void 0 || I.length < o) };
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 h = s ?? l;
254
- h && (g = [{
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: h
228
+ substring: f
263
229
  }
264
230
  }]);
265
- const y = await e.pFrameProvider.getAxisUniqueValues(i, [c[0]], o, g), E = y.values.map((x) => ({ value: String(x), label: String(x) }));
266
- return a(E), { values: E, overflow: y.overflow };
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 ?? l, c = k(n), d = i ? [{
235
+ const i = s ?? c, m = A(o), a = i ? [{
270
236
  type: "bySingleColumnV2",
271
237
  column: {
272
238
  type: "column",
273
- id: c.name
239
+ id: m.name
274
240
  },
275
241
  predicate: {
276
242
  operator: "StringIContains",
277
243
  substring: i
278
244
  }
279
- }] : [], g = await e.pFrameProvider.getColumnUniqueValues(c, o, d), h = g.values.map((y) => ({ value: String(y), label: String(y) }));
280
- return a(h), { values: h, overflow: g.overflow };
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
- async checkStateConsistency(e, t, n) {
285
- const o = /* @__PURE__ */ new Map();
286
- for (const s of Object.keys(this.simpleComponentControllers))
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
- await this.simpleComponentControllers[s].checkStateConsistency(e, t, n)
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
- async isConsistent(e, t, n) {
299
- const o = await this.checkStateConsistency(e, t, n);
300
- for (const s of o.values())
301
- if (Object.values(s).some((l) => !l))
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, n, o, s) {
309
- if (!n || !this.readyDataInputs(t))
269
+ readyForPlotBuilding(e, t, o, n) {
270
+ if (!t || !this.readyDataInputs(e))
310
271
  return !1;
311
- let l = !1;
312
- for (const a of o) {
313
- const r = s(a);
314
- if (r && r.kind === "axis" && r.mustBeConsumed) {
315
- l = !0;
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
- let C = !1;
320
- for (const { selectorStates: a } of Object.values(t.components)) {
321
- for (const { selectedSource: r, fixedAxes: p } of a) {
322
- const i = s(r);
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
- ee as ControllerBase
293
+ T as ControllerBase
347
294
  };
348
295
  //# sourceMappingURL=ControllerBase.js.map