@milaboratories/graph-maker 1.1.150 → 1.1.152
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/AesSettings/AesDataMappingDiscrete.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.js +2 -1
- package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.js.map +1 -1
- package/dist/GraphMaker/components/Chart.vue.js +3 -3
- package/dist/GraphMaker/components/Chart.vue.js.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.d.ts +3 -12
- package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.js +42 -85
- package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.js.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.d.ts +1 -9
- package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.js +44 -89
- 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 +68 -86
- package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.js.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts +7 -11
- package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js +48 -91
- package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js.map +1 -1
- package/dist/GraphMaker/components/DragAndDrop/types.d.ts +1 -21
- package/dist/GraphMaker/components/DragAndDrop/types.d.ts.map +1 -1
- package/dist/GraphMaker/components/PlColorSliderThumb.vue.js +18 -18
- package/dist/GraphMaker/components/PlColorSliderThumb.vue.js.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 +95 -95
- 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 +128 -166
- 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 +93 -131
- package/dist/GraphMaker/forms/DataMappingForm/useBaskets.js.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/utils.d.ts +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/utils.d.ts.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/utils.js +79 -155
- package/dist/GraphMaker/forms/DataMappingForm/utils.js.map +1 -1
- package/dist/GraphMaker/forms/index.js +2 -2
- package/dist/GraphMaker/forms/index.js.map +1 -1
- package/dist/GraphMaker/icons/StackedAreaIcon.vue.d.ts +3 -0
- package/dist/GraphMaker/icons/StackedAreaIcon.vue.d.ts.map +1 -0
- package/dist/GraphMaker/icons/StackedAreaIcon.vue.js +19 -0
- package/dist/GraphMaker/icons/StackedAreaIcon.vue.js.map +1 -0
- package/dist/GraphMaker/index.vue.js +1 -1
- package/dist/GraphMaker/store.d.ts.map +1 -1
- package/dist/GraphMaker/store.js +43 -45
- package/dist/GraphMaker/store.js.map +1 -1
- package/dist/GraphMaker/types.d.ts +1 -1
- package/dist/GraphMaker/types.d.ts.map +1 -1
- package/dist/GraphMaker/utils/addFixedOptionsToState.js +2 -2
- package/dist/GraphMaker/utils/addFixedOptionsToState.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.js +25 -25
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.d.ts +2 -3
- package/dist/GraphMaker/utils/loadDefaultSources.d.ts.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.js +47 -51
- 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 +39 -41
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/node_modules/@milaboratories/helpers/dist/objects.js +33 -0
- package/dist/node_modules/@milaboratories/helpers/dist/objects.js.map +1 -0
- package/dist/node_modules/@milaboratories/helpers/dist/utils.js +12 -0
- package/dist/node_modules/@milaboratories/helpers/dist/utils.js.map +1 -0
- 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 +168 -221
- 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 +184 -183
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
- package/dist/node_modules/@vueuse/shared/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/node_modules/@milaboratories/helpers/dist/index.js +0 -372
- package/dist/node_modules/@milaboratories/helpers/dist/index.js.map +0 -1
|
@@ -1,214 +1,138 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return b({
|
|
1
|
+
import { computed as p } from "vue";
|
|
2
|
+
function I(e, t, o, n, r) {
|
|
3
|
+
return p({
|
|
5
4
|
get() {
|
|
6
|
-
return e.value.components[
|
|
5
|
+
return e.value.components[t].selectorStates.map((s) => s.selectedSource);
|
|
7
6
|
},
|
|
8
|
-
set(
|
|
7
|
+
set(s) {
|
|
9
8
|
if (!n)
|
|
10
9
|
return;
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
10
|
+
const c = s.map((l) => {
|
|
11
|
+
const a = e.value.components[t].selectorStates.find((u) => u.selectedSource === l);
|
|
12
|
+
if (a)
|
|
13
|
+
return a;
|
|
15
14
|
{
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let f;
|
|
20
|
-
if (d)
|
|
21
|
-
for (const { selectorStates: g } of Object.values(e.value.components)) {
|
|
22
|
-
for (const F of g) {
|
|
23
|
-
const S = (p = (m = F.fixedAxes) == null ? void 0 : m.find(
|
|
24
|
-
(v) => v.axisSource === r && v.axisValue !== void 0
|
|
25
|
-
)) == null ? void 0 : p.axisValue;
|
|
26
|
-
if (S) {
|
|
27
|
-
f = S;
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (f)
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
axisSource: r,
|
|
36
|
-
axisIdx: l.axesToBeFixedIndexes[r],
|
|
37
|
-
axisValue: f
|
|
38
|
-
};
|
|
39
|
-
}) : [];
|
|
40
|
-
return l.isSubsetFilter ? { selectedSource: i, type: "subset", fixedAxes: a } : l.isDiscreteFilter ? {
|
|
41
|
-
selectedSource: i,
|
|
15
|
+
const u = r.value.getSourceInfo(l);
|
|
16
|
+
return u.isSubsetFilter ? { selectedSource: l, type: "subset" } : u.isDiscreteFilter ? {
|
|
17
|
+
selectedSource: l,
|
|
42
18
|
type: "equals",
|
|
43
|
-
selectedFilterValue: void 0
|
|
44
|
-
fixedAxes: a
|
|
19
|
+
selectedFilterValue: void 0
|
|
45
20
|
} : {
|
|
46
|
-
selectedSource:
|
|
21
|
+
selectedSource: l,
|
|
47
22
|
type: "range",
|
|
48
|
-
selectedFilterRange: { min: void 0, max: void 0 }
|
|
49
|
-
fixedAxes: a
|
|
23
|
+
selectedFilterRange: { min: void 0, max: void 0 }
|
|
50
24
|
};
|
|
51
25
|
}
|
|
52
26
|
});
|
|
53
|
-
e.value = o.changeSelected(
|
|
27
|
+
e.value = o.changeSelected(t, n, e.value, c);
|
|
54
28
|
}
|
|
55
29
|
});
|
|
56
30
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
31
|
+
function F(e, t, o, n, r) {
|
|
32
|
+
return p({
|
|
59
33
|
get() {
|
|
60
|
-
return e.value.components[
|
|
34
|
+
return e.value.components[t].selectorStates.map((s) => s.selectedSource);
|
|
61
35
|
},
|
|
62
|
-
set(
|
|
36
|
+
set(s) {
|
|
63
37
|
if (!n)
|
|
64
38
|
return;
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
return x;
|
|
69
|
-
{
|
|
70
|
-
const l = c.value.getSourceInfo(i), a = l.kind === "column" ? l.axesToBeFixed.map((r) => {
|
|
71
|
-
var m, p;
|
|
72
|
-
const d = c.value.axesToBeFixedSet.has(r);
|
|
73
|
-
let f;
|
|
74
|
-
if (d)
|
|
75
|
-
for (const { selectorStates: g } of Object.values(e.value.components)) {
|
|
76
|
-
for (const F of g) {
|
|
77
|
-
const S = (p = (m = F.fixedAxes) == null ? void 0 : m.find(
|
|
78
|
-
(v) => v.axisSource === r && v.axisValue !== void 0
|
|
79
|
-
)) == null ? void 0 : p.axisValue;
|
|
80
|
-
if (S) {
|
|
81
|
-
f = S;
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (f)
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
axisSource: r,
|
|
90
|
-
axisIdx: l.axesToBeFixedIndexes[r],
|
|
91
|
-
axisValue: f
|
|
92
|
-
};
|
|
93
|
-
}) : [];
|
|
94
|
-
return { selectedSource: i, fixedAxes: a };
|
|
95
|
-
}
|
|
39
|
+
const c = s.map((l) => {
|
|
40
|
+
const a = e.value.components[t].selectorStates.find((u) => u.selectedSource === l);
|
|
41
|
+
return a || { selectedSource: l };
|
|
96
42
|
});
|
|
97
|
-
e.value = o.changeSelected(
|
|
43
|
+
e.value = o.changeSelected(t, n, e.value, c);
|
|
98
44
|
}
|
|
99
45
|
});
|
|
100
46
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
47
|
+
function y(e, t, o, n) {
|
|
48
|
+
return p({
|
|
103
49
|
get() {
|
|
104
|
-
var
|
|
105
|
-
return ((
|
|
50
|
+
var r;
|
|
51
|
+
return ((r = e.value.components[t].selectorStates.map((s) => s.selectedSource)) == null ? void 0 : r[0]) ?? void 0;
|
|
106
52
|
},
|
|
107
|
-
set(
|
|
108
|
-
n && (e.value = o.changeSelected(
|
|
53
|
+
set(r) {
|
|
54
|
+
n && (e.value = o.changeSelected(t, n, e.value, typeof r > "u" ? [] : [{ selectedSource: r }]));
|
|
109
55
|
}
|
|
110
56
|
});
|
|
111
57
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
text:
|
|
115
|
-
value:
|
|
116
|
-
}));
|
|
117
|
-
return o.selectorStates.map((t) => t.selectedSource).forEach((t) => {
|
|
118
|
-
const u = s(t), i = e.stateConsistency[t] === !1;
|
|
119
|
-
n.unshift({
|
|
120
|
-
text: i ? "Inconsistent value" : u.label,
|
|
121
|
-
value: t
|
|
122
|
-
});
|
|
123
|
-
}), n.sort((t, u) => t.text > u.text ? 1 : -1);
|
|
58
|
+
function d(e, t) {
|
|
59
|
+
return e.options.map((n) => ({
|
|
60
|
+
text: t(n.value).label,
|
|
61
|
+
value: e.stateConsistency[n.value] === !1 ? "Inconsistent value" : n.value
|
|
62
|
+
})).sort((n, r) => n.text > r.text ? 1 : -1);
|
|
124
63
|
}
|
|
125
|
-
function
|
|
64
|
+
function x(e, t) {
|
|
126
65
|
return Object.keys(e.components).reduce(
|
|
127
|
-
(o, n) => (o[n] =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
e.components[n]
|
|
66
|
+
(o, n) => (o[n] = d(
|
|
67
|
+
t.value.components[n],
|
|
68
|
+
t.value.getSourceInfo
|
|
131
69
|
), o),
|
|
132
70
|
{}
|
|
133
71
|
);
|
|
134
72
|
}
|
|
135
|
-
function
|
|
73
|
+
function f(e, t) {
|
|
136
74
|
if (!e.value.readyData)
|
|
137
75
|
return [];
|
|
138
76
|
const o = /* @__PURE__ */ new Set();
|
|
139
|
-
return
|
|
77
|
+
return t.forEach(
|
|
140
78
|
(n) => {
|
|
141
|
-
e.value.components[n].options.forEach(({ value:
|
|
142
|
-
o.add(
|
|
79
|
+
e.value.components[n].options.forEach(({ value: s }) => {
|
|
80
|
+
o.add(s);
|
|
143
81
|
});
|
|
144
82
|
}
|
|
145
83
|
), [...o].map((n) => ({
|
|
146
84
|
id: n,
|
|
147
85
|
info: e.value.getSourceInfo(n)
|
|
148
|
-
})).sort((n,
|
|
86
|
+
})).sort((n, r) => n.info.label.localeCompare(r.info.label));
|
|
149
87
|
}
|
|
150
|
-
function
|
|
151
|
-
return
|
|
88
|
+
function k(e, t) {
|
|
89
|
+
return f(e, t).filter(
|
|
152
90
|
({ info: o }) => o.kind !== "axis" || !o.mustBeConsumed
|
|
153
91
|
);
|
|
154
92
|
}
|
|
155
|
-
function
|
|
156
|
-
return
|
|
93
|
+
function O(e, t) {
|
|
94
|
+
return f(e, t).filter(
|
|
157
95
|
({ info: o }) => o.kind === "axis" && o.mustBeConsumed
|
|
158
96
|
);
|
|
159
97
|
}
|
|
160
|
-
function
|
|
161
|
-
return Object.values(
|
|
162
|
-
}
|
|
163
|
-
function w(e, s) {
|
|
164
|
-
return y(e, s) ? " " : "";
|
|
98
|
+
function g(e, t) {
|
|
99
|
+
return Object.values(t.components[e].stateConsistency).some((o) => !o);
|
|
165
100
|
}
|
|
166
|
-
function h(e) {
|
|
167
|
-
|
|
168
|
-
const s = (o = e == null ? void 0 : e[k]) == null ? void 0 : o.toLowerCase();
|
|
169
|
-
return !!s && s !== "homogenous" && s !== "homogeneous";
|
|
101
|
+
function h(e, t) {
|
|
102
|
+
return g(e, t) ? " " : "";
|
|
170
103
|
}
|
|
171
|
-
function
|
|
172
|
-
return
|
|
173
|
-
var
|
|
174
|
-
const
|
|
104
|
+
function C(e, t, o, n) {
|
|
105
|
+
return n.reduce((r, s) => {
|
|
106
|
+
var m;
|
|
107
|
+
const c = e.getSourceInfo(s), a = [
|
|
175
108
|
...Object.keys(e.components).filter(
|
|
176
|
-
(
|
|
177
|
-
(
|
|
109
|
+
(i) => e.components[i].options.find(
|
|
110
|
+
(v) => v.value === s && !t[i].selectorStates.some((S) => S.selectedSource === s)
|
|
178
111
|
)
|
|
179
112
|
)
|
|
180
|
-
],
|
|
181
|
-
return
|
|
182
|
-
id:
|
|
183
|
-
title:
|
|
184
|
-
type:
|
|
185
|
-
nonHomogenous:
|
|
186
|
-
isSubsetFilter:
|
|
187
|
-
isDiscreteFilter:
|
|
188
|
-
availableBasketIds: new Set(
|
|
189
|
-
uniqueValues: (((
|
|
190
|
-
|
|
191
|
-
axesToBeFixedInfo: t.kind === "column" ? t.axesToBeFixed.reduce((a, r) => {
|
|
192
|
-
const d = e.getSourceInfo(r);
|
|
193
|
-
return a[r] = {
|
|
194
|
-
title: d.label,
|
|
195
|
-
type: d.type,
|
|
196
|
-
idx: t.axesToBeFixedIndexes[r]
|
|
197
|
-
}, a;
|
|
198
|
-
}, {}) : {}
|
|
199
|
-
}, n;
|
|
113
|
+
], u = Object.values(e.components).some(({ stateConsistency: i }) => i[s] === !1);
|
|
114
|
+
return r[s] = {
|
|
115
|
+
id: s,
|
|
116
|
+
title: u ? "Inconsistent value" : c.label,
|
|
117
|
+
type: c.type,
|
|
118
|
+
nonHomogenous: c.kind === "axis" && c.isNonHomogenous,
|
|
119
|
+
isSubsetFilter: c.isSubsetFilter,
|
|
120
|
+
isDiscreteFilter: c.isDiscreteFilter,
|
|
121
|
+
availableBasketIds: new Set(a),
|
|
122
|
+
uniqueValues: (((m = o[s]) == null ? void 0 : m.options) ?? []).map((i) => i.label)
|
|
123
|
+
}, r;
|
|
200
124
|
}, {});
|
|
201
125
|
}
|
|
202
126
|
export {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
127
|
+
x as getAllInputsOptions,
|
|
128
|
+
C as getChipInfo,
|
|
129
|
+
h as getErrorForPlDropdown,
|
|
130
|
+
O as getFreeMandatoryOptions,
|
|
131
|
+
k as getFreeMetaOptions,
|
|
132
|
+
f as getFreeOptions,
|
|
133
|
+
g as hasInputError,
|
|
134
|
+
I as toFiltersMulti,
|
|
135
|
+
F as toSimpleMulti,
|
|
136
|
+
y as toSimpleSingle
|
|
213
137
|
};
|
|
214
138
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/GraphMaker/forms/DataMappingForm/utils.ts"],"sourcesContent":["import {\n AxisData,\n ColumnData,\n ComponentGuideFilter,\n ComponentGuideSimple,\n ComponentStateFilter,\n ComponentStateSimple, Controller, DemoDataStore,\n InputGuide,\n InputState, PValue, SelectorStateSimple\n} from '@milaboratories/pf-plots';\nimport { computed, Ref } from 'vue';\nimport { ChipInfo } from '../../components/DragAndDrop/types';\nimport { AxisSpec } from '@platforma-sdk/model';\nimport { AXIS_NATURE_KEY } from '../../constantsCommon';\nimport { UniqueValuesBySourceMap } from '../../types';\n\ntype Option = { text: string; value: string }; // as an Option type in pl-uikit\n\n/** Bidirectionally extracts selectedSource from the filter state,\n * and preserve selectedFilterValue in unmodified items on write. */\nexport function toFiltersMulti(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n refToInputGuide: Ref<InputGuide<InputState>>\n): Ref<string[]> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource);\n },\n set(nextSelected) {\n if (!store) {\n return;\n }\n const nextSelectorStates = nextSelected.map((s) => {\n const el = refToState.value.components[inputName].selectorStates.find((v) => v.selectedSource === s);\n if (el) {\n return el;\n } else {\n const info = refToInputGuide.value.getSourceInfo(s);\n const fixedAxes:SelectorStateSimple['fixedAxes'] = info.kind === 'column' ? info.axesToBeFixed.map(id => {\n const selectedAxisExist = refToInputGuide.value.axesToBeFixedSet.has(id);\n let axisValue:PValue | undefined = undefined;\n if (selectedAxisExist) {\n for (const { selectorStates } of Object.values(refToState.value.components)) {\n for (const selectorState of selectorStates) {\n const existingFixedAxis = selectorState.fixedAxes?.find(\n data => data.axisSource === id && data.axisValue !== undefined\n )?.axisValue\n if (existingFixedAxis) {\n axisValue = existingFixedAxis;\n break;\n }\n }\n if (axisValue) {\n break;\n }\n }\n }\n return ({\n axisSource: id,\n axisIdx: info.axesToBeFixedIndexes[id],\n axisValue: axisValue as unknown as PValue\n })\n }) : [];\n return info.isSubsetFilter\n ? { selectedSource: s, type: 'subset', fixedAxes }\n : info.isDiscreteFilter\n ? {\n selectedSource: s,\n type: 'equals',\n selectedFilterValue: undefined,\n fixedAxes\n }\n : {\n selectedSource: s,\n type: 'range',\n selectedFilterRange: { min: undefined, max: undefined },\n fixedAxes\n };\n }\n });\n refToState.value = controller.changeSelected(inputName, store, refToState.value, nextSelectorStates);\n }\n });\n}\n\nexport function toSimpleMulti(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n refToInputGuide: Ref<InputGuide<InputState>>\n): Ref<string[]> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource);\n },\n set(nextSelected: string[]) {\n if (!store) {\n return;\n }\n const nextSelectorStates = nextSelected.map((s) => {\n const el = refToState.value.components[inputName].selectorStates.find((v) => v.selectedSource === s);\n if (el) {\n return el;\n } else {\n // if there is already some fixed axes with this value in state we want to set the same\n const info = refToInputGuide.value.getSourceInfo(s);\n const fixedAxes:SelectorStateSimple['fixedAxes'] = info.kind === 'column' ? info.axesToBeFixed.map(id => {\n const selectedAxisExist = refToInputGuide.value.axesToBeFixedSet.has(id);\n let axisValue:PValue | undefined = undefined;\n if (selectedAxisExist) {\n for (const { selectorStates } of Object.values(refToState.value.components)) {\n for (const selectorState of selectorStates) {\n const existingFixedAxis = selectorState.fixedAxes?.find(\n data => data.axisSource === id && data.axisValue !== undefined\n )?.axisValue\n if (existingFixedAxis) {\n axisValue = existingFixedAxis;\n break;\n }\n }\n if (axisValue) {\n break;\n }\n }\n }\n return ({\n axisSource: id,\n axisIdx: info.axesToBeFixedIndexes[id],\n axisValue: axisValue as unknown as PValue\n })\n }) : [];\n return { selectedSource: s, fixedAxes }\n }\n });\n refToState.value = controller.changeSelected(inputName, store, refToState.value, nextSelectorStates);\n }\n });\n}\n\nexport function toSimpleSingle(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null\n): Ref<string | undefined> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource)?.[0] ?? undefined;\n },\n set(newValue: string | undefined) {\n if (!store) {\n return;\n }\n refToState.value = controller.changeSelected(inputName, store, refToState.value, typeof newValue === 'undefined' ? [] : [{ selectedSource: newValue }]);\n }\n });\n}\n\nexport type AllStateOptions<State extends InputState> = {\n [K in keyof State['components']]: Option[];\n};\n\nfunction getInputOptions(\n guide: ComponentGuideSimple | ComponentGuideFilter,\n getSourceInfo: (optionId: string) => ColumnData | AxisData,\n state: ComponentStateSimple | ComponentStateFilter\n): Option[] {\n const options = guide.options.map((v) => ({\n text: getSourceInfo(v.value).label,\n value: v.value\n }));\n let selectedStates: string[] = state.selectorStates.map((s) => s.selectedSource);\n selectedStates.forEach((value) => {\n const stateInfo = getSourceInfo(value);\n const isInconsistent = guide.stateConsistency[value] === false;\n options.unshift({\n text: isInconsistent ? 'Inconsistent value' : stateInfo.label,\n value\n });\n });\n return options.sort((a, b) => (a.text > b.text ? 1 : -1));\n}\n\nexport function getAllInputsOptions<T extends InputState>(\n inputState: T,\n inputGuide: Ref<InputGuide<T>>\n): AllStateOptions<T> {\n return Object.keys(inputState.components).reduce(\n (res: Record<string, Option[]>, name) => {\n res[name] = getInputOptions(\n inputGuide.value.components[name],\n inputGuide.value.getSourceInfo,\n inputState.components[name]\n );\n return res;\n },\n {}\n ) as AllStateOptions<T>;\n}\n\nexport function getFreeOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n if (!inputGuide.value.readyData) {\n return [];\n }\n const optionsSet = new Set<string>();\n basketsIds.forEach((id) => {\n const item: ComponentGuideFilter | ComponentGuideSimple = inputGuide.value.components[id];\n item.options.forEach(({ value }) => {\n optionsSet.add(value);\n });\n }\n );\n return [...optionsSet].map((id) => ({\n id,\n info: inputGuide.value.getSourceInfo(id)\n })).sort((a, b) => a.info.label.localeCompare(b.info.label));\n}\n\nexport function getFreeMetaOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n return getFreeOptions(inputGuide, basketsIds).filter(\n ({ info }) => info.kind !== 'axis' || !info.mustBeConsumed\n );\n}\n\nexport function getFreeMandatoryOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n return getFreeOptions(inputGuide, basketsIds).filter(({ info }) =>\n info.kind === 'axis' && info.mustBeConsumed\n );\n}\n\nexport function hasInputError<T extends InputState>(\n name: keyof T['components'],\n inputGuide: InputGuide<T>\n) {\n return Object.values(inputGuide.components[name].stateConsistency).some((v) => !v);\n}\n\nexport function getErrorForPlDropdown<T extends InputState>(\n name: keyof T['components'],\n inputGuide: InputGuide<T>\n) {\n return hasInputError(name, inputGuide) ? ' ' : ''; // if return value is not empty, dropdown marked with red frame\n}\n\nfunction axisIsNonHomogenous(annotations: AxisSpec['annotations']) {\n const axisNature = annotations?.[AXIS_NATURE_KEY]?.toLowerCase();\n return Boolean(axisNature) && axisNature !== 'homogenous' && axisNature !== 'homogeneous';\n}\n\nexport function getChipInfo(\n inputGuide: InputGuide<InputState>,\n labelsInfo: UniqueValuesBySourceMap,\n sourceIds: string[]\n): Record<string, ChipInfo> {\n return sourceIds.reduce((res: Record<string, ChipInfo>, id) => {\n const info = inputGuide.getSourceInfo(id);\n const basketsMeta = Object.keys(inputGuide.components);\n const availableBasketsIds = [\n ...basketsMeta.filter((name) =>\n inputGuide.components[name].options.find(\n (option) => option.value === id\n )\n )\n ];\n const isInconsistent = Object.values(inputGuide.components).some(({ stateConsistency }) => stateConsistency[id] === false);\n res[id] = {\n id,\n title: isInconsistent ? 'Inconsistent value' : info.label,\n type: info.type,\n nonHomogenous: info.kind === 'axis' && axisIsNonHomogenous(info.annotations),\n isSubsetFilter: info.isSubsetFilter,\n isDiscreteFilter: info.isDiscreteFilter,\n availableBasketIds: new Set(availableBasketsIds),\n uniqueValues: (labelsInfo[id]?.options ?? []).map(v => v.label),\n axesToBeFixed: info.kind === 'column' ? info.axesToBeFixed : [],\n axesToBeFixedInfo: info.kind === 'column' ? info.axesToBeFixed.reduce((res:ChipInfo['axesToBeFixedInfo'], axisId) => {\n const axisInfo = inputGuide.getSourceInfo(axisId);\n res[axisId] = {\n title: axisInfo.label,\n type: axisInfo.type,\n idx: info.axesToBeFixedIndexes[axisId],\n };\n return res;\n }, {}) : {}\n };\n return res;\n }, {});\n}\n"],"names":["toFiltersMulti","refToState","inputName","controller","store","refToInputGuide","computed","v","nextSelected","nextSelectorStates","s","el","info","fixedAxes","id","selectedAxisExist","axisValue","selectorStates","selectorState","existingFixedAxis","_b","_a","data","toSimpleMulti","toSimpleSingle","newValue","getInputOptions","guide","getSourceInfo","state","options","value","stateInfo","isInconsistent","a","b","getAllInputsOptions","inputState","inputGuide","res","name","getFreeOptions","basketsIds","optionsSet","getFreeMetaOptions","getFreeMandatoryOptions","hasInputError","getErrorForPlDropdown","axisIsNonHomogenous","annotations","axisNature","AXIS_NATURE_KEY","getChipInfo","labelsInfo","sourceIds","availableBasketsIds","option","stateConsistency","axisId","axisInfo"],"mappings":";;AAoBO,SAASA,EACdC,GACAC,GACAC,GACAC,GACAC,GACe;AACf,SAAOC,EAAS;AAAA,IACd,MAAM;AACJ,aAAOL,EAAW,MAAM,WAAWC,CAAS,EAAE,eAAe,IAAI,CAACK,MAAMA,EAAE,cAAc;AAAA,IAC1F;AAAA,IACA,IAAIC,GAAc;AAChB,UAAI,CAACJ;AACH;AAEF,YAAMK,IAAqBD,EAAa,IAAI,CAACE,MAAM;AACjD,cAAMC,IAAKV,EAAW,MAAM,WAAWC,CAAS,EAAE,eAAe,KAAK,CAACK,MAAMA,EAAE,mBAAmBG,CAAC;AACnG,YAAIC;AACF,iBAAOA;AACF;AACL,gBAAMC,IAAOP,EAAgB,MAAM,cAAcK,CAAC,GAC5CG,IAA6CD,EAAK,SAAS,WAAWA,EAAK,cAAc,IAAI,CAAAE,MAAM;;AACvG,kBAAMC,IAAoBV,EAAgB,MAAM,iBAAiB,IAAIS,CAAE;AACvE,gBAAIE;AACJ,gBAAID;AACF,yBAAW,EAAE,gBAAAE,OAAoB,OAAO,OAAOhB,EAAW,MAAM,UAAU,GAAG;AAC3E,2BAAWiB,KAAiBD,GAAgB;AAC1C,wBAAME,KAAoBC,KAAAC,IAAAH,EAAc,cAAd,gBAAAG,EAAyB;AAAA,oBACjD,CAAAC,MAAQA,EAAK,eAAeR,KAAMQ,EAAK,cAAc;AAAA,wBAD7B,gBAAAF,EAEvB;AACH,sBAAID,GAAmB;AACrB,oBAAAH,IAAYG;AACZ;AAAA,kBACF;AAAA,gBACF;AACA,oBAAIH;AACF;AAAA,cAEJ;AAEF,mBAAQ;AAAA,cACN,YAAYF;AAAA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BpC,EAAK,WAAW;AAAA,MAC3E,gBAAgBA,EAAK;AAAA,MACrB,kBAAkBA,EAAK;AAAA,MACvB,oBAAoB,IAAI,IAAI2C,CAAmB;AAAA,MAC/C,iBAAelC,IAAAgC,EAAWvC,CAAE,MAAb,gBAAAO,EAAgB,YAAW,IAAI,IAAI,CAAAd,MAAKA,EAAE,KAAK;AAAA,MAC9D,eAAeK,EAAK,SAAS,WAAWA,EAAK,gBAAgB,CAAA;AAAA,MAC7D,mBAAmBA,EAAK,SAAS,WAAWA,EAAK,cAAc,OAAO,CAAC2B,GAAmCmB,MAAW;AACnH,cAAMC,IAAWrB,EAAW,cAAcoB,CAAM;AAChDnB,eAAAA,EAAImB,CAAM,IAAI;AAAA,UACZ,OAAOC,EAAS;AAAA,UAChB,MAAMA,EAAS;AAAA,UACf,KAAK/C,EAAK,qBAAqB8C,CAAM;AAAA,QAAA,GAEhCnB;AAAAA,MACT,GAAG,CAAA,CAAE,IAAI,CAAA;AAAA,IAAC,GAELA;AAAA,EACT,GAAG,CAAA,CAAE;AACP;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/GraphMaker/forms/DataMappingForm/utils.ts"],"sourcesContent":["import {\n AxisData,\n ColumnData,\n ComponentGuideFilter,\n ComponentGuideSimple,\n Controller,\n DemoDataStore,\n InputGuide,\n InputState\n} from '@milaboratories/pf-plots';\nimport { computed, Ref } from 'vue';\nimport { ChipInfo } from '../../components/DragAndDrop/types';\nimport { ReactiveState, UniqueValuesBySourceMap } from '../../types';\n\ntype Option = { text: string; value: string }; // as an Option type in pl-uikit\n\n/** Bidirectionally extracts selectedSource from the filter state,\n * and preserve selectedFilterValue in unmodified items on write. */\nexport function toFiltersMulti(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n refToInputGuide: Ref<InputGuide<InputState>>\n): Ref<string[]> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource);\n },\n set(nextSelected) {\n if (!store) {\n return;\n }\n const nextSelectorStates = nextSelected.map((s) => {\n const el = refToState.value.components[inputName].selectorStates.find((v) => v.selectedSource === s);\n if (el) {\n return el;\n } else {\n const info = refToInputGuide.value.getSourceInfo(s);\n return info.isSubsetFilter\n ? { selectedSource: s, type: 'subset' }\n : info.isDiscreteFilter\n ? {\n selectedSource: s,\n type: 'equals',\n selectedFilterValue: undefined\n }\n : {\n selectedSource: s,\n type: 'range',\n selectedFilterRange: { min: undefined, max: undefined }\n };\n }\n });\n refToState.value = controller.changeSelected(inputName, store, refToState.value, nextSelectorStates);\n }\n });\n}\n\nexport function toSimpleMulti(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n refToInputGuide: Ref<InputGuide<InputState>>\n): Ref<string[]> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource);\n },\n set(nextSelected: string[]) {\n if (!store) {\n return;\n }\n const nextSelectorStates = nextSelected.map((s) => {\n const el = refToState.value.components[inputName].selectorStates.find((v) => v.selectedSource === s);\n if (el) {\n return el;\n } else {\n return { selectedSource: s }\n }\n });\n refToState.value = controller.changeSelected(inputName, store, refToState.value, nextSelectorStates);\n }\n });\n}\n\nexport function toSimpleSingle(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null\n): Ref<string | undefined> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource)?.[0] ?? undefined;\n },\n set(newValue: string | undefined) {\n if (!store) {\n return;\n }\n refToState.value = controller.changeSelected(inputName, store, refToState.value, typeof newValue === 'undefined' ? [] : [{ selectedSource: newValue }]);\n }\n });\n}\n\nexport type AllStateOptions<State extends InputState> = {\n [K in keyof State['components']]: Option[];\n};\n\nfunction getInputOptions(\n guide: ComponentGuideSimple | ComponentGuideFilter,\n getSourceInfo: (optionId: string) => ColumnData | AxisData,\n): Option[] {\n const options = guide.options.map((v) => ({\n text: getSourceInfo(v.value).label,\n value: guide.stateConsistency[v.value] === false ? 'Inconsistent value' : v.value\n }));\n return options.sort((a, b) => (a.text > b.text ? 1 : -1));\n}\n\nexport function getAllInputsOptions<T extends InputState>(\n inputState: T,\n inputGuide: Ref<InputGuide<T>>\n): AllStateOptions<T> {\n return Object.keys(inputState.components).reduce(\n (res: Record<string, Option[]>, name) => {\n res[name] = getInputOptions(\n inputGuide.value.components[name],\n inputGuide.value.getSourceInfo\n );\n return res;\n },\n {}\n ) as AllStateOptions<T>;\n}\n\nexport function getFreeOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n if (!inputGuide.value.readyData) {\n return [];\n }\n const optionsSet = new Set<string>();\n basketsIds.forEach((id) => {\n const item: ComponentGuideFilter | ComponentGuideSimple = inputGuide.value.components[id];\n item.options.forEach(({ value }) => {\n optionsSet.add(value);\n });\n }\n );\n return [...optionsSet].map((id) => ({\n id,\n info: inputGuide.value.getSourceInfo(id)\n })).sort((a, b) => a.info.label.localeCompare(b.info.label));\n}\n\nexport function getFreeMetaOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n return getFreeOptions(inputGuide, basketsIds).filter(\n ({ info }) => info.kind !== 'axis' || !info.mustBeConsumed\n );\n}\n\nexport function getFreeMandatoryOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n return getFreeOptions(inputGuide, basketsIds).filter(({ info }) =>\n info.kind === 'axis' && info.mustBeConsumed\n );\n}\n\nexport function hasInputError<T extends InputState>(\n name: keyof T['components'],\n inputGuide: InputGuide<T>\n) {\n return Object.values(inputGuide.components[name].stateConsistency).some((v) => !v);\n}\n\nexport function getErrorForPlDropdown<T extends InputState>(\n name: keyof T['components'],\n inputGuide: InputGuide<T>\n) {\n return hasInputError(name, inputGuide) ? ' ' : ''; // if return value is not empty, dropdown marked with red frame\n}\n\nexport function getChipInfo(\n inputGuide: InputGuide<InputState>,\n optionsState: InputState['components'],\n labelsInfo: UniqueValuesBySourceMap,\n sourceIds: string[]\n): Record<string, ChipInfo> {\n return sourceIds.reduce((res: Record<string, ChipInfo>, id) => {\n const info = inputGuide.getSourceInfo(id);\n const basketsMeta = Object.keys(inputGuide.components);\n const availableBasketsIds = [\n ...basketsMeta.filter((name) =>\n inputGuide.components[name].options.find(\n (option) => option.value === id &&\n !optionsState[name].selectorStates.some(s => s.selectedSource === id)\n )\n )\n ];\n const isInconsistent = Object.values(inputGuide.components).some(({ stateConsistency }) => stateConsistency[id] === false);\n res[id] = {\n id,\n title: isInconsistent ? 'Inconsistent value' : info.label,\n type: info.type,\n nonHomogenous: info.kind === 'axis' && info.isNonHomogenous,\n isSubsetFilter: info.isSubsetFilter,\n isDiscreteFilter: info.isDiscreteFilter,\n availableBasketIds: new Set(availableBasketsIds),\n uniqueValues: (labelsInfo[id]?.options ?? []).map(v => v.label)\n };\n return res;\n }, {});\n}\n"],"names":["toFiltersMulti","refToState","inputName","controller","store","refToInputGuide","computed","v","nextSelected","nextSelectorStates","s","el","info","toSimpleMulti","toSimpleSingle","_a","newValue","getInputOptions","guide","getSourceInfo","a","b","getAllInputsOptions","inputState","inputGuide","res","name","getFreeOptions","basketsIds","optionsSet","id","value","getFreeMetaOptions","getFreeMandatoryOptions","hasInputError","getErrorForPlDropdown","getChipInfo","optionsState","labelsInfo","sourceIds","availableBasketsIds","option","isInconsistent","stateConsistency"],"mappings":";AAkBO,SAASA,EACdC,GACAC,GACAC,GACAC,GACAC,GACe;AACf,SAAOC,EAAS;AAAA,IACd,MAAM;AACJ,aAAOL,EAAW,MAAM,WAAWC,CAAS,EAAE,eAAe,IAAI,CAACK,MAAMA,EAAE,cAAc;AAAA,IAC1F;AAAA,IACA,IAAIC,GAAc;AAChB,UAAI,CAACJ;AACH;AAEF,YAAMK,I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AACzH,WAAAL,EAAIK,CAAE,IAAI;AAAA,MACR,IAAAA;AAAA,MACA,OAAOY,IAAiB,uBAAuB9B,EAAK;AAAA,MACpD,MAAMA,EAAK;AAAA,MACX,eAAeA,EAAK,SAAS,UAAUA,EAAK;AAAA,MAC5C,gBAAgBA,EAAK;AAAA,MACrB,kBAAkBA,EAAK;AAAA,MACvB,oBAAoB,IAAI,IAAI4B,CAAmB;AAAA,MAC/C,iBAAezB,IAAAuB,EAAWR,CAAE,MAAb,gBAAAf,EAAgB,YAAW,CAAA,GAAI,IAAI,CAAAR,MAAKA,EAAE,KAAK;AAAA,IAAA,GAEzDkB;AAAA,EACT,GAAG,CAAA,CAAE;AACP;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { setProp as m } from "../../node_modules/@milaboratories/helpers/dist/objects.js";
|
|
2
2
|
import { useComponent as c } from "../composition/useComponent.js";
|
|
3
3
|
import p from "../components/SettingsTabs/icons/AxesIcon.vue.js";
|
|
4
4
|
import s from "../components/SettingsTabs/icons/DeleteChartIcon.vue.js";
|
|
@@ -73,7 +73,7 @@ function J(t) {
|
|
|
73
73
|
return o[t].title ?? "";
|
|
74
74
|
}
|
|
75
75
|
function N(t) {
|
|
76
|
-
const n = Object.entries(o).reduce((e, [i, r]) => m
|
|
76
|
+
const n = Object.entries(o).reduce((e, [i, r]) => m(e, i, r.component), {});
|
|
77
77
|
return c(n, t);
|
|
78
78
|
}
|
|
79
79
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/GraphMaker/forms/index.ts"],"sourcesContent":["import { objects } from '@milaboratories/helpers';\nimport { MaybeRef } from '@platforma-sdk/ui-vue';\nimport { Component } from 'vue';\nimport { useComponent } from '../composition/useComponent';\nimport AxisIcon from '../components/SettingsTabs/icons/AxesIcon.vue';\nimport DeleteChartIcon from '../components/SettingsTabs/icons/DeleteChartIcon.vue';\nimport ExportIcon from '../components/SettingsTabs/icons/ExportIcon.vue';\nimport LayersIcon from '../components/SettingsTabs/icons/LayersIcon.vue';\nimport LinkIcon from '../components/SettingsTabs/icons/LinkIcon.vue';\nimport SettingsIcon from '../components/SettingsTabs/icons/SettingsIcon.vue';\nimport LogIcon from '../components/SettingsTabs/icons/LogIcon.vue';\nimport StatisticsIcon from '../icons/StatisticsIcon.vue';\nimport TemplateIcon from '../icons/TemplateIcon.vue';\nimport AxesSettingsForm from './AxesSettingsForm/index.vue';\nimport DataMappingForm from './DataMappingForm/index.vue';\nimport LayersForm from './LayersForm/index.vue';\nimport SettingsForm from './SettingsForm.vue';\nimport LogForm from './LogForm.vue';\nimport StatisticsForm from './StatisticsForm/index.vue';\nimport TemplateForm from './TemplateForm.vue';\n\nconst forms = {\n settings: {\n icon: SettingsIcon,\n component: SettingsForm,\n title: 'Settings'\n },\n log: {\n icon: LogIcon,\n component: LogForm,\n title: 'Log'\n },\n template: {\n icon: TemplateIcon,\n component: TemplateForm,\n title: 'Template'\n },\n dataMapping: {\n icon: LinkIcon,\n component: DataMappingForm,\n title: 'Data mapping'\n },\n axes: {\n icon: AxisIcon,\n component: AxesSettingsForm,\n title: 'Axes settings'\n },\n statistics: {\n icon: StatisticsIcon,\n component: StatisticsForm,\n title: 'Statistics'\n },\n layers: {\n icon: LayersIcon,\n component: LayersForm,\n title: 'Layers'\n },\n delete: {\n icon: DeleteChartIcon,\n component: null,\n title: 'Delete graph'\n },\n export: {\n icon: ExportIcon,\n component: null,\n title: 'Export'\n },\n};\n\nexport type FormKey = keyof typeof forms;\n\nexport function tabKeys() {\n return Object.keys(forms) as FormKey[];\n}\n\nexport function resolveIcon(name: FormKey): Component {\n return forms[name].icon ?? '';\n}\n\nexport function resolveTitle(name: FormKey) {\n return forms[name].title ?? '';\n}\n\nexport function useSettingsForm(tab: MaybeRef<FormKey | null>) {\n const components = Object.entries(forms).reduce((dict, [name, v]) => {\n return objects.setProp(dict, name as FormKey, v.component);\n }, {} as Record<FormKey, Component | null>);\n return useComponent(components, tab);\n}\n\n"],"names":["forms","SettingsIcon","SettingsForm","LogIcon","LogForm","TemplateIcon","TemplateForm","LinkIcon","DataMappingForm","AxisIcon","AxesSettingsForm","StatisticsIcon","StatisticsForm","LayersIcon","LayersForm","DeleteChartIcon","ExportIcon","tabKeys","resolveIcon","name","resolveTitle","useSettingsForm","tab","components","dict","v","objects","useComponent"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAMA,IAAQ;AAAA,EACZ,UAAU;AAAA,IACR,MAAMC;AAAAA,IACN,WAAWC;AAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,KAAK;AAAA,IACH,MAAMC;AAAAA,IACN,WAAWC;AAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,UAAU;AAAA,IACR,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,aAAa;AAAA,IACX,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,MAAM;AAAA,IACJ,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,YAAY;AAAA,IACV,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,QAAQ;AAAA,IACN,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,QAAQ;AAAA,IACN,MAAMC;AAAA,IACN,WAAW;AAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,QAAQ;AAAA,IACN,MAAMC;AAAA,IACN,WAAW;AAAA,IACX,OAAO;AAAA,EAAA;AAEX;AAIO,SAASC,IAAU;AACxB,SAAO,OAAO,KAAKjB,CAAK;AAC1B;AAEO,SAASkB,EAAYC,GAA0B;AACpD,SAAOnB,EAAMmB,CAAI,EAAE,QAAQ;AAC7B;AAEO,SAASC,EAAaD,GAAe;AAC1C,SAAOnB,EAAMmB,CAAI,EAAE,SAAS;AAC9B;AAEO,SAASE,EAAgBC,GAA+B;AAC7D,QAAMC,IAAa,OAAO,QAAQvB,CAAK,EAAE,OAAO,CAACwB,GAAM,CAACL,GAAMM,CAAC,MACtDC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/GraphMaker/forms/index.ts"],"sourcesContent":["import { objects } from '@milaboratories/helpers';\nimport { MaybeRef } from '@platforma-sdk/ui-vue';\nimport { Component } from 'vue';\nimport { useComponent } from '../composition/useComponent';\nimport AxisIcon from '../components/SettingsTabs/icons/AxesIcon.vue';\nimport DeleteChartIcon from '../components/SettingsTabs/icons/DeleteChartIcon.vue';\nimport ExportIcon from '../components/SettingsTabs/icons/ExportIcon.vue';\nimport LayersIcon from '../components/SettingsTabs/icons/LayersIcon.vue';\nimport LinkIcon from '../components/SettingsTabs/icons/LinkIcon.vue';\nimport SettingsIcon from '../components/SettingsTabs/icons/SettingsIcon.vue';\nimport LogIcon from '../components/SettingsTabs/icons/LogIcon.vue';\nimport StatisticsIcon from '../icons/StatisticsIcon.vue';\nimport TemplateIcon from '../icons/TemplateIcon.vue';\nimport AxesSettingsForm from './AxesSettingsForm/index.vue';\nimport DataMappingForm from './DataMappingForm/index.vue';\nimport LayersForm from './LayersForm/index.vue';\nimport SettingsForm from './SettingsForm.vue';\nimport LogForm from './LogForm.vue';\nimport StatisticsForm from './StatisticsForm/index.vue';\nimport TemplateForm from './TemplateForm.vue';\n\nconst forms = {\n settings: {\n icon: SettingsIcon,\n component: SettingsForm,\n title: 'Settings'\n },\n log: {\n icon: LogIcon,\n component: LogForm,\n title: 'Log'\n },\n template: {\n icon: TemplateIcon,\n component: TemplateForm,\n title: 'Template'\n },\n dataMapping: {\n icon: LinkIcon,\n component: DataMappingForm,\n title: 'Data mapping'\n },\n axes: {\n icon: AxisIcon,\n component: AxesSettingsForm,\n title: 'Axes settings'\n },\n statistics: {\n icon: StatisticsIcon,\n component: StatisticsForm,\n title: 'Statistics'\n },\n layers: {\n icon: LayersIcon,\n component: LayersForm,\n title: 'Layers'\n },\n delete: {\n icon: DeleteChartIcon,\n component: null,\n title: 'Delete graph'\n },\n export: {\n icon: ExportIcon,\n component: null,\n title: 'Export'\n },\n};\n\nexport type FormKey = keyof typeof forms;\n\nexport function tabKeys() {\n return Object.keys(forms) as FormKey[];\n}\n\nexport function resolveIcon(name: FormKey): Component {\n return forms[name].icon ?? '';\n}\n\nexport function resolveTitle(name: FormKey) {\n return forms[name].title ?? '';\n}\n\nexport function useSettingsForm(tab: MaybeRef<FormKey | null>) {\n const components = Object.entries(forms).reduce((dict, [name, v]) => {\n return objects.setProp(dict, name as FormKey, v.component);\n }, {} as Record<FormKey, Component | null>);\n return useComponent(components, tab);\n}\n\n"],"names":["forms","SettingsIcon","SettingsForm","LogIcon","LogForm","TemplateIcon","TemplateForm","LinkIcon","DataMappingForm","AxisIcon","AxesSettingsForm","StatisticsIcon","StatisticsForm","LayersIcon","LayersForm","DeleteChartIcon","ExportIcon","tabKeys","resolveIcon","name","resolveTitle","useSettingsForm","tab","components","dict","v","objects.setProp","useComponent"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAMA,IAAQ;AAAA,EACZ,UAAU;AAAA,IACR,MAAMC;AAAAA,IACN,WAAWC;AAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,KAAK;AAAA,IACH,MAAMC;AAAAA,IACN,WAAWC;AAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,UAAU;AAAA,IACR,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,aAAa;AAAA,IACX,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,MAAM;AAAA,IACJ,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,YAAY;AAAA,IACV,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,QAAQ;AAAA,IACN,MAAMC;AAAA,IACN,WAAWC;AAAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,QAAQ;AAAA,IACN,MAAMC;AAAA,IACN,WAAW;AAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,QAAQ;AAAA,IACN,MAAMC;AAAA,IACN,WAAW;AAAA,IACX,OAAO;AAAA,EAAA;AAEX;AAIO,SAASC,IAAU;AACxB,SAAO,OAAO,KAAKjB,CAAK;AAC1B;AAEO,SAASkB,EAAYC,GAA0B;AACpD,SAAOnB,EAAMmB,CAAI,EAAE,QAAQ;AAC7B;AAEO,SAASC,EAAaD,GAAe;AAC1C,SAAOnB,EAAMmB,CAAI,EAAE,SAAS;AAC9B;AAEO,SAASE,EAAgBC,GAA+B;AAC7D,QAAMC,IAAa,OAAO,QAAQvB,CAAK,EAAE,OAAO,CAACwB,GAAM,CAACL,GAAMM,CAAC,MACtDC,EAAgBF,GAAML,GAAiBM,EAAE,SAAS,GACxD,CAAA,CAAuC;AAC1C,SAAOE,EAAaJ,GAAYD,CAAG;AACrC;"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=StackedAreaIcon.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StackedAreaIcon.vue.d.ts","sourceRoot":"","sources":["../../../src/GraphMaker/icons/StackedAreaIcon.vue"],"names":[],"mappings":";AAgKA,wBAMG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createElementBlock as l, openBlock as d, createStaticVNode as t } from "vue";
|
|
2
|
+
import i from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const o = {}, p = {
|
|
4
|
+
width: "24",
|
|
5
|
+
height: "24",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "none",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
+
};
|
|
10
|
+
function r(n, e) {
|
|
11
|
+
return d(), l("svg", p, e[0] || (e[0] = [
|
|
12
|
+
t('<path fill-rule="evenodd" clip-rule="evenodd" d="M3.75 2.5L3.75 4L2.25 4L2.25 2.5L3.75 2.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M3.75 5.5L3.75 7H2.25L2.25 5.5H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M3.75 8.5L3.75 10H2.25L2.25 8.5H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M3.75 11.5L3.75 13H2.25L2.25 11.5H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M3.75 14.5L3.75 16H2.25L2.25 14.5H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M3.75 17.5L3.75 19H2.25L2.25 17.5H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 20.5H21.75V22H2.25V20.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 9L7.5 19H6L6 9H7.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 10.3168L7.5 17.5741H6L6 10.3168H7.5Z" fill="#07AD3E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5.12476L14 19H12.5L12.5 5.12476H14Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M14 8.63611L14 14.235H12.5L12.5 8.63611H14Z" fill="#07AD3E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M20.5 1L20.5 19H19L19 1H20.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M20.5 5.36682L20.5 15.3887H19L19 5.36682H20.5Z" fill="#07AD3E"></path><path d="M20.5 7.80713C20.5 7.80713 19.1058 7.80718 17.7115 7.80718C16.3173 7.80718 16.0385 11.1533 14.6442 11.1533C13.25 11.1533 13.25 11.1533 11.8558 11.1533C10.4615 11.1533 10.1827 12.8264 8.78846 12.8264C7.39423 12.8264 6 12.8264 6 12.8264" stroke="#07AD3E" stroke-width="1.5"></path><path d="M20.5 1.36011C20.5 1.36011 19.1058 1.36011 17.7115 1.36011C16.3173 1.36011 16.0385 5.82165 14.6442 5.82165C13.25 5.82165 13.25 5.82165 11.8558 5.82165C10.4615 5.82165 10.1827 9.72549 8.78846 9.72549C7.39423 9.72549 6 9.72549 6 9.72549" stroke="#07AD3E" stroke-width="1.5"></path><path d="M20.5 14.6335C20.5 14.6335 19.1058 14.6335 17.7115 14.6335C16.3173 14.6335 16.0385 13.5181 14.6442 13.5181C13.25 13.5181 13.25 13.5181 11.8558 13.5181C10.4615 13.5181 10.1827 16.8642 8.78846 16.8642C7.39423 16.8642 6 16.8642 6 16.8642" stroke="#07AD3E" stroke-width="1.5"></path>', 16)
|
|
13
|
+
]));
|
|
14
|
+
}
|
|
15
|
+
const f = /* @__PURE__ */ i(o, [["render", r]]);
|
|
16
|
+
export {
|
|
17
|
+
f as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=StackedAreaIcon.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StackedAreaIcon.vue.js","sources":["../../../src/GraphMaker/icons/StackedAreaIcon.vue"],"sourcesContent":["<template>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3.75 2.5L3.75 4L2.25 4L2.25 2.5L3.75 2.5Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3.75 5.5L3.75 7H2.25L2.25 5.5H3.75Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3.75 8.5L3.75 10H2.25L2.25 8.5H3.75Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3.75 11.5L3.75 13H2.25L2.25 11.5H3.75Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3.75 14.5L3.75 16H2.25L2.25 14.5H3.75Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3.75 17.5L3.75 19H2.25L2.25 17.5H3.75Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2.25 20.5H21.75V22H2.25V20.5Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.5 9L7.5 19H6L6 9H7.5Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.5 10.3168L7.5 17.5741H6L6 10.3168H7.5Z\" fill=\"#07AD3E\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M14 5.12476L14 19H12.5L12.5 5.12476H14Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M14 8.63611L14 14.235H12.5L12.5 8.63611H14Z\" fill=\"#07AD3E\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20.5 1L20.5 19H19L19 1H20.5Z\" fill=\"#110529\" />\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20.5 5.36682L20.5 15.3887H19L19 5.36682H20.5Z\" fill=\"#07AD3E\" />\n <path\n d=\"M20.5 7.80713C20.5 7.80713 19.1058 7.80718 17.7115 7.80718C16.3173 7.80718 16.0385 11.1533 14.6442 11.1533C13.25 11.1533 13.25 11.1533 11.8558 11.1533C10.4615 11.1533 10.1827 12.8264 8.78846 12.8264C7.39423 12.8264 6 12.8264 6 12.8264\"\n stroke=\"#07AD3E\" stroke-width=\"1.5\" />\n <path\n d=\"M20.5 1.36011C20.5 1.36011 19.1058 1.36011 17.7115 1.36011C16.3173 1.36011 16.0385 5.82165 14.6442 5.82165C13.25 5.82165 13.25 5.82165 11.8558 5.82165C10.4615 5.82165 10.1827 9.72549 8.78846 9.72549C7.39423 9.72549 6 9.72549 6 9.72549\"\n stroke=\"#07AD3E\" stroke-width=\"1.5\" />\n <path\n d=\"M20.5 14.6335C20.5 14.6335 19.1058 14.6335 17.7115 14.6335C16.3173 14.6335 16.0385 13.5181 14.6442 13.5181C13.25 13.5181 13.25 13.5181 11.8558 13.5181C10.4615 13.5181 10.1827 16.8642 8.78846 16.8642C7.39423 16.8642 6 16.8642 6 16.8642\"\n stroke=\"#07AD3E\" stroke-width=\"1.5\" />\n </svg>\n</template>\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_cache","_createStaticVNode"],"mappings":";;;EACO,OAAM;AAAA,EAAK,QAAO;AAAA,EAAK,SAAQ;AAAA,EAAY,MAAK;AAAA,EAAO,OAAM;;;AAAlE,SAAAA,EAAA,GAAAC,EAuBM,OAvBNC,GAuBMC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,IAxBRC,EAAA,6vEAAA,EAAA;AAAA;;;"}
|