@milaboratories/graph-maker 1.1.140 → 1.1.142
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/LassoControls/index.vue.js +1 -1
- package/dist/GraphMaker/constantsCommon.d.ts +8 -0
- package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
- package/dist/GraphMaker/constantsCommon.js +94 -83
- package/dist/GraphMaker/constantsCommon.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue.d.ts +3 -0
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue.d.ts.map +1 -0
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue.js +90 -0
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue.js.map +1 -0
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue2.js +5 -0
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue2.js.map +1 -0
- package/dist/GraphMaker/forms/LayersForm/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/index.vue.js +45 -43
- package/dist/GraphMaker/forms/LayersForm/index.vue.js.map +1 -1
- package/dist/GraphMaker/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/index.vue.js +24 -24
- 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/composeDiscreteSettings.d.ts +16 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +54 -52
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.js +84 -70
- package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.js.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.js +4 -3
- package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -5
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +185 -164
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/Chart.js +120 -103
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/ChartsGroup.js +4 -4
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/StackedAreaElement.js +105 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/StackedAreaElement.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/StackedBarElement.js +66 -59
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/StackedBarElement.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +57 -54
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedArea.js +17 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedArea.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +24 -9
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
- 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 -3426
- 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
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { isContinuousDataMapping as g } from "../../constantsCommon.js";
|
|
2
|
-
import { AMINOACID_COLOR_MAPPING as
|
|
3
|
-
import { DEFAULT_DOT_SIZE as
|
|
4
|
-
function x(
|
|
2
|
+
import { AMINOACID_COLOR_MAPPING as L, NUCLEOTIDE_COLOR_MAPPING as A, PALETTE_MAP as b, DEFAULT_BLACK as C, DEFAULT_CONTINUOUS_PALETTE as F, DEFAULT_DOT_SHAPE as I } from "../../constantsAesthetic.js";
|
|
3
|
+
import { DEFAULT_DOT_SIZE as _, DEFAULT_DOT_RANGE as P, isAestheticMappingContinuous as V, createContinuousMappingFromPalette as N } from "../../dataBindAes.js";
|
|
4
|
+
function x(r) {
|
|
5
5
|
const l = [];
|
|
6
|
-
if (
|
|
6
|
+
if (r.overall.data.testMethod && r.overall.validity.testMethod && l.push({
|
|
7
7
|
type: "stat",
|
|
8
8
|
statType: "overall",
|
|
9
|
-
testMethod:
|
|
10
|
-
}),
|
|
9
|
+
testMethod: r.overall.data.testMethod
|
|
10
|
+
}), r.referenceGroup.data.testMethod && r.referenceGroup.validity.testMethod && r.referenceGroup.validity.referenceGroup) {
|
|
11
11
|
const p = {
|
|
12
12
|
type: "stat",
|
|
13
13
|
statType: "referenceGroup",
|
|
14
|
-
testMethod:
|
|
15
|
-
referenceGroup:
|
|
16
|
-
format:
|
|
17
|
-
ns:
|
|
14
|
+
testMethod: r.referenceGroup.data.testMethod,
|
|
15
|
+
referenceGroup: r.referenceGroup.data.referenceGroup,
|
|
16
|
+
format: r.referenceGroup.data.format,
|
|
17
|
+
ns: r.referenceGroup.data.ns
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
r.referenceGroup.data.correctionMethod !== "none" && (p.correctionMethod = r.referenceGroup.data.correctionMethod), l.push(p);
|
|
20
20
|
}
|
|
21
|
-
if (
|
|
21
|
+
if (r.pairwise.data.testMethod && r.pairwise.validity.testMethod) {
|
|
22
22
|
const p = {
|
|
23
23
|
type: "stat",
|
|
24
24
|
statType: "pairwise",
|
|
25
|
-
testMethod:
|
|
26
|
-
format:
|
|
27
|
-
ns:
|
|
25
|
+
testMethod: r.pairwise.data.testMethod,
|
|
26
|
+
format: r.pairwise.data.format,
|
|
27
|
+
ns: r.pairwise.data.ns
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
r.referenceGroup.data.correctionMethod !== "none" && (p.correctionMethod = r.referenceGroup.data.correctionMethod), l.push(p);
|
|
30
30
|
}
|
|
31
31
|
return l;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const o = [],
|
|
35
|
-
function i(
|
|
36
|
-
return
|
|
33
|
+
function B(r, l, p, u, d) {
|
|
34
|
+
const o = [], n = u.components.primaryGrouping.selectorStates.length > 0, c = u.components.secondaryGrouping.selectorStates.length > 0;
|
|
35
|
+
function i(t, f = !1) {
|
|
36
|
+
return t === null ? c ? { type: "secondaryGrouping" } : n && !f ? { type: "primaryGrouping" } : { type: "secondaryGrouping" } : t;
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return r.forEach((t) => {
|
|
39
39
|
var f;
|
|
40
|
-
if (
|
|
41
|
-
const e = l[
|
|
40
|
+
if (t === "box") {
|
|
41
|
+
const e = l[t];
|
|
42
42
|
o.push({
|
|
43
43
|
type: "box",
|
|
44
44
|
aes: {
|
|
@@ -51,8 +51,8 @@ function j(t, l, p, u, d) {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
55
|
-
const e = l[
|
|
54
|
+
if (t === "binnedDots") {
|
|
55
|
+
const e = l[t];
|
|
56
56
|
o.push({
|
|
57
57
|
type: "binnedDots",
|
|
58
58
|
aes: {
|
|
@@ -63,8 +63,8 @@ function j(t, l, p, u, d) {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
67
|
-
const e = l[
|
|
66
|
+
if (t === "jitteredDots") {
|
|
67
|
+
const e = l[t];
|
|
68
68
|
o.push({
|
|
69
69
|
type: "dot",
|
|
70
70
|
aes: {
|
|
@@ -76,8 +76,8 @@ function j(t, l, p, u, d) {
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
if (
|
|
80
|
-
const e = l[
|
|
79
|
+
if (t === "violin") {
|
|
80
|
+
const e = l[t];
|
|
81
81
|
o.push({
|
|
82
82
|
type: "violin",
|
|
83
83
|
stat: {
|
|
@@ -94,8 +94,8 @@ function j(t, l, p, u, d) {
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
if (
|
|
98
|
-
const e = l[
|
|
97
|
+
if (t === "bar") {
|
|
98
|
+
const e = l[t];
|
|
99
99
|
o.push({
|
|
100
100
|
type: "bar",
|
|
101
101
|
height: e.height,
|
|
@@ -106,8 +106,8 @@ function j(t, l, p, u, d) {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
const e = l[
|
|
109
|
+
if (t === "stackedBar") {
|
|
110
|
+
const e = l[t];
|
|
111
111
|
o.push({
|
|
112
112
|
type: "stackedBar",
|
|
113
113
|
normalize: e.normalize,
|
|
@@ -118,8 +118,22 @@ function j(t, l, p, u, d) {
|
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
if (
|
|
122
|
-
const e = l[
|
|
121
|
+
if (t === "stackedArea") {
|
|
122
|
+
const e = l[t];
|
|
123
|
+
o.push({
|
|
124
|
+
type: "stackedArea",
|
|
125
|
+
normalize: e.normalize,
|
|
126
|
+
showBars: e.showBars,
|
|
127
|
+
aes: {
|
|
128
|
+
fillColor: i(e.fillColor),
|
|
129
|
+
lineColor: i(e.lineColor),
|
|
130
|
+
barsOpacity: e.barsOpacity,
|
|
131
|
+
areaOpacity: e.areaOpacity
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
if (t === "line") {
|
|
136
|
+
const e = l[t];
|
|
123
137
|
o.push({
|
|
124
138
|
type: "line",
|
|
125
139
|
pointsValues: e.pointsValues,
|
|
@@ -132,8 +146,8 @@ function j(t, l, p, u, d) {
|
|
|
132
146
|
}
|
|
133
147
|
});
|
|
134
148
|
}
|
|
135
|
-
if (
|
|
136
|
-
const e = l[
|
|
149
|
+
if (t === "errorbar") {
|
|
150
|
+
const e = l[t];
|
|
137
151
|
o.push({
|
|
138
152
|
type: "errorbar",
|
|
139
153
|
pointsValues: e.pointsValues,
|
|
@@ -146,8 +160,8 @@ function j(t, l, p, u, d) {
|
|
|
146
160
|
}
|
|
147
161
|
});
|
|
148
162
|
}
|
|
149
|
-
if (
|
|
150
|
-
const e = l[
|
|
163
|
+
if (t === "sina") {
|
|
164
|
+
const e = l[t];
|
|
151
165
|
o.push({
|
|
152
166
|
type: "sina",
|
|
153
167
|
aes: {
|
|
@@ -157,71 +171,71 @@ function j(t, l, p, u, d) {
|
|
|
157
171
|
}
|
|
158
172
|
});
|
|
159
173
|
}
|
|
160
|
-
if (
|
|
161
|
-
const e = l[
|
|
174
|
+
if (t === "logo" && c) {
|
|
175
|
+
const e = l[t], m = ((f = d.getSourceInfo(u.components.secondaryGrouping.selectorStates[0].selectedSource).spec.domain) == null ? void 0 : f["pl7.app/alphabet"]) === "aminoacid";
|
|
162
176
|
o.push({
|
|
163
177
|
type: "logo",
|
|
164
178
|
normalize: e.normalize,
|
|
165
179
|
aes: {
|
|
166
180
|
opacity: e.opacity,
|
|
167
|
-
dotFill: m ?
|
|
181
|
+
dotFill: m ? L : A
|
|
168
182
|
}
|
|
169
183
|
});
|
|
170
184
|
}
|
|
171
|
-
}),
|
|
185
|
+
}), n && !c && o.push(...x(p)), o;
|
|
172
186
|
}
|
|
173
|
-
function
|
|
174
|
-
if (
|
|
175
|
-
const d = g(l) ? l : { column:
|
|
176
|
-
return p.values[
|
|
177
|
-
const c = Number(
|
|
187
|
+
function z(r, l, p, u) {
|
|
188
|
+
if (r) {
|
|
189
|
+
const d = g(l) ? l : { column: r.value, range: P }, o = [1 / 0, -1 / 0];
|
|
190
|
+
return p.values[r.value].forEach((n) => {
|
|
191
|
+
const c = Number(n);
|
|
178
192
|
c < o[0] && (o[0] = c), c > o[1] && (o[1] = c);
|
|
179
|
-
}), { columnName:
|
|
193
|
+
}), { columnName: r, domain: o, range: [d.range.min, d.range.max] };
|
|
180
194
|
}
|
|
181
195
|
return g(l) ? u : l ?? u;
|
|
182
196
|
}
|
|
183
|
-
function
|
|
184
|
-
const d = p.find((
|
|
197
|
+
function w(r, l, p, u) {
|
|
198
|
+
const d = p.find((n) => n.value === r);
|
|
185
199
|
let o = [1 / 0, -1 / 0];
|
|
186
200
|
if (d) {
|
|
187
|
-
const { range:
|
|
201
|
+
const { range: n, palette: c, midPoint: i, log: t } = l, f = (n == null ? void 0 : n.minValue) === null || (n == null ? void 0 : n.minValue) === void 0, e = (n == null ? void 0 : n.maxValue) === null || (n == null ? void 0 : n.maxValue) === void 0;
|
|
188
202
|
if ((f || e) && u.values[d.value].forEach((h) => {
|
|
189
203
|
const m = Number(h);
|
|
190
204
|
f && m < o[0] && (o[0] = m), e && m > o[1] && (o[1] = m);
|
|
191
|
-
}), f || (o[0] =
|
|
205
|
+
}), f || (o[0] = n == null ? void 0 : n.minValue), e || (o[1] = n == null ? void 0 : n.maxValue), i != null) {
|
|
192
206
|
const h = Math.max(Math.abs(i - o[0]), Math.abs(i - o[1]));
|
|
193
207
|
o[0] = i - h, o[1] = i + h;
|
|
194
208
|
}
|
|
195
209
|
return {
|
|
196
210
|
columnName: d,
|
|
197
211
|
domain: o,
|
|
198
|
-
range:
|
|
199
|
-
type:
|
|
212
|
+
range: b[c].colors,
|
|
213
|
+
type: t ? "log" : "linear"
|
|
200
214
|
};
|
|
201
215
|
}
|
|
202
|
-
return
|
|
216
|
+
return C;
|
|
203
217
|
}
|
|
204
|
-
function
|
|
205
|
-
var
|
|
218
|
+
function R(r, l, p, u, d, o, n = [], c = _) {
|
|
219
|
+
var y, M;
|
|
206
220
|
const i = [];
|
|
207
|
-
function
|
|
221
|
+
function t(a, s, D, G = !1) {
|
|
208
222
|
var v;
|
|
209
223
|
if (s.length) {
|
|
210
|
-
const
|
|
211
|
-
return a === null ||
|
|
224
|
+
const O = s.length ? (v = o.getSourceInfo(s[0])) == null ? void 0 : v.type : void 0, E = O === "String" || !G ? { type: "grouping", value: s[0] } : w(s[0], N(F), n, p), T = d[s[0]];
|
|
225
|
+
return a === null || O === "String" || !G || !V(T) ? E : w(s[0], T, n, p);
|
|
212
226
|
}
|
|
213
|
-
return typeof a == "object" ?
|
|
227
|
+
return typeof a == "object" ? D : a;
|
|
214
228
|
}
|
|
215
|
-
const f = u.components.grouping.selectorStates.map((a) => a.selectedSource), e = ((
|
|
216
|
-
return
|
|
229
|
+
const f = u.components.grouping.selectorStates.map((a) => a.selectedSource), e = ((y = u.components.shape) == null ? void 0 : y.selectorStates.map((a) => a.selectedSource)) ?? [], h = (M = u.components.size) == null ? void 0 : M.selectorStates.map((a) => a.selectedSource)[0], m = h ? n.find((a) => a.value === h) : void 0;
|
|
230
|
+
return r.forEach((a) => {
|
|
217
231
|
if (a === "dots") {
|
|
218
232
|
const s = l[a];
|
|
219
233
|
i.push({
|
|
220
234
|
type: "dots",
|
|
221
235
|
aes: {
|
|
222
|
-
dotFill:
|
|
223
|
-
dotShape:
|
|
224
|
-
dotSize:
|
|
236
|
+
dotFill: t(s.dotFill, f, C, !0),
|
|
237
|
+
dotShape: t(s.dotShape, e, I),
|
|
238
|
+
dotSize: z(m, s.dotSize, p, c)
|
|
225
239
|
}
|
|
226
240
|
});
|
|
227
241
|
}
|
|
@@ -231,15 +245,15 @@ function k(t, l, p, u, d, o, r = [], c = b) {
|
|
|
231
245
|
type: "curve",
|
|
232
246
|
smoothing: s.smoothing,
|
|
233
247
|
aes: {
|
|
234
|
-
lineColor:
|
|
248
|
+
lineColor: t(s.lineColor, f, C, !0)
|
|
235
249
|
}
|
|
236
250
|
});
|
|
237
251
|
}
|
|
238
252
|
}), i;
|
|
239
253
|
}
|
|
240
254
|
export {
|
|
241
|
-
|
|
242
|
-
|
|
255
|
+
B as getDiscreteLayersSettings,
|
|
256
|
+
R as getScatterplotLayersSettings,
|
|
243
257
|
x as getStatLayers
|
|
244
258
|
};
|
|
245
259
|
//# sourceMappingURL=getLayersDataFromForms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLayersDataFromForms.js","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.ts"],"sourcesContent":["import {\n ColorAes,\n getDefaultLayersSettings,\n NumberRange,\n LayersSettings,\n MappingLink,\n DiscreteStatisticsState,\n ColumnNameSchema,\n ContinuousDataMappingSize,\n isContinuousDataMapping,\n ContinuousDataMappingForGraph\n} from '../../constantsCommon';\nimport {\n Layer,\n ReactiveState\n} from '../../types';\nimport {\n DiscreteUIState, InputGuide,\n InputState,\n PlotDataAndSettings,\n ScatterplotUIState\n} from '@milaboratories/pf-plots';\nimport { DotShape, LineType } from '../../components/AesSettings/types';\nimport {\n AMINOACID_COLOR_MAPPING,\n DEFAULT_BLACK,\n DEFAULT_CONTINUOUS_PALETTE,\n DEFAULT_DOT_SHAPE, NUCLEOTIDE_COLOR_MAPPING,\n PALETTE_MAP\n} from '../../constantsAesthetic';\nimport {\n AestheticMappingContinuous, createContinuousMappingFromPalette,\n DEFAULT_DOT_RANGE,\n DEFAULT_DOT_SIZE\n} from '../../dataBindAes';\nimport { ScatterplotSettings } from '@milaboratories/miplots4';\nimport { isAestheticMappingContinuous } from '../../dataBindAes';\n\nexport function getStatLayers(statisticsSettings: DiscreteStatisticsState) {\n const layers: ChartLayerSettings[] = [];\n if (\n statisticsSettings.overall.data.testMethod &&\n statisticsSettings.overall.validity.testMethod\n ) {\n layers.push({\n type: 'stat',\n statType: 'overall',\n testMethod: statisticsSettings.overall.data.testMethod\n });\n }\n if (\n statisticsSettings.referenceGroup.data.testMethod &&\n statisticsSettings.referenceGroup.validity.testMethod &&\n statisticsSettings.referenceGroup.validity.referenceGroup\n ) {\n const layer: ChartLayerSettings = {\n type: 'stat',\n statType: 'referenceGroup',\n testMethod: statisticsSettings.referenceGroup.data.testMethod,\n referenceGroup: statisticsSettings.referenceGroup.data.referenceGroup,\n format: statisticsSettings.referenceGroup.data.format,\n ns: statisticsSettings.referenceGroup.data.ns\n };\n if (statisticsSettings.referenceGroup.data.correctionMethod !== 'none') {\n layer.correctionMethod =\n statisticsSettings.referenceGroup.data.correctionMethod;\n }\n layers.push(layer);\n }\n if (\n statisticsSettings.pairwise.data.testMethod &&\n statisticsSettings.pairwise.validity.testMethod\n ) {\n const layer: ChartLayerSettings = {\n type: 'stat',\n statType: 'pairwise',\n testMethod: statisticsSettings.pairwise.data.testMethod,\n format: statisticsSettings.pairwise.data.format,\n ns: statisticsSettings.pairwise.data.ns\n };\n if (statisticsSettings.referenceGroup.data.correctionMethod !== 'none') {\n layer.correctionMethod =\n statisticsSettings.referenceGroup.data.correctionMethod;\n }\n layers.push(layer);\n }\n return layers;\n}\n\nexport function getDiscreteLayersSettings(\n layers: Layer[],\n layerSettings: LayersSettings,\n statisticsSettings: DiscreteStatisticsState,\n optionsState: DiscreteUIState,\n inputGuide: InputGuide<InputState>\n): ChartLayerSettings[] {\n const result: ChartLayerSettings[] = [];\n const hasPrimaryGrouping =\n optionsState.components.primaryGrouping.selectorStates.length > 0;\n const hasSecondaryGrouping =\n optionsState.components.secondaryGrouping.selectorStates.length > 0;\n // If user didn't touch layers settings, some aes that can be mapped to groupings has 'null' value - we set them to secondary or primary grouping if available\n // for 'line', 'errorbar' layer it isn't possible to set primary grouping as a color aes\n function useDefaultColor(\n value: ColorAes | null,\n onlySecondaryAvailable = false\n ) {\n if (value === null) {\n if (hasSecondaryGrouping) {\n return { type: 'secondaryGrouping' };\n }\n if (hasPrimaryGrouping && !onlySecondaryAvailable) {\n return { type: 'primaryGrouping' };\n }\n return { type: 'secondaryGrouping' };\n }\n return value;\n }\n\n layers.forEach((layer) => {\n if (layer === 'box') {\n const settings = layerSettings[layer];\n result.push({\n type: 'box',\n aes: {\n showOutliers: settings.showOutliers,\n dotShape: settings.dotShape,\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n lineShape: settings.lineType,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'binnedDots') {\n const settings = layerSettings[layer];\n result.push({\n type: 'binnedDots',\n aes: {\n showOutliers: settings.showOutliers,\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'jitteredDots') {\n const settings = layerSettings[layer];\n result.push({\n type: 'dot',\n aes: {\n showOutliers: settings.showOutliers,\n dotFill: useDefaultColor(settings.dotFill),\n dotShape: settings.dotShape,\n lineColor: settings.lineColor,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'violin') {\n const settings = layerSettings[layer];\n result.push({\n type: 'violin',\n stat: {\n trim: settings.trim\n },\n aes: {\n showQuartiles: settings.showQuartiles,\n medianLineStyle: settings.medianLineStyle,\n quartilesLineStyle: settings.quartilesLineStyle,\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n lineShape: settings.lineType,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'bar') {\n const settings = layerSettings[layer];\n result.push({\n type: 'bar',\n height: settings.height,\n aes: {\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'stackedBar') {\n const settings = layerSettings[layer];\n result.push({\n type: 'stackedBar',\n normalize: settings.normalize,\n aes: {\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'line') {\n const settings = layerSettings[layer];\n result.push({\n type: 'line',\n pointsValues: settings.pointsValues,\n aes: {\n lineColor: useDefaultColor(settings.lineColor, true),\n fillColor: useDefaultColor(settings.dotFill, true),\n lineShape: settings.lineType,\n dotShape: settings.dotShape,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'errorbar') {\n const settings = layerSettings[layer];\n result.push({\n type: 'errorbar',\n pointsValues: settings.pointsValues,\n interval: settings.interval,\n aes: {\n lineColor: useDefaultColor(settings.lineColor, true),\n fillColor: useDefaultColor(settings.dotFill, true),\n dotShape: settings.dotShape,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'sina') {\n const settings = layerSettings[layer];\n result.push({\n type: 'sina',\n aes: {\n showOutliers: settings.showOutliers,\n dotFill: useDefaultColor(settings.dotFill),\n dotShape: settings.dotShape\n }\n });\n }\n if (layer === 'logo' && hasSecondaryGrouping) {\n const settings = layerSettings[layer];\n const secondaryGroupingInfo = inputGuide.getSourceInfo(optionsState.components.secondaryGrouping.selectorStates[0].selectedSource);\n const isProtein = secondaryGroupingInfo.spec.domain?.['pl7.app/alphabet'] === 'aminoacid';\n result.push({\n type: 'logo',\n normalize: settings.normalize,\n aes: {\n opacity: settings.opacity,\n dotFill: isProtein ? AMINOACID_COLOR_MAPPING : NUCLEOTIDE_COLOR_MAPPING\n }\n });\n }\n });\n if (hasPrimaryGrouping && !hasSecondaryGrouping) {\n result.push(...getStatLayers(statisticsSettings));\n }\n return result;\n}\n\nfunction getDotSize(\n column: ColumnNameSchema | undefined,\n dotSize: ContinuousDataMappingSize | number | null,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n defaultDotSize: number\n): number | { columnName: ColumnNameSchema, domain: number[], range: number[] } {\n if (column) {\n const mapping = isContinuousDataMapping(dotSize) ? dotSize : { column: column.value, range: DEFAULT_DOT_RANGE };\n const domain = [Infinity, -Infinity];\n dataByColumns.values[column.value].forEach((v) => {\n const value = Number(v);\n if (value < domain[0]) {\n domain[0] = value;\n }\n if (value > domain[1]) {\n domain[1] = value;\n }\n });\n return { columnName: column, domain, range: [mapping.range.min, mapping.range.max] };\n }\n return isContinuousDataMapping(dotSize) ? defaultDotSize : dotSize ?? defaultDotSize;\n}\n\nfunction getContinuousColor<T extends string>(\n columnKey: string,\n value: AestheticMappingContinuous,\n groupingColumns: ColumnNameSchema[],\n dataByColumns: PlotDataAndSettings['data']['byColumns']\n): T | ContinuousDataMappingForGraph<T> {\n const column = groupingColumns.find(groupingColumn => groupingColumn.value === columnKey);\n let domain = [Infinity, -Infinity];\n if (column) {\n const { range, palette, midPoint, log } = value;\n const minValueMissed = range?.minValue === null || range?.minValue === undefined;\n const maxValueMissed = range?.maxValue === null || range?.maxValue === undefined;\n if (minValueMissed || maxValueMissed) {\n dataByColumns.values[column.value].forEach((v) => {\n const value = Number(v);\n if (minValueMissed && value < domain[0]) {\n domain[0] = value;\n }\n if (maxValueMissed && value > domain[1]) {\n domain[1] = value;\n }\n });\n }\n if (!minValueMissed) {\n domain[0] = range?.minValue as number;\n }\n if (!maxValueMissed) {\n domain[1] = range?.maxValue as number;\n }\n if (midPoint !== null && midPoint !== undefined) {\n const maxDistance = Math.max(Math.abs(midPoint - domain[0]), Math.abs(midPoint - domain[1]));\n domain[0] = midPoint - maxDistance;\n domain[1] = midPoint + maxDistance;\n }\n\n return {\n columnName: column,\n domain,\n range: PALETTE_MAP[palette].colors,\n type: log ? 'log' : 'linear'\n } as ContinuousDataMappingForGraph<T>;\n }\n return DEFAULT_BLACK as T;\n}\n\nexport function getScatterplotLayersSettings(\n layers: Layer[],\n layerSettings: ReturnType<typeof getDefaultLayersSettings>,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n optionsState: ScatterplotUIState,\n dataBindAes: ReactiveState['dataBindAes'],\n inputGuide: InputGuide<InputState>,\n groupingSchema: ColumnNameSchema[] = [],\n defaultDotSize = DEFAULT_DOT_SIZE\n): ScatterplotSettings['layers'] {\n const result: ScatterplotSettings['layers'] = [];\n\n function useDefault<T extends string>(value: T | MappingLink | null, columns: string[], defaultValue: T, continousAvailable = false): T | {\n type: 'grouping',\n value: string\n } | ContinuousDataMappingForGraph<T> {\n if (columns.length) {\n const valueType = columns.length ? inputGuide.getSourceInfo(columns[0])?.type : undefined;\n const defaultByColumn = (valueType === 'String' || !continousAvailable)\n ? { type: 'grouping', value: columns[0] } as { type: 'grouping', value: string }\n : getContinuousColor<T>(columns[0], createContinuousMappingFromPalette(DEFAULT_CONTINUOUS_PALETTE), groupingSchema, dataByColumns);\n\n const savedMapping = dataBindAes[columns[0]];\n\n if (value === null || (valueType === 'String' || !continousAvailable) || !isAestheticMappingContinuous(savedMapping)) {\n return defaultByColumn;\n }\n return getContinuousColor<T>(columns[0], savedMapping as AestheticMappingContinuous, groupingSchema, dataByColumns);\n }\n\n return typeof value === 'object' ? defaultValue : value as T;\n }\n\n const grouping = optionsState.components.grouping.selectorStates.map((s) => s.selectedSource);\n const shape = optionsState.components.shape?.selectorStates.map((s) => s.selectedSource) ?? [];\n const sizeKey = optionsState.components.size?.selectorStates.map((s) => s.selectedSource)[0];\n const sizeColumn = sizeKey ? groupingSchema.find(column => column.value === sizeKey) : undefined;\n\n layers.forEach((layer) => {\n if (layer === 'dots') {\n const settings = layerSettings[layer];\n result.push({\n type: 'dots',\n aes: {\n dotFill: useDefault<string>(settings.dotFill, grouping, DEFAULT_BLACK, true) as string | {\n type: 'grouping',\n value: string\n } | ContinuousDataMappingForGraph<string>,\n dotShape: useDefault<DotShape>(settings.dotShape, shape, DEFAULT_DOT_SHAPE) as {\n type: 'grouping',\n value: string\n } | DotShape,\n dotSize: getDotSize(sizeColumn, settings.dotSize, dataByColumns, defaultDotSize)\n }\n });\n }\n if (layer === 'curve') {\n const settings = layerSettings[layer];\n result.push({\n type: 'curve',\n smoothing: settings.smoothing,\n aes: {\n lineColor: useDefault<string>(settings.lineColor, grouping, DEFAULT_BLACK, true) as {\n type: 'grouping',\n value: string\n } | string\n }\n });\n }\n });\n return result;\n}\n\nexport type ChartLayerSettings = {\n [key: string]: string | boolean | null | Record<string, string | DotShape | NumberRange | {\n domain: number[],\n range: number[]\n } | LineType | boolean | number | MappingLink | Record<string, string>> | undefined;\n type: string,\n aes?: Record<string, string | DotShape | NumberRange | {\n domain: number[],\n range: number[]\n } | LineType | boolean | number | MappingLink | Record<string, string>>,\n}\n"],"names":["getStatLayers","statisticsSettings","layers","layer","getDiscreteLayersSettings","layerSettings","optionsState","inputGuide","result","hasPrimaryGrouping","hasSecondaryGrouping","useDefaultColor","value","onlySecondaryAvailable","settings","isProtein","_a","AMINOACID_COLOR_MAPPING","NUCLEOTIDE_COLOR_MAPPING","getDotSize","column","dotSize","dataByColumns","defaultDotSize","mapping","isContinuousDataMapping","DEFAULT_DOT_RANGE","domain","v","getContinuousColor","columnKey","groupingColumns","groupingColumn","range","palette","midPoint","log","minValueMissed","maxValueMissed","maxDistance","PALETTE_MAP","DEFAULT_BLACK","getScatterplotLayersSettings","dataBindAes","groupingSchema","DEFAULT_DOT_SIZE","useDefault","columns","defaultValue","continousAvailable","valueType","defaultByColumn","createContinuousMappingFromPalette","DEFAULT_CONTINUOUS_PALETTE","savedMapping","isAestheticMappingContinuous","grouping","s","shape","sizeKey","_b","sizeColumn","DEFAULT_DOT_SHAPE"],"mappings":";;;AAsCO,SAASA,EAAcC,GAA6C;AACzE,QAAMC,IAA+B,CAAA;AAWrC,MATED,EAAmB,QAAQ,KAAK,cAChCA,EAAmB,QAAQ,SAAS,cAEpCC,EAAO,KAAK;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAYD,EAAmB,QAAQ,KAAK;AAAA,EAAA,CAC7C,GAGDA,EAAmB,eAAe,KAAK,cACvCA,EAAmB,eAAe,SAAS,cAC3CA,EAAmB,eAAe,SAAS,gBAC3C;AACA,UAAME,IAA4B;AAAA,MAChC,MAAM;AAAA,MACN,UAAU;AAAA,MACV,YAAYF,EAAmB,eAAe,KAAK;AAAA,MACnD,gBAAgBA,EAAmB,eAAe,KAAK;AAAA,MACvD,QAAQA,EAAmB,eAAe,KAAK;AAAA,MAC/C,IA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,SAAS3C,EAAW0C,GAAY/C,EAAS,SAASQ,GAAeC,CAAc;AAAA,QAAA;AAAA,MACjF,CACD;AAAA,IACH;AACA,QAAIpB,MAAU,SAAS;AACrB,YAAMW,IAAWT,EAAcF,CAAK;AACpC,MAAAK,EAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,WAAWM,EAAS;AAAA,QACpB,KAAK;AAAA,UACH,WAAWgC,EAAmBhC,EAAS,WAAW0C,GAAUf,GAAe,EAAI;AAAA,QAAA;AAAA,MAIjF,CACD;AAAA,IACH;AAAA,EACF,CAAC,GACMjC;AACT;"}
|
|
1
|
+
{"version":3,"file":"getLayersDataFromForms.js","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.ts"],"sourcesContent":["import {\n ColorAes,\n getDefaultLayersSettings,\n NumberRange,\n LayersSettings,\n MappingLink,\n DiscreteStatisticsState,\n ColumnNameSchema,\n ContinuousDataMappingSize,\n isContinuousDataMapping,\n ContinuousDataMappingForGraph\n} from '../../constantsCommon';\nimport {\n Layer,\n ReactiveState\n} from '../../types';\nimport {\n DiscreteUIState, InputGuide,\n InputState,\n PlotDataAndSettings,\n ScatterplotUIState\n} from '@milaboratories/pf-plots';\nimport { DotShape, LineType } from '../../components/AesSettings/types';\nimport {\n AMINOACID_COLOR_MAPPING,\n DEFAULT_BLACK,\n DEFAULT_CONTINUOUS_PALETTE,\n DEFAULT_DOT_SHAPE, NUCLEOTIDE_COLOR_MAPPING,\n PALETTE_MAP\n} from '../../constantsAesthetic';\nimport {\n AestheticMappingContinuous, createContinuousMappingFromPalette,\n DEFAULT_DOT_RANGE,\n DEFAULT_DOT_SIZE\n} from '../../dataBindAes';\nimport { ScatterplotSettings } from '@milaboratories/miplots4';\nimport { isAestheticMappingContinuous } from '../../dataBindAes';\n\nexport function getStatLayers(statisticsSettings: DiscreteStatisticsState) {\n const layers: ChartLayerSettings[] = [];\n if (\n statisticsSettings.overall.data.testMethod &&\n statisticsSettings.overall.validity.testMethod\n ) {\n layers.push({\n type: 'stat',\n statType: 'overall',\n testMethod: statisticsSettings.overall.data.testMethod\n });\n }\n if (\n statisticsSettings.referenceGroup.data.testMethod &&\n statisticsSettings.referenceGroup.validity.testMethod &&\n statisticsSettings.referenceGroup.validity.referenceGroup\n ) {\n const layer: ChartLayerSettings = {\n type: 'stat',\n statType: 'referenceGroup',\n testMethod: statisticsSettings.referenceGroup.data.testMethod,\n referenceGroup: statisticsSettings.referenceGroup.data.referenceGroup,\n format: statisticsSettings.referenceGroup.data.format,\n ns: statisticsSettings.referenceGroup.data.ns\n };\n if (statisticsSettings.referenceGroup.data.correctionMethod !== 'none') {\n layer.correctionMethod =\n statisticsSettings.referenceGroup.data.correctionMethod;\n }\n layers.push(layer);\n }\n if (\n statisticsSettings.pairwise.data.testMethod &&\n statisticsSettings.pairwise.validity.testMethod\n ) {\n const layer: ChartLayerSettings = {\n type: 'stat',\n statType: 'pairwise',\n testMethod: statisticsSettings.pairwise.data.testMethod,\n format: statisticsSettings.pairwise.data.format,\n ns: statisticsSettings.pairwise.data.ns\n };\n if (statisticsSettings.referenceGroup.data.correctionMethod !== 'none') {\n layer.correctionMethod =\n statisticsSettings.referenceGroup.data.correctionMethod;\n }\n layers.push(layer);\n }\n return layers;\n}\n\nexport function getDiscreteLayersSettings(\n layers: Layer[],\n layerSettings: LayersSettings,\n statisticsSettings: DiscreteStatisticsState,\n optionsState: DiscreteUIState,\n inputGuide: InputGuide<InputState>\n): ChartLayerSettings[] {\n const result: ChartLayerSettings[] = [];\n const hasPrimaryGrouping =\n optionsState.components.primaryGrouping.selectorStates.length > 0;\n const hasSecondaryGrouping =\n optionsState.components.secondaryGrouping.selectorStates.length > 0;\n // If user didn't touch layers settings, some aes that can be mapped to groupings has 'null' value - we set them to secondary or primary grouping if available\n // for 'line', 'errorbar' layer it isn't possible to set primary grouping as a color aes\n function useDefaultColor(\n value: ColorAes | null,\n onlySecondaryAvailable = false\n ) {\n if (value === null) {\n if (hasSecondaryGrouping) {\n return { type: 'secondaryGrouping' };\n }\n if (hasPrimaryGrouping && !onlySecondaryAvailable) {\n return { type: 'primaryGrouping' };\n }\n return { type: 'secondaryGrouping' };\n }\n return value;\n }\n\n layers.forEach((layer) => {\n if (layer === 'box') {\n const settings = layerSettings[layer];\n result.push({\n type: 'box',\n aes: {\n showOutliers: settings.showOutliers,\n dotShape: settings.dotShape,\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n lineShape: settings.lineType,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'binnedDots') {\n const settings = layerSettings[layer];\n result.push({\n type: 'binnedDots',\n aes: {\n showOutliers: settings.showOutliers,\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'jitteredDots') {\n const settings = layerSettings[layer];\n result.push({\n type: 'dot',\n aes: {\n showOutliers: settings.showOutliers,\n dotFill: useDefaultColor(settings.dotFill),\n dotShape: settings.dotShape,\n lineColor: settings.lineColor,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'violin') {\n const settings = layerSettings[layer];\n result.push({\n type: 'violin',\n stat: {\n trim: settings.trim\n },\n aes: {\n showQuartiles: settings.showQuartiles,\n medianLineStyle: settings.medianLineStyle,\n quartilesLineStyle: settings.quartilesLineStyle,\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n lineShape: settings.lineType,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'bar') {\n const settings = layerSettings[layer];\n result.push({\n type: 'bar',\n height: settings.height,\n aes: {\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'stackedBar') {\n const settings = layerSettings[layer];\n result.push({\n type: 'stackedBar',\n normalize: settings.normalize,\n aes: {\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'stackedArea') {\n const settings = layerSettings[layer];\n result.push({\n type: 'stackedArea',\n normalize: settings.normalize,\n showBars: settings.showBars,\n aes: {\n fillColor: useDefaultColor(settings.fillColor),\n lineColor: useDefaultColor(settings.lineColor),\n barsOpacity: settings.barsOpacity,\n areaOpacity: settings.areaOpacity,\n }\n });\n }\n if (layer === 'line') {\n const settings = layerSettings[layer];\n result.push({\n type: 'line',\n pointsValues: settings.pointsValues,\n aes: {\n lineColor: useDefaultColor(settings.lineColor, true),\n fillColor: useDefaultColor(settings.dotFill, true),\n lineShape: settings.lineType,\n dotShape: settings.dotShape,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'errorbar') {\n const settings = layerSettings[layer];\n result.push({\n type: 'errorbar',\n pointsValues: settings.pointsValues,\n interval: settings.interval,\n aes: {\n lineColor: useDefaultColor(settings.lineColor, true),\n fillColor: useDefaultColor(settings.dotFill, true),\n dotShape: settings.dotShape,\n opacity: settings.opacity\n }\n });\n }\n if (layer === 'sina') {\n const settings = layerSettings[layer];\n result.push({\n type: 'sina',\n aes: {\n showOutliers: settings.showOutliers,\n dotFill: useDefaultColor(settings.dotFill),\n dotShape: settings.dotShape\n }\n });\n }\n if (layer === 'logo' && hasSecondaryGrouping) {\n const settings = layerSettings[layer];\n const secondaryGroupingInfo = inputGuide.getSourceInfo(optionsState.components.secondaryGrouping.selectorStates[0].selectedSource);\n const isProtein = secondaryGroupingInfo.spec.domain?.['pl7.app/alphabet'] === 'aminoacid';\n result.push({\n type: 'logo',\n normalize: settings.normalize,\n aes: {\n opacity: settings.opacity,\n dotFill: isProtein ? AMINOACID_COLOR_MAPPING : NUCLEOTIDE_COLOR_MAPPING\n }\n });\n }\n });\n if (hasPrimaryGrouping && !hasSecondaryGrouping) {\n result.push(...getStatLayers(statisticsSettings));\n }\n return result;\n}\n\nfunction getDotSize(\n column: ColumnNameSchema | undefined,\n dotSize: ContinuousDataMappingSize | number | null,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n defaultDotSize: number\n): number | { columnName: ColumnNameSchema, domain: number[], range: number[] } {\n if (column) {\n const mapping = isContinuousDataMapping(dotSize) ? dotSize : { column: column.value, range: DEFAULT_DOT_RANGE };\n const domain = [Infinity, -Infinity];\n dataByColumns.values[column.value].forEach((v) => {\n const value = Number(v);\n if (value < domain[0]) {\n domain[0] = value;\n }\n if (value > domain[1]) {\n domain[1] = value;\n }\n });\n return { columnName: column, domain, range: [mapping.range.min, mapping.range.max] };\n }\n return isContinuousDataMapping(dotSize) ? defaultDotSize : dotSize ?? defaultDotSize;\n}\n\nfunction getContinuousColor<T extends string>(\n columnKey: string,\n value: AestheticMappingContinuous,\n groupingColumns: ColumnNameSchema[],\n dataByColumns: PlotDataAndSettings['data']['byColumns']\n): T | ContinuousDataMappingForGraph<T> {\n const column = groupingColumns.find(groupingColumn => groupingColumn.value === columnKey);\n let domain = [Infinity, -Infinity];\n if (column) {\n const { range, palette, midPoint, log } = value;\n const minValueMissed = range?.minValue === null || range?.minValue === undefined;\n const maxValueMissed = range?.maxValue === null || range?.maxValue === undefined;\n if (minValueMissed || maxValueMissed) {\n dataByColumns.values[column.value].forEach((v) => {\n const value = Number(v);\n if (minValueMissed && value < domain[0]) {\n domain[0] = value;\n }\n if (maxValueMissed && value > domain[1]) {\n domain[1] = value;\n }\n });\n }\n if (!minValueMissed) {\n domain[0] = range?.minValue as number;\n }\n if (!maxValueMissed) {\n domain[1] = range?.maxValue as number;\n }\n if (midPoint !== null && midPoint !== undefined) {\n const maxDistance = Math.max(Math.abs(midPoint - domain[0]), Math.abs(midPoint - domain[1]));\n domain[0] = midPoint - maxDistance;\n domain[1] = midPoint + maxDistance;\n }\n\n return {\n columnName: column,\n domain,\n range: PALETTE_MAP[palette].colors,\n type: log ? 'log' : 'linear'\n } as ContinuousDataMappingForGraph<T>;\n }\n return DEFAULT_BLACK as T;\n}\n\nexport function getScatterplotLayersSettings(\n layers: Layer[],\n layerSettings: ReturnType<typeof getDefaultLayersSettings>,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n optionsState: ScatterplotUIState,\n dataBindAes: ReactiveState['dataBindAes'],\n inputGuide: InputGuide<InputState>,\n groupingSchema: ColumnNameSchema[] = [],\n defaultDotSize = DEFAULT_DOT_SIZE\n): ScatterplotSettings['layers'] {\n const result: ScatterplotSettings['layers'] = [];\n\n function useDefault<T extends string>(value: T | MappingLink | null, columns: string[], defaultValue: T, continousAvailable = false): T | {\n type: 'grouping',\n value: string\n } | ContinuousDataMappingForGraph<T> {\n if (columns.length) {\n const valueType = columns.length ? inputGuide.getSourceInfo(columns[0])?.type : undefined;\n const defaultByColumn = (valueType === 'String' || !continousAvailable)\n ? { type: 'grouping', value: columns[0] } as { type: 'grouping', value: string }\n : getContinuousColor<T>(columns[0], createContinuousMappingFromPalette(DEFAULT_CONTINUOUS_PALETTE), groupingSchema, dataByColumns);\n\n const savedMapping = dataBindAes[columns[0]];\n\n if (value === null || (valueType === 'String' || !continousAvailable) || !isAestheticMappingContinuous(savedMapping)) {\n return defaultByColumn;\n }\n return getContinuousColor<T>(columns[0], savedMapping as AestheticMappingContinuous, groupingSchema, dataByColumns);\n }\n\n return typeof value === 'object' ? defaultValue : value as T;\n }\n\n const grouping = optionsState.components.grouping.selectorStates.map((s) => s.selectedSource);\n const shape = optionsState.components.shape?.selectorStates.map((s) => s.selectedSource) ?? [];\n const sizeKey = optionsState.components.size?.selectorStates.map((s) => s.selectedSource)[0];\n const sizeColumn = sizeKey ? groupingSchema.find(column => column.value === sizeKey) : undefined;\n\n layers.forEach((layer) => {\n if (layer === 'dots') {\n const settings = layerSettings[layer];\n result.push({\n type: 'dots',\n aes: {\n dotFill: useDefault<string>(settings.dotFill, grouping, DEFAULT_BLACK, true) as string | {\n type: 'grouping',\n value: string\n } | ContinuousDataMappingForGraph<string>,\n dotShape: useDefault<DotShape>(settings.dotShape, shape, DEFAULT_DOT_SHAPE) as {\n type: 'grouping',\n value: string\n } | DotShape,\n dotSize: getDotSize(sizeColumn, settings.dotSize, dataByColumns, defaultDotSize)\n }\n });\n }\n if (layer === 'curve') {\n const settings = layerSettings[layer];\n result.push({\n type: 'curve',\n smoothing: settings.smoothing,\n aes: {\n lineColor: useDefault<string>(settings.lineColor, grouping, DEFAULT_BLACK, true) as {\n type: 'grouping',\n value: string\n } | string\n }\n });\n }\n });\n return result;\n}\n\nexport type ChartLayerSettings = {\n [key: string]: string | boolean | null | Record<string, string | DotShape | NumberRange | {\n domain: number[],\n range: number[]\n } | LineType | boolean | number | MappingLink | Record<string, string>> | undefined;\n type: string,\n aes?: Record<string, string | DotShape | NumberRange | {\n domain: number[],\n range: number[]\n } | LineType | boolean | number | MappingLink | Record<string, string>>,\n}\n"],"names":["getStatLayers","statisticsSettings","layers","layer","getDiscreteLayersSettings","layerSettings","optionsState","inputGuide","result","hasPrimaryGrouping","hasSecondaryGrouping","useDefaultColor","value","onlySecondaryAvailable","settings","isProtein","_a","AMINOACID_COLOR_MAPPING","NUCLEOTIDE_COLOR_MAPPING","getDotSize","column","dotSize","dataByColumns","defaultDotSize","mapping","isContinuousDataMapping","DEFAULT_DOT_RANGE","domain","v","getContinuousColor","columnKey","groupingColumns","groupingColumn","range","palette","midPoint","log","minValueMissed","maxValueMissed","maxDistance","PALETTE_MAP","DEFAULT_BLACK","getScatterplotLayersSettings","dataBindAes","groupingSchema","DEFAULT_DOT_SIZE","useDefault","columns","defaultValue","continousAvailable","valueType","defaultByColumn","createContinuousMappingFromPalette","DEFAULT_CONTINUOUS_PALETTE","savedMapping","isAestheticMappingContinuous","grouping","s","shape","sizeKey","_b","sizeColumn","DEFAULT_DOT_SHAPE"],"mappings":";;;AAsCO,SAASA,EAAcC,GAA6C;AACzE,QAAMC,IAA+B,CAAA;AAWrC,MATED,EAAmB,QAAQ,KAAK,cAChCA,EAAmB,QAAQ,SAAS,cAEpCC,EAAO,KAAK;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAYD,EAAmB,QAAQ,K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AAM4C,IAAWlD,EAAa,WAAW,SAAS,eAAe,IAAI,CAACmD,MAAMA,EAAE,cAAc,GACtFC,MAAQ1C,IAAAV,EAAa,WAAW,UAAxB,gBAAAU,EAA+B,eAAe,IAAI,CAACyC,MAAMA,EAAE,oBAAmB,CAAA,GACtFE,KAAUC,IAAAtD,EAAa,WAAW,SAAxB,gBAAAsD,EAA8B,eAAe,IAAI,CAACH,MAAMA,EAAE,gBAAgB,IACpFI,IAAaF,IAAUf,EAAe,KAAK,OAAUxB,EAAO,UAAUuC,CAAO,IAAI;AAEvF,SAAAzD,EAAO,QAAQ,CAACC,MAAU;AACxB,QAAIA,MAAU,QAAQ;AACpB,YAAMW,IAAWT,EAAcF,CAAK;AACpC,MAAAK,EAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,KAAK;AAAA,UACH,SAASsC,EAAmBhC,EAAS,SAAS0C,GAAUf,GAAe,EAAI;AAAA,UAI3E,UAAUK,EAAqBhC,EAAS,UAAU4C,GAAOI,CAAiB;AAAA,UAI1E,SAAS3C,EAAW0C,GAAY/C,EAAS,SAASQ,GAAeC,CAAc;AAAA,QAAA;AAAA,MACjF,CACD;AAAA,IACH;AACA,QAAIpB,MAAU,SAAS;AACrB,YAAMW,IAAWT,EAAcF,CAAK;AACpC,MAAAK,EAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,WAAWM,EAAS;AAAA,QACpB,KAAK;AAAA,UACH,WAAWgC,EAAmBhC,EAAS,WAAW0C,GAAUf,GAAe,EAAI;AAAA,QAAA;AAAA,MAIjF,CACD;AAAA,IACH;AAAA,EACF,CAAC,GACMjC;AACT;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../node_modules/@milaboratories/pf-plots/dist/index.js";
|
|
2
2
|
import { toRaw as v } from "vue";
|
|
3
3
|
import { SUBSET_FILTER_KEY as h } from "../constantsCommon.js";
|
|
4
|
+
import { AxisId as F } from "../../node_modules/@milaboratories/pf-plots/dist/spec.js";
|
|
4
5
|
function w(n, r) {
|
|
5
6
|
if (typeof n > "u")
|
|
6
7
|
return !0;
|
|
@@ -10,7 +11,7 @@ function w(n, r) {
|
|
|
10
11
|
function A(n, r, d, l) {
|
|
11
12
|
return (r == null ? void 0 : r[h]) === "true" ? "subset" : l !== void 0 ? "range" : d !== void 0 || n === "Int" || n === "String" ? "equals" : "range";
|
|
12
13
|
}
|
|
13
|
-
async function
|
|
14
|
+
async function B(n, r, d = !0) {
|
|
14
15
|
const l = [], V = r.filter(({ selectedSource: e }) => "kind" in e && e.kind === "PColumn"), T = r.filter(({ selectedSource: e }) => !("kind" in e && e.kind === "PColumn")), C = [];
|
|
15
16
|
for (const { inputName: e, filterType: f, selectedSource: S, selectedFilterValue: u, selectedFilterRange: y, fixedAxes: a } of V) {
|
|
16
17
|
const { name: p, valueType: m, annotations: c, domain: s } = S, o = await n.pFrameProvider.findColumnBy(p, m, v(c), v(s)), x = e === "filters" || e === "tabBy" || e === "highlight";
|
|
@@ -69,6 +70,6 @@ async function k(n, r, d = !0) {
|
|
|
69
70
|
return l;
|
|
70
71
|
}
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
B as loadDefaultSources
|
|
73
74
|
};
|
|
74
75
|
//# sourceMappingURL=loadDefaultSources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadDefaultSources.js","sources":["../../../src/GraphMaker/utils/loadDefaultSources.ts"],"sourcesContent":["import {\n AxisId,\n ChartType,\n ColumnId,\n DemoDataStore,\n InputNamesByChartType,\n SelectorStateFilter, SelectorStateSimple\n} from '@milaboratories/pf-plots';\nimport { PredefinedGraphOption } from '../types';\nimport { AxisSpec, PColumnSpec, ValueType } from '@platforma-sdk/model';\nimport { toRaw } from 'vue';\nimport { SUBSET_FILTER_KEY } from '../constantsCommon';\n\ntype LoadedDefaultOptions<T extends ChartType> = {\n inputName: InputNamesByChartType[T],\n selectedSource: string,\n fixedAxes: SelectorStateSimple['fixedAxes'],\n filterType?: SelectorStateFilter['type']\n selectedFilterRange?: SelectorStateFilter['selectedFilterRange']\n selectedFilterValue?: SelectorStateFilter['selectedFilterValue']\n}\n\nfunction domainIsCompatible(domain?:Record<string, string>, otherDomain?:Record<string, string>):boolean {\n if (typeof domain === 'undefined') {\n return true;\n }\n const keys = Object.keys(domain);\n if (typeof otherDomain === 'undefined') {\n return keys.length === 0;\n }\n return keys.every((key) => otherDomain[key]);\n}\n\nfunction getDefaultFilterType(\n valueType:ValueType,\n annotations?:Record<string, string>,\n selectedFilterValue?: SelectorStateFilter['selectedFilterValue'],\n selectedFilterRange?: Partial<SelectorStateFilter['selectedFilterRange']>\n):SelectorStateFilter['type'] {\n if (annotations?.[SUBSET_FILTER_KEY] === 'true') {\n return 'subset';\n }\n if (selectedFilterRange !== undefined) {\n return 'range';\n }\n if (selectedFilterValue !== undefined) {\n return 'equals';\n }\n if (valueType === 'Int' || valueType === 'String') {\n return 'equals';\n }\n return 'range';\n}\nexport async function loadDefaultSources (\n dataStore:DemoDataStore,\n defaultOptions:PredefinedGraphOption<ChartType>[],\n considerAxisDomains = true,\n):Promise<LoadedDefaultOptions<ChartType>[]> {\n const result:LoadedDefaultOptions<ChartType>[] = []\n const defaultColumnStates = defaultOptions.filter(({ selectedSource }) => 'kind' in selectedSource && selectedSource.kind === 'PColumn');\n const defaultAxisStates = defaultOptions.filter(({ selectedSource }) => !('kind' in selectedSource && selectedSource.kind === 'PColumn'));\n\n const allowedAxisSpecs = [] as {spec: AxisSpec, parentColumn:ColumnId}[]; // if default options contain axes - they should be in other default columns\n\n for (const { inputName, filterType, selectedSource, selectedFilterValue, selectedFilterRange, fixedAxes } of defaultColumnStates) {\n const { name, valueType, annotations, domain } = selectedSource as PColumnSpec;\n const columnId = await dataStore.pFrameProvider.findColumnBy(name, valueType, toRaw(annotations), toRaw(domain));\n const isFilter = inputName === 'filters' || inputName === 'tabBy' || inputName === 'highlight';\n if (columnId) {\n const spec = await dataStore.pFrameProvider.getColumnSpecById(columnId);\n const fixedAxesFilled:SelectorStateSimple['fixedAxes'] = spec && fixedAxes ? fixedAxes.map((el) => ({axisIdx: el.axisIdx, axisValue: el.axisValue, axisSource: AxisId.fromAxisSpec(spec?.axesSpec[el.axisIdx]).toCanonicalString()})) : [];\n if (!isFilter) {\n result.push({ inputName, selectedSource: columnId.toCanonicalString(), fixedAxes: fixedAxesFilled});\n } else {\n const defaultFilterType = filterType ?? getDefaultFilterType(valueType, spec?.annotations, selectedFilterValue, selectedFilterRange);\n const defaultSelectedFilterValue = defaultFilterType === 'equals' && typeof selectedFilterValue === 'undefined'\n ? (await dataStore.pFrameProvider.getColumnUniqueValues(columnId, 1)).values[0]\n : selectedFilterValue;\n const defaultFilterRange = {min: undefined, max: undefined, ...selectedFilterRange};\n result.push({\n inputName,\n filterType: defaultFilterType,\n selectedSource: columnId.toCanonicalString(),\n selectedFilterValue: defaultSelectedFilterValue,\n selectedFilterRange: defaultFilterRange as SelectorStateFilter['selectedFilterRange'],\n fixedAxes: fixedAxesFilled\n });\n }\n\n allowedAxisSpecs.push(...spec?.axesSpec.map((spec) => ({spec, parentColumn:columnId})) ?? []);\n } else {\n console.warn(`Not found column for default option: ${JSON.stringify({inputName, selectedSource})}`)\n }\n }\n for (const { inputName, selectedSource, filterType, selectedFilterValue, selectedFilterRange } of defaultAxisStates) {\n const axisId = AxisId.fromAxisSpec(selectedSource as AxisSpec);\n const axisSourceStr = axisId.toCanonicalString();\n const isFilter = inputName === 'filters' || inputName === 'tabBy' || inputName === 'highlight';\n const defaultFilterType = isFilter ? filterType ?? getDefaultFilterType(axisId.type, selectedSource?.annotations) : undefined;\n\n const columnWithExistingAxis = allowedAxisSpecs.find((el) => AxisId.fromAxisSpec(el.spec).toCanonicalString() === axisSourceStr) ;\n const defaultSelectedFilterValue = isFilter && defaultFilterType === 'equals' && typeof selectedFilterValue === 'undefined' && columnWithExistingAxis?.parentColumn\n ? (await dataStore.pFrameProvider.getAxisUniqueValues(axisId, [columnWithExistingAxis?.parentColumn], 1)).values[0]\n : selectedFilterValue\n const defaultFilterRange = {min: undefined, max: undefined, ...selectedFilterRange};\n\n if (!considerAxisDomains) {\n result.push({\n inputName,\n filterType: defaultFilterType,\n selectedSource: axisSourceStr,\n selectedFilterValue: defaultSelectedFilterValue,\n selectedFilterRange: defaultFilterRange as SelectorStateFilter['selectedFilterRange'],\n fixedAxes: []\n });\n }\n if (columnWithExistingAxis) {\n result.push({\n inputName,\n filterType: defaultFilterType,\n selectedSource: axisSourceStr,\n selectedFilterValue: defaultSelectedFilterValue,\n selectedFilterRange: defaultFilterRange as SelectorStateFilter['selectedFilterRange'],\n fixedAxes: []\n });\n } else {\n const { spec: allowedCompatibleAxisSpec, parentColumn } = allowedAxisSpecs.find((el) => {\n return axisId.name === el.spec.name && axisId.type === el.spec.type && domainIsCompatible(axisId.domain, el.spec.domain);\n }) ?? {};\n if (allowedCompatibleAxisSpec) {\n const defaultSelectedFilterValue = (inputName === 'filters' || inputName === 'tabBy') && typeof selectedFilterValue === 'undefined'\n ? (await dataStore.pFrameProvider.getAxisUniqueValues(AxisId.fromAxisSpec(allowedCompatibleAxisSpec), [parentColumn as ColumnId], 1)).values[0]\n : selectedFilterValue\n result.push({\n inputName,\n filterType: defaultFilterType,\n selectedSource: AxisId.fromAxisSpec(allowedCompatibleAxisSpec).toCanonicalString(),\n selectedFilterValue: defaultSelectedFilterValue,\n selectedFilterRange: defaultFilterRange as SelectorStateFilter['selectedFilterRange'],\n fixedAxes: []\n });\n }\n }\n }\n\n return result;\n}"],"names":["domainIsCompatible","domain","otherDomain","keys","key","getDefaultFilterType","valueType","annotations","selectedFilterValue","selectedFilterRange","SUBSET_FILTER_KEY","loadDefaultSources","dataStore","defaultOptions","considerAxisDomains","result","defaultColumnStates","selectedSource","defaultAxisStates","allowedAxisSpecs","inputName","filterType","fixedAxes","name","columnId","toRaw","isFilter","spec","fixedAxesFilled","el","AxisId","defaultFilterType","defaultSelectedFilterValue","defaultFilterRange","axisId","axisS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,kBAAA;AAAA,UAC/D,qBAAqBL;AAAAA,UACrB,qBAAqBC;AAAA,UACrB,WAAW,CAAA;AAAA,QAAC,CACb;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,SAAOlB;AACT;"}
|
|
1
|
+
{"version":3,"file":"loadDefaultSources.js","sources":["../../../src/GraphMaker/utils/loadDefaultSources.ts"],"sourcesContent":["import {\n AxisId,\n ChartType,\n ColumnId,\n DemoDataStore,\n InputNamesByChartType,\n SelectorStateFilter, SelectorStateSimple\n} from '@milaboratories/pf-plots';\nimport { PredefinedGraphOption } from '../types';\nimport { AxisSpec, PColumnSpec, ValueType } from '@platforma-sdk/model';\nimport { toRaw } from 'vue';\nimport { SUBSET_FILTER_KEY } from '../constantsCommon';\n\ntype LoadedDefaultOptions<T extends ChartType> = {\n inputName: InputNamesByChartType[T],\n selectedSource: string,\n fixedAxes: SelectorStateSimple['fixedAxes'],\n filterType?: SelectorStateFilter['type']\n selectedFilterRange?: SelectorStateFilter['selectedFilterRange']\n selectedFilterValue?: SelectorStateFilter['selectedFilterValue']\n}\n\nfunction domainIsCompatible(domain?:Record<string, string>, otherDomain?:Record<string, string>):boolean {\n if (typeof domain === 'undefined') {\n return true;\n }\n const keys = Object.keys(domain);\n if (typeof otherDomain === 'undefined') {\n return keys.length === 0;\n }\n return keys.every((key) => otherDomain[key]);\n}\n\nfunction getDefaultFilterType(\n valueType:ValueType,\n annotations?:Record<string, string>,\n selectedFilterValue?: SelectorStateFilter['selectedFilterValue'],\n selectedFilterRange?: Partial<SelectorStateFilter['selectedFilterRange']>\n):SelectorStateFilter['type'] {\n if (annotations?.[SUBSET_FILTER_KEY] === 'true') {\n return 'subset';\n }\n if (selectedFilterRange !== undefined) {\n return 'range';\n }\n if (selectedFilterValue !== undefined) {\n return 'equals';\n }\n if (valueType === 'Int' || valueType === 'String') {\n return 'equals';\n }\n return 'range';\n}\nexport async function loadDefaultSources (\n dataStore:DemoDataStore,\n defaultOptions:PredefinedGraphOption<ChartType>[],\n considerAxisDomains = true,\n):Promise<LoadedDefaultOptions<ChartType>[]> {\n const result:LoadedDefaultOptions<ChartType>[] = []\n const defaultColumnStates = defaultOptions.filter(({ selectedSource }) => 'kind' in selectedSource && selectedSource.kind === 'PColumn');\n const defaultAxisStates = defaultOptions.filter(({ selectedSource }) => !('kind' in selectedSource && selectedSource.kind === 'PColumn'));\n\n const allowedAxisSpecs = [] as {spec: AxisSpec, parentColumn:ColumnId}[]; // if default options contain axes - they should be in other default columns\n\n for (const { inputName, filterType, selectedSource, selectedFilterValue, selectedFilterRange, fixedAxes } of defaultColumnStates) {\n const { name, valueType, annotations, domain } = selectedSource as PColumnSpec;\n const columnId = await dataStore.pFrameProvider.findColumnBy(name, valueType, toRaw(annotations), toRaw(domain));\n const isFilter = inputName === 'filters' || inputName === 'tabBy' || inputName === 'highlight';\n if (columnId) {\n const spec = await dataStore.pFrameProvider.getColumnSpecById(columnId);\n const fixedAxesFilled:SelectorStateSimple['fixedAxes'] = spec && fixedAxes ? fixedAxes.map((el) => ({axisIdx: el.axisIdx, axisValue: el.axisValue, axisSource: AxisId.fromAxisSpec(spec?.axesSpec[el.axisIdx]).toCanonicalString()})) : [];\n if (!isFilter) {\n result.push({ inputName, selectedSource: columnId.toCanonicalString(), fixedAxes: fixedAxesFilled});\n } else {\n const defaultFilterType = filterType ?? getDefaultFilterType(valueType, spec?.annotations, selectedFilterValue, selectedFilterRange);\n const defaultSelectedFilterValue = defaultFilterType === 'equals' && typeof selectedFilterValue === 'undefined'\n ? (await dataStore.pFrameProvider.getColumnUniqueValues(columnId, 1)).values[0]\n : selectedFilterValue;\n const defaultFilterRange = {min: undefined, max: undefined, ...selectedFilterRange};\n result.push({\n inputName,\n filterType: defaultFilterType,\n selectedSource: columnId.toCanonicalString(),\n selectedFilterValue: defaultSelectedFilterValue,\n selectedFilterRange: defaultFilterRange as SelectorStateFilter['selectedFilterRange'],\n fixedAxes: fixedAxesFilled\n });\n }\n\n allowedAxisSpecs.push(...spec?.axesSpec.map((spec) => ({spec, parentColumn:columnId})) ?? []);\n } else {\n console.warn(`Not found column for default option: ${JSON.stringify({inputName, selectedSource})}`)\n }\n }\n for (const { inputName, selectedSource, filterType, selectedFilterValue, selectedFilterRange } of defaultAxisStates) {\n const axisId = AxisId.fromAxisSpec(selectedSource as AxisSpec);\n const axisSourceStr = axisId.toCanonicalString();\n const isFilter = inputName === 'filters' || inputName === 'tabBy' || inputName === 'highlight';\n const defaultFilterType = isFilter ? filterType ?? getDefaultFilterType(axisId.type, selectedSource?.annotations) : undefined;\n\n const columnWithExistingAxis = allowedAxisSpecs.find((el) => AxisId.fromAxisSpec(el.spec).toCanonicalString() === axisSourceStr) ;\n const defaultSelectedFilterValue = isFilter && defaultFilterType === 'equals' && typeof selectedFilterValue === 'undefined' && columnWithExistingAxis?.parentColumn\n ? (await dataStore.pFrameProvider.getAxisUniqueValues(axisId, [columnWithExistingAxis?.parentColumn], 1)).values[0]\n : selectedFilterValue\n const defaultFilterRange = {min: undefined, max: undefined, ...selectedFilterRange};\n\n if (!considerAxisDomains) {\n result.push({\n inputName,\n filterType: defaultFilterType,\n selectedSource: axisSourceStr,\n selectedFilterValue: defaultSelectedFilterValue,\n selectedFilterRange: defaultFilterRange as SelectorStateFilter['selectedFilterRange'],\n fixedAxes: []\n });\n }\n if (columnWithExistingAxis) {\n result.push({\n inputName,\n filterType: defaultFilterType,\n selectedSource: axisSourceStr,\n selectedFilterValue: defaultSelectedFilterValue,\n selectedFilterRange: defaultFilterRange as SelectorStateFilter['selectedFilterRange'],\n fixedAxes: []\n });\n } else {\n const { spec: allowedCompatibleAxisSpec, parentColumn } = allowedAxisSpecs.find((el) => {\n return axisId.name === el.spec.name && axisId.type === el.spec.type && domainIsCompatible(axisId.domain, el.spec.domain);\n }) ?? {};\n if (allowedCompatibleAxisSpec) {\n const defaultSelectedFilterValue = (inputName === 'filters' || inputName === 'tabBy') && typeof selectedFilterValue === 'undefined'\n ? (await dataStore.pFrameProvider.getAxisUniqueValues(AxisId.fromAxisSpec(allowedCompatibleAxisSpec), [parentColumn as ColumnId], 1)).values[0]\n : selectedFilterValue\n result.push({\n inputName,\n filterType: defaultFilterType,\n selectedSource: AxisId.fromAxisSpec(allowedCompatibleAxisSpec).toCanonicalString(),\n selectedFilterValue: defaultSelectedFilterValue,\n selectedFilterRange: defaultFilterRange as SelectorStateFilter['selectedFilterRange'],\n fixedAxes: []\n });\n }\n }\n }\n\n return result;\n}"],"names":["domainIsCompatible","domain","otherDomain","keys","key","getDefaultFilterType","valueType","annotations","selectedFilterValue","selectedFilterRange","SUBSET_FILTER_KEY","loadDefaultSources","dataStore","defaultOptions","considerAxisDomains","result","defaultColumnStates","selectedSource","defaultAxisStates","allowedAxisSpecs","inputName","filterType","fixedAxes","name","columnId","toRaw","isFilter","spec","fixedAxesFilled","el","AxisId","defaultFilterType","defaultSelectedFilterValue","defaultFilterRange","axisId","axisSourceStr","columnWithExistingAxis","allowedCompatibleAxisSpec","parentColumn"],"mappings":";;;;AAsBA,SAASA,EAAmBC,GAAgCC,GAA6C;AACvG,MAAI,OAAOD,IAAW;AACpB,WAAO;AAET,QAAME,IAAO,OAAO,KAAKF,CAAM;AAC/B,SAAI,OAAOC,IAAgB,MAClBC,EAAK,WAAW,IAElBA,EAAK,MAAM,CAACC,MAAQF,EAAYE,CAAG,CAAC;AAC7C;AAEA,SAASC,EACPC,GACAC,GACAC,GACAC,GAC4B;AAC5B,UAAIF,KAAA,gBAAAA,EAAcG,QAAuB,SAChC,WAELD,MAAwB,SACnB,UAELD,MAAwB,UAGxBF,MAAc,SAASA,MAAc,WAChC,WAEF;AACT;AACA,eAAsBK,EACpBC,GACAC,GACAC,IAAsB,IACqB;AAC3C,QAAMC,IAA2C,CAAA,GAC3CC,IAAsBH,EAAe,OAAO,CAAC,EAAE,gBAAAI,QAAqB,UAAUA,KAAkBA,EAAe,SAAS,SAAS,GACjIC,IAAoBL,EAAe,OAAO,CAAC,EAAE,gBAAAI,EAAA,MAAqB,E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;AAAA,QACrB,WAAW,CAAA;AAAA,MAAC,CACb;AAAA,SACI;AACL,YAAM,EAAE,MAAMI,GAA2B,cAAAC,EAAA,IAAiBnB,EAAiB,KAAK,CAACU,MACxEK,EAAO,SAASL,EAAG,KAAK,QAAQK,EAAO,SAASL,EAAG,KAAK,QAAQ7B,EAAmBkC,EAAO,QAAQL,EAAG,KAAK,MAAM,CACxH,KAAK,CAAA;AACN,UAAIQ,GAA2B;AAC7B,cAAML,KAA8BZ,MAAc,aAAaA,MAAc,YAAY,OAAOZ,IAAwB,OACnH,MAAMI,EAAU,eAAe,oBAAoBkB,EAAO,aAAaO,CAAyB,GAAG,CAACC,CAAwB,GAAG,CAAC,GAAG,OAAO,CAAC,IAC5I9B;AACJ,QAAAO,EAAO,KAAK;AAAA,UACV,WAAAK;AAAA,UACA,YAAYW;AAAA,UACZ,gBAAgBD,EAAO,aAAaO,CAAyB,EAAE,kBAAA;AAAA,UAC/D,qBAAqBL;AAAAA,UACrB,qBAAqBC;AAAA,UACrB,WAAW,CAAA;AAAA,QAAC,CACb;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,SAAOlB;AACT;"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1
|
+
function e(t) {
|
|
2
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
4
3
|
}
|
|
5
4
|
export {
|
|
6
|
-
|
|
7
|
-
l as getDefaultExportFromCjs
|
|
5
|
+
e as getDefaultExportFromCjs
|
|
8
6
|
};
|
|
9
7
|
//# sourceMappingURL=_commonjsHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_commonjsHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -7,7 +7,7 @@ import { ChartScatterplotUmap as f } from "./scatterplot-umap/index.js";
|
|
|
7
7
|
import { ChartBubble as d } from "./bubble/index.js";
|
|
8
8
|
import { DataFrame as s } from "./DataFrame.js";
|
|
9
9
|
import { exhaustive as l } from "./utils/index.js";
|
|
10
|
-
var C = Object.defineProperty,
|
|
10
|
+
var C = Object.defineProperty, w = (o, t, r) => t in o ? C(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r, i = (o, t, r) => w(o, typeof t != "symbol" ? t + "" : t, r);
|
|
11
11
|
class h {
|
|
12
12
|
constructor(t) {
|
|
13
13
|
i(this, "node"), i(this, "chart"), this.chart = t;
|