@milaboratories/graph-maker 1.1.139 → 1.1.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GraphMaker/components/Chart.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/Chart.vue.js +1 -0
- package/dist/GraphMaker/components/Chart.vue.js.map +1 -1
- package/dist/GraphMaker/dataBindAes.d.ts +5 -5
- package/dist/GraphMaker/dataBindAes.d.ts.map +1 -1
- package/dist/GraphMaker/dataBindAes.js +52 -49
- package/dist/GraphMaker/dataBindAes.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js +14 -14
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js.map +1 -1
- package/dist/GraphMaker/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/index.vue.js +115 -113
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/store.js +9 -9
- package/dist/GraphMaker/types.d.ts +1 -1
- package/dist/GraphMaker/types.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +3 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts +4 -8
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +2 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +5 -5
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +7 -7
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +9 -9
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +20 -16
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +65 -69
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +20 -16
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +20 -19
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.js +4 -3
- package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +57 -54
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -5
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js +5 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +8 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +22 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.js +4 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +53 -53
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +6 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +45 -45
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +71 -70
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +117 -112
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +6 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js +36 -36
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +24 -24
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js +23 -26
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +13 -10
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +67 -73
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +44 -39
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js +18 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js +68 -64
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +23 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +23 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js +7 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/_commonjsHelpers.js +9 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/canonicalize.js +8 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/canonicalize.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/lodash.js +8 -0
- package/dist/{_virtual → node_modules/@milaboratories/pf-plots/dist/_virtual}/lodash.js.map +1 -1
- package/dist/{_virtual/lodash.js → node_modules/@milaboratories/pf-plots/dist/_virtual/lodash2.js} +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/lodash2.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/stringify.js +3 -0
- package/dist/{_virtual → node_modules/@milaboratories/pf-plots/dist/_virtual}/stringify.js.map +1 -1
- package/dist/{_virtual/stringify.js → node_modules/@milaboratories/pf-plots/dist/_virtual/stringify2.js} +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/stringify2.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +15 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +198 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +342 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +278 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +453 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js +203 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +432 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +170 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +315 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +323 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/demoStore.js +11 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/demoStore.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +36 -3420
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/{pl-error-like → pf-plots/dist/node_modules/@milaboratories/pl-error-like}/dist/index.js +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +979 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js +1599 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/canonicalize/lib/canonicalize.js +19 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/canonicalize/lib/canonicalize.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/json-stringify-safe/stringify.js +26 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/json-stringify-safe/stringify.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/lodash/lodash.js +3678 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/lodash/lodash.js.map +1 -0
- package/dist/node_modules/{zod → @milaboratories/pf-plots/dist/node_modules/zod}/lib/index.js +1141 -1141
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/zod/lib/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +247 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js +62 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +286 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -0
- package/package.json +3 -3
- package/dist/node_modules/@milaboratories/pl-error-like/dist/index.js.map +0 -1
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +0 -584
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +0 -1
- package/dist/node_modules/@platforma-sdk/model/dist/index.js +0 -1559
- package/dist/node_modules/@platforma-sdk/model/dist/index.js.map +0 -1
- package/dist/node_modules/json-stringify-safe/stringify.js +0 -20
- package/dist/node_modules/json-stringify-safe/stringify.js.map +0 -1
- package/dist/node_modules/lodash/lodash.js +0 -3678
- package/dist/node_modules/lodash/lodash.js.map +0 -1
- package/dist/node_modules/zod/lib/index.js.map +0 -1
|
@@ -1,98 +1,94 @@
|
|
|
1
|
-
import { PALETTE_MAP as
|
|
2
|
-
import { SCATTERPLOT_TEMPLATES_MAP as
|
|
3
|
-
import { getScatterplotAes as
|
|
4
|
-
import { getScatterplotLayersSettings as
|
|
5
|
-
import { getAxesDataFromForms as
|
|
1
|
+
import { PALETTE_MAP as O, DEFAULT_CATEGORICAL_PALETTE as P, UNKNOWN_COLOR as R, DEFAULT_BLACK as K } from "../../constantsAesthetic.js";
|
|
2
|
+
import { SCATTERPLOT_TEMPLATES_MAP as M, isMappedAes as U, THRESHOLDS_KEY as g, PALETTE_KEY as D, UPPER_LIMIT_KEY as y, LOWER_LIMIT_KEY as T, SYMMETRIC_RANGE_KEY as L } from "../../constantsCommon.js";
|
|
3
|
+
import { getScatterplotAes as Y, DEFAULT_LINE_WIDTH as H, DEFAULT_DOT_SIZE as V, DEFAULT_DOT_SHAPE as W } from "../../dataBindAes.js";
|
|
4
|
+
import { getScatterplotLayersSettings as j } from "./getLayersDataFromForms.js";
|
|
5
|
+
import { getAxesDataFromForms as k } from "./getAxesDataFromForms.js";
|
|
6
6
|
import "../../../node_modules/@milaboratories/pf-plots/dist/index.js";
|
|
7
7
|
import "vue";
|
|
8
|
-
function
|
|
9
|
-
var d,
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
const { columnId:
|
|
15
|
-
|
|
16
|
-
}),
|
|
17
|
-
const
|
|
8
|
+
function w(o, u, n, f, s) {
|
|
9
|
+
var x, d, m, A, E;
|
|
10
|
+
const r = (x = u.selectorStates[0]) == null ? void 0 : x.selectedSource, i = (d = n.selectorStates[0]) == null ? void 0 : d.selectedSource, c = (m = f.selectorStates[0]) == null ? void 0 : m.selectedSource, t = s.getSourceInfo(i), e = s.getSourceInfo(c);
|
|
11
|
+
if (o.grouping = [...o.grouping ?? []].map((a) => ({ ...a })), u.selectorStates.length) {
|
|
12
|
+
const a = s.getSourceInfo(r).annotations;
|
|
13
|
+
if (a != null && a[g] && (JSON.parse(a[g]) ?? []).forEach((h) => {
|
|
14
|
+
const { columnId: l, value: S } = h;
|
|
15
|
+
l && t.kind === "column" && t.type === l.valueType && t.name === l.name && (o.xAxis.significantLines || (o.xAxis.significantLines = []), o.xAxis.significantLines.push(Number(S))), l && e.kind === "column" && e.type === l.valueType && e.name === l.name && (o.yAxis.significantLines || (o.yAxis.significantLines = []), o.yAxis.significantLines.push(Number(S)));
|
|
16
|
+
}), a != null && a[D]) {
|
|
17
|
+
const N = JSON.parse(a[D]), { mapping: h = {}, name: l = "" } = N;
|
|
18
18
|
o.layers.forEach((p) => {
|
|
19
|
-
p.type === "dots" && (p.aes || (p.aes = {}), p.aes.dotFill = { type: "grouping", value:
|
|
19
|
+
p.type === "dots" && (p.aes || (p.aes = {}), p.aes.dotFill = { type: "grouping", value: r });
|
|
20
|
+
});
|
|
21
|
+
const S = [...Object.entries(h), ["null", R]], b = ((A = O[l]) == null ? void 0 : A.colors) ?? [];
|
|
22
|
+
(E = o.grouping) == null || E.forEach((p) => {
|
|
23
|
+
p.columnName.value === r && (p.inheritedAes = S.reduce((I, [F, C]) => {
|
|
24
|
+
const _ = b[Number(C)] ?? K;
|
|
25
|
+
return I[F] = {
|
|
26
|
+
fillColor: _,
|
|
27
|
+
lineColor: _,
|
|
28
|
+
dotFill: _,
|
|
29
|
+
dotShape: W,
|
|
30
|
+
dotSize: V,
|
|
31
|
+
lineWidth: H
|
|
32
|
+
}, I;
|
|
33
|
+
}, {}));
|
|
20
34
|
});
|
|
21
|
-
const S = [...Object.entries(_), ["null", P]], h = ((u = b[c]) == null ? void 0 : u.colors) ?? [];
|
|
22
|
-
o.inheritedAes[f] = S.reduce((p, [D, F]) => {
|
|
23
|
-
const I = h[Number(F)] ?? R;
|
|
24
|
-
return p[D] = {
|
|
25
|
-
fillColor: I,
|
|
26
|
-
lineColor: I,
|
|
27
|
-
dotFill: I,
|
|
28
|
-
dotShape: j,
|
|
29
|
-
dotSize: Y,
|
|
30
|
-
lineWidth: U
|
|
31
|
-
}, p;
|
|
32
|
-
}, {});
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
t.annotations && (t.annotations[
|
|
37
|
+
t.annotations && (t.annotations[y] && (o.xAxis.upperValue = Number(t.annotations[y])), t.annotations[T] && (o.xAxis.lowerValue = Number(t.annotations[T])), t.annotations[L] && (o.xAxis.symmetricRange = Number(t.annotations[L]))), e.annotations && (e.annotations[y] && (o.yAxis.upperValue = Number(e.annotations[y])), e.annotations[T] && (o.yAxis.lowerValue = Number(e.annotations[T])), e.annotations[L] && (o.yAxis.symmetricRange = Number(e.annotations[L])));
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const A = e[E];
|
|
52
|
-
if (g(A) && A.value === a) {
|
|
53
|
-
const y = ((s = b[((u = i[a]) == null ? void 0 : u.palette) ?? C]) == null ? void 0 : s.colors) ?? [];
|
|
54
|
-
A.palette = y;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
39
|
+
function B(o, u, n, f, s) {
|
|
40
|
+
(u.selectorStates.length || n != null && n.selectorStates.length) && (o.grouping = [...o.grouping ?? []].map((r) => ({ ...r })), o.grouping.forEach((r) => {
|
|
41
|
+
const i = r.columnName.value, c = Y(i, f, s);
|
|
42
|
+
c.order.length ? (r.order = c.order, r.inheritedAes = c.inheritedAes) : o.layers.forEach((t) => {
|
|
43
|
+
const e = t.aes;
|
|
44
|
+
if (!e)
|
|
45
|
+
return;
|
|
46
|
+
Object.keys(e).forEach((d) => {
|
|
47
|
+
var A, E;
|
|
48
|
+
const m = e[d];
|
|
49
|
+
if (U(m) && m.value === i) {
|
|
50
|
+
const a = ((E = O[((A = s[i]) == null ? void 0 : A.palette) ?? P]) == null ? void 0 : E.colors) ?? [];
|
|
51
|
+
m.palette = a;
|
|
52
|
+
}
|
|
57
53
|
});
|
|
58
|
-
})
|
|
59
|
-
}
|
|
54
|
+
});
|
|
55
|
+
}));
|
|
60
56
|
}
|
|
61
|
-
function
|
|
62
|
-
var
|
|
63
|
-
o.layers =
|
|
64
|
-
|
|
57
|
+
function G(o, u, n, f, s) {
|
|
58
|
+
var c, t;
|
|
59
|
+
o.layers = j(
|
|
60
|
+
M[n.template],
|
|
65
61
|
n.layersSettings,
|
|
66
|
-
|
|
62
|
+
u,
|
|
67
63
|
n.optionsState,
|
|
68
64
|
n.dataBindAes,
|
|
69
|
-
|
|
70
|
-
o == null ? void 0 : o.grouping
|
|
71
|
-
),
|
|
65
|
+
f,
|
|
66
|
+
(c = o == null ? void 0 : o.grouping) == null ? void 0 : c.map((e) => e.columnName)
|
|
67
|
+
), B(
|
|
72
68
|
o,
|
|
73
69
|
n.optionsState.components.grouping,
|
|
74
70
|
n.optionsState.components.shape,
|
|
75
|
-
|
|
71
|
+
s,
|
|
76
72
|
n.dataBindAes
|
|
77
73
|
);
|
|
78
|
-
const
|
|
79
|
-
return
|
|
80
|
-
color: (
|
|
74
|
+
const r = n.statisticsSettings, i = o.layers.find((e) => e.type === "dots");
|
|
75
|
+
return r.trend.on && i && (o.trend = {
|
|
76
|
+
color: (t = i.aes) == null ? void 0 : t.dotFill,
|
|
81
77
|
bounded: !1
|
|
82
78
|
}), Object.assign(
|
|
83
79
|
o,
|
|
84
|
-
|
|
85
|
-
),
|
|
80
|
+
k(n.axesSettings, n.chartType)
|
|
81
|
+
), w(
|
|
86
82
|
o,
|
|
87
83
|
n.optionsState.components.grouping,
|
|
88
84
|
n.optionsState.components.x,
|
|
89
85
|
n.optionsState.components.y,
|
|
90
|
-
|
|
86
|
+
f
|
|
91
87
|
), o;
|
|
92
88
|
}
|
|
93
89
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
w as applyChartInfoFromAnnotations,
|
|
91
|
+
B as applyInheritedAes,
|
|
92
|
+
G as composeScatterplotSettings
|
|
97
93
|
};
|
|
98
94
|
//# sourceMappingURL=composeScatterplotSettings.js.map
|
package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeScatterplotSettings.js","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.ts"],"sourcesContent":["import { ScatterplotSettings, ScatterplotUmapSettings } from '@milaboratories/miplots4';\nimport {\n ComponentStateFilter,\n ComponentStateSimple,\n InputGuide,\n InputState,\n PlotDataAndSettings,\n ScatterplotUIState\n} from '@milaboratories/pf-plots';\nimport {\n DEFAULT_BLACK,\n DEFAULT_CATEGORICAL_PALETTE,\n PALETTE_MAP,\n UNKNOWN_COLOR\n} from '../../constantsAesthetic';\nimport {\n isMappedAes,\n LOWER_LIMIT_KEY, MappingLink,\n PALETTE_KEY,\n SCATTERPLOT_TEMPLATES_MAP,\n ScatterplotStatisticsState, SYMMETRIC_RANGE_KEY,\n THRESHOLDS_KEY, UPPER_LIMIT_KEY\n} from '../../constantsCommon';\nimport {\n AestheticMappingState,\n DEFAULT_DOT_SHAPE,\n DEFAULT_DOT_SIZE,\n DEFAULT_LINE_WIDTH,\n getScatterplotAes\n} from '../../dataBindAes';\nimport {\n ReactiveState,\n ScatterplotLayersTemplate,\n UniqueValuesBySourceMap\n} from '../../types';\nimport { getAxesDataFromForms, getScatterplotLayersSettings } from '../index';\n\nexport function applyChartInfoFromAnnotations (\n settings: ScatterplotSettings | ScatterplotUmapSettings,\n grouping: ComponentStateSimple | ComponentStateFilter,\n x: ComponentStateSimple | ComponentStateFilter,\n y: ComponentStateSimple | ComponentStateFilter,\n inputGuide: InputGuide<InputState>\n) {\n const groupingSource = grouping.selectorStates[0]?.selectedSource;\n const xSource = x.selectorStates[0]?.selectedSource;\n const ySource = y.selectorStates[0]?.selectedSource;\n const xInfo = inputGuide.getSourceInfo(xSource);\n const yInfo = inputGuide.getSourceInfo(ySource);\n\n if (grouping.selectorStates.length) {\n const annotations = inputGuide.getSourceInfo(groupingSource).annotations;\n if (annotations?.[THRESHOLDS_KEY]) {\n const thresholdsData = JSON.parse(annotations[THRESHOLDS_KEY]) ?? [];\n\n thresholdsData.forEach((thresholdData: { columnId: Record<string, string>, value: number }) => {\n const { columnId, value } = thresholdData;\n if (columnId && (xInfo.kind === 'column' && xInfo.type === columnId.valueType && xInfo.name === columnId.name)) {\n if (!settings.xAxis!.significantLines) {\n settings.xAxis!.significantLines = [];\n }\n settings.xAxis!.significantLines.push(Number(value));\n }\n\n if (columnId && (yInfo.kind === 'column' && yInfo.type === columnId.valueType && yInfo.name === columnId.name)) {\n if (!settings.yAxis!.significantLines) {\n settings.yAxis!.significantLines = [];\n }\n settings.yAxis!.significantLines.push(Number(value));\n }\n });\n }\n\n if (annotations?.[PALETTE_KEY]) {\n const paletteData = JSON.parse(annotations[PALETTE_KEY]);\n const { mapping = {}, name = '' } = paletteData;\n settings.layers.forEach(layer => {\n if (layer.type === 'dots') {\n if (!layer.aes) {\n layer.aes = {};\n }\n layer.aes.dotFill = { type: 'grouping', value: groupingSource };\n }\n });\n const paletteEntries = [...Object.entries(mapping), ['null', UNKNOWN_COLOR]];\n const paletteColors = PALETTE_MAP[name as keyof typeof PALETTE_MAP]?.colors ?? [];\n settings.inheritedAes![groupingSource] = paletteEntries.reduce((res: Record<string, any>, [key, value]) => {\n const color = paletteColors[Number(value)] ?? DEFAULT_BLACK;\n res[key] = {\n fillColor: color,\n lineColor: color,\n dotFill: color,\n dotShape: DEFAULT_DOT_SHAPE,\n dotSize: DEFAULT_DOT_SIZE,\n lineWidth: DEFAULT_LINE_WIDTH\n };\n return res;\n }, {});\n }\n }\n if (xInfo.annotations) {\n if (xInfo.annotations[UPPER_LIMIT_KEY]) {\n settings.xAxis!.upperValue = Number(xInfo.annotations[UPPER_LIMIT_KEY]);\n }\n if (xInfo.annotations[LOWER_LIMIT_KEY]) {\n settings.xAxis!.lowerValue = Number(xInfo.annotations[LOWER_LIMIT_KEY]);\n }\n if (xInfo.annotations[SYMMETRIC_RANGE_KEY]) {\n settings.xAxis!.symmetricRange = Number(xInfo.annotations[SYMMETRIC_RANGE_KEY]);\n }\n }\n\n if (yInfo.annotations) {\n if (yInfo.annotations[UPPER_LIMIT_KEY]) {\n settings.yAxis!.upperValue = Number(yInfo.annotations[UPPER_LIMIT_KEY]);\n }\n if (yInfo.annotations[LOWER_LIMIT_KEY]) {\n settings.yAxis!.lowerValue = Number(yInfo.annotations[LOWER_LIMIT_KEY]);\n }\n if (yInfo.annotations[SYMMETRIC_RANGE_KEY]) {\n settings.yAxis!.symmetricRange = Number(yInfo.annotations[SYMMETRIC_RANGE_KEY]);\n }\n }\n}\n\nexport function applyInheritedAes(\n settings: ScatterplotSettings | ScatterplotUmapSettings,\n grouping: ComponentStateSimple | ComponentStateFilter,\n shape: ComponentStateSimple | ComponentStateFilter | undefined,\n uniqueValuesData: UniqueValuesBySourceMap,\n dataBindAes: AestheticMappingState\n) {\n if (grouping.selectorStates.length || shape?.selectorStates.length) {\n const states = [...grouping.selectorStates, ...(shape?.selectorStates ?? [])];\n const inheritedAes: Record<string, Record<string, unknown>> = {};\n states.forEach(({ selectedSource }) => {\n inheritedAes[selectedSource] = getScatterplotAes(\n selectedSource,\n uniqueValuesData,\n dataBindAes\n );\n // if mapping exists but doesn't have saved order and value-color pairs - add just colors list to chart settings, chart will use it\n if (!Object.keys(inheritedAes[selectedSource]).length) {\n settings.layers.forEach(layer=> {\n const layerAes = layer.aes;\n if (!layerAes) {\n return;\n }\n const aesKeys = Object.keys(layerAes);\n aesKeys.forEach((aesKey) => {\n const value = layerAes[aesKey as keyof typeof layerAes] as unknown;\n if (isMappedAes(value) && value.value === selectedSource) {\n const colors = PALETTE_MAP[dataBindAes[selectedSource]?.palette ?? DEFAULT_CATEGORICAL_PALETTE]?.colors ?? [];\n (value as MappingLink & {palette: string[]}).palette = colors;\n }\n })\n })\n }\n });\n\n Object.assign(settings, { inheritedAes });\n }\n}\nexport function composeScatterplotSettings(\n settings: ScatterplotSettings,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n reactiveState: ReactiveState,\n inputGuide: InputGuide<InputState>,\n uniqueValuesData: UniqueValuesBySourceMap\n) {\n settings.layers = getScatterplotLayersSettings(\n SCATTERPLOT_TEMPLATES_MAP[reactiveState.template as ScatterplotLayersTemplate],\n reactiveState.layersSettings,\n dataByColumns,\n reactiveState.optionsState as ScatterplotUIState,\n reactiveState.dataBindAes,\n inputGuide,\n settings?.grouping\n );\n\n applyInheritedAes(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.shape,\n uniqueValuesData,\n reactiveState.dataBindAes\n );\n\n const statisticsSettings = reactiveState.statisticsSettings as ScatterplotStatisticsState;\n const dotsLayer = settings.layers.find(layer => layer.type === 'dots');\n if (statisticsSettings.trend.on && dotsLayer) {\n settings.trend = {\n color: dotsLayer.aes?.dotFill,\n bounded: false\n };\n }\n\n Object.assign(\n settings,\n getAxesDataFromForms(reactiveState.axesSettings, reactiveState.chartType)\n );\n\n applyChartInfoFromAnnotations(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.x,\n reactiveState.optionsState.components.y,\n inputGuide\n );\n\n return settings;\n}"],"names":["applyChartInfoFromAnnotations","settings","grouping","x","y","inputGuide","groupingSource","_a","xSource","_b","ySource","_c","xInfo","yInfo","annotations","THRESHOLDS_KEY","thresholdData","columnId","value","PALETTE_KEY","paletteData","mapping","name","layer","paletteEntries","UNKNOWN_COLOR","paletteColors","_d","PALETTE_MAP","res","key","color","DEFAULT_BLACK","DEFAULT_DOT_SHAPE","DEFAULT_DOT_SIZE","DEFAULT_LINE_WIDTH","UPPER_LIMIT_KEY","LOWER_LIMIT_KEY","SYMMETRIC_RANGE_KEY","applyInheritedAes","shape","uniqueValuesData","dataBindAes","states","inheritedAes","selectedSource","getScatterplotAes","layerAes","aesKey","isMappedAes","colors","DEFAULT_CATEGORICAL_PALETTE","composeScatterplotSettings","dataByColumns","reactiveState","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","statisticsSettings","dotsLayer","getAxesDataFromForms"],"mappings":";;;;;;;AAqCO,SAASA,EACdC,GACAC,GACAC,GACAC,GACAC,GACA;;AACA,QAAMC,KAAiBC,IAAAL,EAAS,eAAe,CAAC,MAAzB,gBAAAK,EAA4B,gBAC7CC,KAAUC,IAAAN,EAAE,eAAe,CAAC,MAAlB,gBAAAM,EAAqB,gBAC/BC,KAAUC,IAAAP,EAAE,eAAe,CAAC,MAAlB,gBAAAO,EAAqB,gBAC/BC,IAAQP,EAAW,cAAcG,CAAO,GACxCK,IAAQR,EAAW,cAAcK,CAAO;AAE9C,MAAIR,EAAS,eAAe,QAAQ;AACl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AA,GAG1EtD;AAAA,IACEC;AAAA,IACAqD,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCjD;AAAA,EAAA,GAGKJ;AACT;"}
|
|
1
|
+
{"version":3,"file":"composeScatterplotSettings.js","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.ts"],"sourcesContent":["import { ScatterplotSettings, ScatterplotUmapSettings } from '@milaboratories/miplots4';\nimport {\n ComponentStateFilter,\n ComponentStateSimple,\n InputGuide,\n InputState,\n PlotDataAndSettings,\n ScatterplotUIState\n} from '@milaboratories/pf-plots';\nimport {\n DEFAULT_BLACK,\n DEFAULT_CATEGORICAL_PALETTE,\n PALETTE_MAP,\n UNKNOWN_COLOR\n} from '../../constantsAesthetic';\nimport {\n isMappedAes,\n LOWER_LIMIT_KEY, MappingLink,\n PALETTE_KEY,\n SCATTERPLOT_TEMPLATES_MAP,\n ScatterplotStatisticsState, SYMMETRIC_RANGE_KEY,\n THRESHOLDS_KEY, UPPER_LIMIT_KEY\n} from '../../constantsCommon';\nimport {\n AestheticMappingState,\n DEFAULT_DOT_SHAPE,\n DEFAULT_DOT_SIZE,\n DEFAULT_LINE_WIDTH,\n getScatterplotAes\n} from '../../dataBindAes';\nimport {\n ReactiveState,\n ScatterplotLayersTemplate,\n UniqueValuesBySourceMap\n} from '../../types';\nimport { getAxesDataFromForms, getScatterplotLayersSettings } from '../index';\n\nexport function applyChartInfoFromAnnotations (\n settings: ScatterplotSettings | ScatterplotUmapSettings,\n grouping: ComponentStateSimple | ComponentStateFilter,\n x: ComponentStateSimple | ComponentStateFilter,\n y: ComponentStateSimple | ComponentStateFilter,\n inputGuide: InputGuide<InputState>\n) {\n const groupingSource = grouping.selectorStates[0]?.selectedSource;\n const xSource = x.selectorStates[0]?.selectedSource;\n const ySource = y.selectorStates[0]?.selectedSource;\n const xInfo = inputGuide.getSourceInfo(xSource);\n const yInfo = inputGuide.getSourceInfo(ySource);\n\n settings.grouping = [...(settings.grouping ?? [])].map(v => ({...v}));\n\n if (grouping.selectorStates.length) {\n const annotations = inputGuide.getSourceInfo(groupingSource).annotations;\n if (annotations?.[THRESHOLDS_KEY]) {\n const thresholdsData = JSON.parse(annotations[THRESHOLDS_KEY]) ?? [];\n\n thresholdsData.forEach((thresholdData: { columnId: Record<string, string>, value: number }) => {\n const { columnId, value } = thresholdData;\n if (columnId && (xInfo.kind === 'column' && xInfo.type === columnId.valueType && xInfo.name === columnId.name)) {\n if (!settings.xAxis!.significantLines) {\n settings.xAxis!.significantLines = [];\n }\n settings.xAxis!.significantLines.push(Number(value));\n }\n\n if (columnId && (yInfo.kind === 'column' && yInfo.type === columnId.valueType && yInfo.name === columnId.name)) {\n if (!settings.yAxis!.significantLines) {\n settings.yAxis!.significantLines = [];\n }\n settings.yAxis!.significantLines.push(Number(value));\n }\n });\n }\n\n if (annotations?.[PALETTE_KEY]) {\n const paletteData = JSON.parse(annotations[PALETTE_KEY]);\n const { mapping = {}, name = '' } = paletteData;\n settings.layers.forEach(layer => {\n if (layer.type === 'dots') {\n if (!layer.aes) {\n layer.aes = {};\n }\n layer.aes.dotFill = { type: 'grouping', value: groupingSource };\n }\n });\n const paletteEntries = [...Object.entries(mapping), ['null', UNKNOWN_COLOR]];\n const paletteColors = PALETTE_MAP[name as keyof typeof PALETTE_MAP]?.colors ?? [];\n\n settings.grouping?.forEach((groupingElement) => {\n if (groupingElement.columnName.value === groupingSource) {\n groupingElement.inheritedAes = paletteEntries.reduce((res: Record<string, any>, [key, value]) => {\n const color = paletteColors[Number(value)] ?? DEFAULT_BLACK;\n res[key] = {\n fillColor: color,\n lineColor: color,\n dotFill: color,\n dotShape: DEFAULT_DOT_SHAPE,\n dotSize: DEFAULT_DOT_SIZE,\n lineWidth: DEFAULT_LINE_WIDTH\n };\n return res;\n }, {})\n }\n })\n }\n }\n if (xInfo.annotations) {\n if (xInfo.annotations[UPPER_LIMIT_KEY]) {\n settings.xAxis!.upperValue = Number(xInfo.annotations[UPPER_LIMIT_KEY]);\n }\n if (xInfo.annotations[LOWER_LIMIT_KEY]) {\n settings.xAxis!.lowerValue = Number(xInfo.annotations[LOWER_LIMIT_KEY]);\n }\n if (xInfo.annotations[SYMMETRIC_RANGE_KEY]) {\n settings.xAxis!.symmetricRange = Number(xInfo.annotations[SYMMETRIC_RANGE_KEY]);\n }\n }\n\n if (yInfo.annotations) {\n if (yInfo.annotations[UPPER_LIMIT_KEY]) {\n settings.yAxis!.upperValue = Number(yInfo.annotations[UPPER_LIMIT_KEY]);\n }\n if (yInfo.annotations[LOWER_LIMIT_KEY]) {\n settings.yAxis!.lowerValue = Number(yInfo.annotations[LOWER_LIMIT_KEY]);\n }\n if (yInfo.annotations[SYMMETRIC_RANGE_KEY]) {\n settings.yAxis!.symmetricRange = Number(yInfo.annotations[SYMMETRIC_RANGE_KEY]);\n }\n }\n}\n\nexport function applyInheritedAes(\n settings: ScatterplotSettings | ScatterplotUmapSettings,\n grouping: ComponentStateSimple | ComponentStateFilter,\n shape: ComponentStateSimple | ComponentStateFilter | undefined,\n uniqueValuesData: UniqueValuesBySourceMap,\n dataBindAes: AestheticMappingState\n) {\n if (grouping.selectorStates.length || shape?.selectorStates.length) {\n settings.grouping = [...(settings.grouping ?? [])].map(v => ({...v}));\n settings.grouping.forEach((el) => {\n const selectedSource = el.columnName.value;\n const savedData = getScatterplotAes(selectedSource, uniqueValuesData, dataBindAes); // get saved or default color or shape mapping\n // if mapping exists but doesn't have saved order and value-color pairs - add just colors list to chart settings, chart will use it\n if (!savedData.order.length) {\n settings.layers.forEach(layer=> {\n const layerAes = layer.aes;\n if (!layerAes) {\n return;\n }\n const aesKeys = Object.keys(layerAes);\n aesKeys.forEach((aesKey) => {\n const value = layerAes[aesKey as keyof typeof layerAes] as unknown;\n if (isMappedAes(value) && value.value === selectedSource) {\n const colors = PALETTE_MAP[dataBindAes[selectedSource]?.palette ?? DEFAULT_CATEGORICAL_PALETTE]?.colors ?? [];\n (value as MappingLink & {palette: string[]}).palette = colors;\n }\n })\n })\n } else {\n el.order = savedData.order;\n el.inheritedAes = savedData.inheritedAes;\n }\n });\n }\n}\nexport function composeScatterplotSettings(\n settings: ScatterplotSettings,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n reactiveState: ReactiveState,\n inputGuide: InputGuide<InputState>,\n uniqueValuesData: UniqueValuesBySourceMap\n) {\n settings.layers = getScatterplotLayersSettings(\n SCATTERPLOT_TEMPLATES_MAP[reactiveState.template as ScatterplotLayersTemplate],\n reactiveState.layersSettings,\n dataByColumns,\n reactiveState.optionsState as ScatterplotUIState,\n reactiveState.dataBindAes,\n inputGuide,\n settings?.grouping?.map(v => v.columnName)\n );\n\n applyInheritedAes(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.shape,\n uniqueValuesData,\n reactiveState.dataBindAes\n );\n\n const statisticsSettings = reactiveState.statisticsSettings as ScatterplotStatisticsState;\n const dotsLayer = settings.layers.find(layer => layer.type === 'dots');\n if (statisticsSettings.trend.on && dotsLayer) {\n settings.trend = {\n color: dotsLayer.aes?.dotFill,\n bounded: false\n };\n }\n\n Object.assign(\n settings,\n getAxesDataFromForms(reactiveState.axesSettings, reactiveState.chartType)\n );\n\n applyChartInfoFromAnnotations(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.x,\n reactiveState.optionsState.components.y,\n inputGuide\n );\n\n return settings;\n}"],"names":["applyChartInfoFromAnnotations","settings","grouping","x","y","inputGuide","groupingSource","_a","xSource","_b","ySource","_c","xInfo","yInfo","v","annotations","THRESHOLDS_KEY","thresholdData","columnId","value","PALETTE_KEY","paletteData","mapping","name","layer","paletteEntries","UNKNOWN_COLOR","paletteColors","_d","PALETTE_MAP","_e","groupingElement","res","key","color","DEFAULT_BLACK","DEFAULT_DOT_SHAPE","DEFAULT_DOT_SIZE","DEFAULT_LINE_WIDTH","UPPER_LIMIT_KEY","LOWER_LIMIT_KEY","SYMMETRIC_RANGE_KEY","applyInheritedAes","shape","uniqueValuesData","dataBindAes","el","selectedSource","savedData","getScatterplotAes","layerAes","aesKey","isMappedAes","colors","DEFAULT_CATEGORICAL_PALETTE","composeScatterplotSettings","dataByColumns","reactiveState","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","statisticsSettings","dotsLayer","getAxesDataFromForms"],"mappings":";;;;;;;AAqCO,SAASA,EACdC,GACAC,GACAC,GACAC,GACAC,GACA;;AACA,QAAMC,KAAiBC,IAAAL,EAAS,eAAe,CAAC,MAAzB,gBAAAK,EAA4B,gBAC7CC,KAAUC,IAAAN,EAAE,eAAe,CAAC,MAAlB,gBAAAM,EAAqB,gBAC/BC,KAAUC,IAAAP,EAAE,eAAe,CAAC,MAAlB,gBAAAO,EAAqB,gBAC/BC,IAAQP,EAAW,cAAcG,CAAO,GACxCK,IAAQR,EAAW,cAAcK,CAAO;AAI9C,MAFAT,EAAS,WAAW,CAAC,GAAIA,EAAS,YAAY,CAAA,CAAG,EAAE,IAAI,CAAAa,OAAM,EAAC,GAAGA,IAAG,GAEhEZ,EAAS,eAAe,QAAQ;AAClC,UAAMa,IAAcV,EAAW,cAAcC,CAAc,EAAE;AAsB7D,QArBIS,KAAA,QAAAA,EAAcC,OACO,KAAK,MAAMD,EAAYC,CAAc,CAAC,KAAK,CAAA,GAEnD,QAAQ,CAACC,MAAuE;AAC7F,YAAM,EAAE,UAAAC,GAAU,OAAAC,EAAA,IAAUF;AAC5B,MAAIC,KAAaN,EAAM,SAAS,YAAYA,EAAM,SAASM,EAAS,aAAaN,EAAM,SAASM,EAAS,SAClGjB,EAAS,MAAO,qBACnBA,EAAS,MAAO,mBAAmB,CAAA,IAErCA,EAAS,MAAO,iBAAiB,KAAK,OAAOkB,CAAK,CAAC,IAGjDD,KAAaL,EAAM,SAAS,YAAYA,EAAM,SAASK,EAAS,aAAaL,EAAM,SAASK,EAAS,SAClGjB,EAAS,MAAO,qBACnBA,EAAS,MAAO,mB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QACzD;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EAKL,CAAC;AAEL;AACO,SAASE,EACdtD,GACAuD,GACAC,GACApD,GACAuC,GACA;;AACA,EAAA3C,EAAS,SAASyD;AAAA,IAChBC,EAA0BF,EAAc,QAAqC;AAAA,IAC7EA,EAAc;AAAA,IACdD;AAAA,IACAC,EAAc;AAAA,IACdA,EAAc;AAAA,IACdpD;AAAA,KACAE,IAAAN,KAAA,gBAAAA,EAAU,aAAV,gBAAAM,EAAoB,IAAI,CAAAO,MAAKA,EAAE;AAAA,EAAU,GAG3C4B;AAAA,IACEzC;AAAA,IACAwD,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCb;AAAA,IACAa,EAAc;AAAA,EAAA;AAGhB,QAAMG,IAAqBH,EAAc,oBACnCI,IAAY5D,EAAS,OAAO,KAAK,CAAAuB,MAASA,EAAM,SAAS,MAAM;AACrE,SAAIoC,EAAmB,MAAM,MAAMC,MACjC5D,EAAS,QAAQ;AAAA,IACf,QAAOQ,IAAAoD,EAAU,QAAV,gBAAApD,EAAe;AAAA,IACtB,SAAS;AAAA,EAAA,IAIb,OAAO;AAAA,IACLR;AAAA,IACA6D,EAAqBL,EAAc,cAAcA,EAAc,SAAS;AAAA,EAAA,GAG1EzD;AAAA,IACEC;AAAA,IACAwD,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCpD;AAAA,EAAA,GAGKJ;AACT;"}
|
package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare function composeScatterplotUmapSettings(settings: ScatterplotUmap
|
|
|
6
6
|
title: {
|
|
7
7
|
name: string;
|
|
8
8
|
show?: boolean | undefined;
|
|
9
|
-
position?: "
|
|
9
|
+
position?: "left" | "center" | "right" | undefined;
|
|
10
10
|
};
|
|
11
11
|
x: {
|
|
12
12
|
type: "column";
|
|
@@ -96,15 +96,28 @@ export declare function composeScatterplotUmapSettings(settings: ScatterplotUmap
|
|
|
96
96
|
valueLabels?: string | undefined;
|
|
97
97
|
} | undefined;
|
|
98
98
|
grouping?: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
columnName: {
|
|
100
|
+
type: "column";
|
|
101
|
+
value: string;
|
|
102
|
+
format?: string | undefined;
|
|
103
|
+
label?: string | undefined;
|
|
104
|
+
valueLabels?: string | undefined;
|
|
105
|
+
};
|
|
106
|
+
order?: (string | number | null)[] | undefined;
|
|
107
|
+
inheritedAes?: Record<string, {
|
|
108
|
+
dotFill?: string | undefined;
|
|
109
|
+
dotShape?: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "20" | "21" | "22" | "23" | "24" | "25" | undefined;
|
|
110
|
+
dotSize?: number | undefined;
|
|
111
|
+
lineWidth?: number | undefined;
|
|
112
|
+
lineShape?: "solid" | "dashed" | "dotted" | "dotdash" | "longdash" | "twodash" | undefined;
|
|
113
|
+
lineColor?: string | undefined;
|
|
114
|
+
fillColor?: string | undefined;
|
|
115
|
+
}> | undefined;
|
|
116
|
+
allowNullGroup?: boolean | undefined;
|
|
104
117
|
}[] | undefined;
|
|
105
118
|
legend?: {
|
|
106
119
|
show?: boolean | undefined;
|
|
107
|
-
position?: "right" | "
|
|
120
|
+
position?: "right" | "inside" | "top" | "bottom" | undefined;
|
|
108
121
|
} | undefined;
|
|
109
122
|
tooltips?: {
|
|
110
123
|
show?: boolean | undefined;
|
|
@@ -173,14 +186,5 @@ export declare function composeScatterplotUmapSettings(settings: ScatterplotUmap
|
|
|
173
186
|
label?: string | undefined;
|
|
174
187
|
valueLabels?: string | undefined;
|
|
175
188
|
} | undefined;
|
|
176
|
-
inheritedAes?: Record<string, Record<string, {
|
|
177
|
-
dotFill?: string | undefined;
|
|
178
|
-
dotShape?: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" | "18" | "20" | "21" | "22" | "23" | "24" | "25" | undefined;
|
|
179
|
-
dotSize?: number | undefined;
|
|
180
|
-
lineWidth?: number | undefined;
|
|
181
|
-
lineShape?: "solid" | "dashed" | "dotted" | "dotdash" | "longdash" | "twodash" | undefined;
|
|
182
|
-
lineColor?: string | undefined;
|
|
183
|
-
fillColor?: string | undefined;
|
|
184
|
-
}>> | undefined;
|
|
185
189
|
};
|
|
186
190
|
//# sourceMappingURL=composeScatterplotUmapSettings.d.ts.map
|
package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeScatterplotUmapSettings.d.ts","sourceRoot":"","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAsB,MAAM,0BAA0B,CAAC;AAG3G,OAAO,EACL,aAAa,EAEb,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAOrB,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,uBAAuB,EACjC,aAAa,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,EACvD,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,gBAAgB,EAAE,uBAAuB;;;;
|
|
1
|
+
{"version":3,"file":"composeScatterplotUmapSettings.d.ts","sourceRoot":"","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAA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iBAAuC,CAAC;uBAA6C,CAAC;;;;YAA4F,CAAC;;;;;cAAsK,CAAC;aAAmC,CAAC;mBAAyC,CAAC;;;aAAoE,CAAC;;;kBAAsF,CAAC;iBAAuC,CAAC;uBAA6C,CAAC;;aAA0D,CAAC;gBAAgD,CAAC;8BAAqD,CAAC;iBAAwC,CAAC;sBAA6C,CAAC;wBAAoE,CAAC;6BAAqD,CAAC;sBAAwG,CAAC;kBAAwC,CAAC;kBAAwC,CAAC;oBAA0C,CAAC;;;aAAqE,CAAC;;;kBAAsF,CAAC;iBAAuC,CAAC;uBAA6C,CAAC;;aAA0D,CAAC;gBAAgD,CAAC;8BAAqD,CAAC;iBAAwC,CAAC;sBAA6C,CAAC;wBAAoE,CAAC;6BAAqD,CAAC;sBAAwG,CAAC;kBAAwC,CAAC;kBAAwC,CAAC;oBAA0C,CAAC;;;;;cAAyH,CAAC;aAAmC,CAAC;mBAAyC,CAAC;;EAAp0qE"}
|
package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { SCATTERPLOT_TEMPLATES_MAP as
|
|
2
|
-
import { DEFAULT_DOT_SIZE_CANVAS as
|
|
3
|
-
import { getScatterplotLayersSettings as
|
|
4
|
-
import { getAxesDataFromForms as
|
|
1
|
+
import { SCATTERPLOT_TEMPLATES_MAP as _ } from "../../constantsCommon.js";
|
|
2
|
+
import { DEFAULT_DOT_SIZE_CANVAS as l } from "../../dataBindAes.js";
|
|
3
|
+
import { getScatterplotLayersSettings as E } from "./getLayersDataFromForms.js";
|
|
4
|
+
import { getAxesDataFromForms as s } from "./getAxesDataFromForms.js";
|
|
5
5
|
import "../../../node_modules/@milaboratories/pf-plots/dist/index.js";
|
|
6
6
|
import "vue";
|
|
7
7
|
import "../../constantsAesthetic.js";
|
|
8
|
-
import { applyInheritedAes as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { applyInheritedAes as h, applyChartInfoFromAnnotations as L } from "./composeScatterplotSettings.js";
|
|
9
|
+
const a = 750, f = 450;
|
|
10
|
+
function U(p, r, o, m, T) {
|
|
11
|
+
var n;
|
|
12
|
+
return p.layers = E(
|
|
13
|
+
_[o.template],
|
|
13
14
|
o.layersSettings,
|
|
14
|
-
|
|
15
|
+
r,
|
|
15
16
|
o.optionsState,
|
|
16
17
|
o.dataBindAes,
|
|
17
18
|
m,
|
|
18
|
-
p == null ? void 0 : p.grouping,
|
|
19
|
-
|
|
20
|
-
),
|
|
19
|
+
(n = p == null ? void 0 : p.grouping) == null ? void 0 : n.map((A) => A.columnName),
|
|
20
|
+
l
|
|
21
|
+
), h(
|
|
21
22
|
p,
|
|
22
23
|
o.optionsState.components.grouping,
|
|
23
24
|
void 0,
|
|
24
|
-
|
|
25
|
+
T,
|
|
25
26
|
o.dataBindAes
|
|
26
27
|
), Object.assign(
|
|
27
28
|
p,
|
|
28
|
-
|
|
29
|
-
),
|
|
29
|
+
s(o.axesSettings, o.chartType)
|
|
30
|
+
), L(
|
|
30
31
|
p,
|
|
31
32
|
o.optionsState.components.grouping,
|
|
32
33
|
o.optionsState.components.x,
|
|
33
34
|
o.optionsState.components.y,
|
|
34
35
|
m
|
|
35
36
|
), p.size = {
|
|
36
|
-
width:
|
|
37
|
-
height:
|
|
37
|
+
width: a * o.chartScale / 100,
|
|
38
|
+
height: f * o.chartScale / 100
|
|
38
39
|
}, p;
|
|
39
40
|
}
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
U as composeScatterplotUmapSettings
|
|
42
43
|
};
|
|
43
44
|
//# sourceMappingURL=composeScatterplotUmapSettings.js.map
|
package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeScatterplotUmapSettings.js","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.ts"],"sourcesContent":["import { ScatterplotUmapSettings } from '@milaboratories/miplots4';\nimport { InputGuide, InputState, PlotDataAndSettings, ScatterplotUIState } from '@milaboratories/pf-plots';\nimport { SCATTERPLOT_TEMPLATES_MAP } from '../../constantsCommon';\nimport { DEFAULT_DOT_SIZE_CANVAS } from '../../dataBindAes';\nimport {\n ReactiveState,\n ScatterplotLayersTemplate,\n UniqueValuesBySourceMap\n} from '../../types';\nimport { getAxesDataFromForms, getScatterplotLayersSettings } from '../index';\nimport { applyChartInfoFromAnnotations, applyInheritedAes } from './composeScatterplotSettings';\n\nconst DEFAULT_WIDTH_SCATTERPLOT_UMAP = 750;\nconst DEFAULT_HEIGHT_SCATTERPLOT_UMAP = 450;\n\nexport function composeScatterplotUmapSettings(\n settings: ScatterplotUmapSettings,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n reactiveState: ReactiveState,\n inputGuide: InputGuide<InputState>,\n uniqueValuesData: UniqueValuesBySourceMap\n) {\n settings.layers = getScatterplotLayersSettings(\n SCATTERPLOT_TEMPLATES_MAP[reactiveState.template as ScatterplotLayersTemplate],\n reactiveState.layersSettings,\n dataByColumns,\n reactiveState.optionsState as ScatterplotUIState,\n reactiveState.dataBindAes,\n inputGuide,\n settings?.grouping,\n DEFAULT_DOT_SIZE_CANVAS\n ) as ScatterplotUmapSettings['layers'];\n\n applyInheritedAes(\n settings,\n reactiveState.optionsState.components.grouping,\n undefined,\n uniqueValuesData,\n reactiveState.dataBindAes\n );\n\n Object.assign(\n settings,\n getAxesDataFromForms(reactiveState.axesSettings, reactiveState.chartType)\n );\n\n applyChartInfoFromAnnotations(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.x,\n reactiveState.optionsState.components.y,\n inputGuide\n );\n\n settings.size = {\n width: DEFAULT_WIDTH_SCATTERPLOT_UMAP * reactiveState.chartScale / 100,\n height: DEFAULT_HEIGHT_SCATTERPLOT_UMAP * reactiveState.chartScale / 100\n }\n\n return settings;\n}"],"names":["DEFAULT_WIDTH_SCATTERPLOT_UMAP","DEFAULT_HEIGHT_SCATTERPLOT_UMAP","composeScatterplotUmapSettings","settings","dataByColumns","reactiveState","inputGuide","uniqueValuesData","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","DEFAULT_DOT_SIZE_CANVAS","applyInheritedAes","getAxesDataFromForms","applyChartInfoFromAnnotations"],"mappings":";;;;;;;;AAYA,MAAMA,IAAiC,KACjCC,IAAkC;AAEjC,SAASC,EACdC,GACAC,GACAC,GACAC,GACAC,GACA
|
|
1
|
+
{"version":3,"file":"composeScatterplotUmapSettings.js","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.ts"],"sourcesContent":["import { ScatterplotUmapSettings } from '@milaboratories/miplots4';\nimport { InputGuide, InputState, PlotDataAndSettings, ScatterplotUIState } from '@milaboratories/pf-plots';\nimport { SCATTERPLOT_TEMPLATES_MAP } from '../../constantsCommon';\nimport { DEFAULT_DOT_SIZE_CANVAS } from '../../dataBindAes';\nimport {\n ReactiveState,\n ScatterplotLayersTemplate,\n UniqueValuesBySourceMap\n} from '../../types';\nimport { getAxesDataFromForms, getScatterplotLayersSettings } from '../index';\nimport { applyChartInfoFromAnnotations, applyInheritedAes } from './composeScatterplotSettings';\n\nconst DEFAULT_WIDTH_SCATTERPLOT_UMAP = 750;\nconst DEFAULT_HEIGHT_SCATTERPLOT_UMAP = 450;\n\nexport function composeScatterplotUmapSettings(\n settings: ScatterplotUmapSettings,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n reactiveState: ReactiveState,\n inputGuide: InputGuide<InputState>,\n uniqueValuesData: UniqueValuesBySourceMap\n) {\n settings.layers = getScatterplotLayersSettings(\n SCATTERPLOT_TEMPLATES_MAP[reactiveState.template as ScatterplotLayersTemplate],\n reactiveState.layersSettings,\n dataByColumns,\n reactiveState.optionsState as ScatterplotUIState,\n reactiveState.dataBindAes,\n inputGuide,\n settings?.grouping?.map(v => v.columnName),\n DEFAULT_DOT_SIZE_CANVAS\n ) as ScatterplotUmapSettings['layers'];\n\n applyInheritedAes(\n settings,\n reactiveState.optionsState.components.grouping,\n undefined,\n uniqueValuesData,\n reactiveState.dataBindAes\n );\n\n Object.assign(\n settings,\n getAxesDataFromForms(reactiveState.axesSettings, reactiveState.chartType)\n );\n\n applyChartInfoFromAnnotations(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.x,\n reactiveState.optionsState.components.y,\n inputGuide\n );\n\n settings.size = {\n width: DEFAULT_WIDTH_SCATTERPLOT_UMAP * reactiveState.chartScale / 100,\n height: DEFAULT_HEIGHT_SCATTERPLOT_UMAP * reactiveState.chartScale / 100\n }\n\n return settings;\n}"],"names":["DEFAULT_WIDTH_SCATTERPLOT_UMAP","DEFAULT_HEIGHT_SCATTERPLOT_UMAP","composeScatterplotUmapSettings","settings","dataByColumns","reactiveState","inputGuide","uniqueValuesData","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","_a","v","DEFAULT_DOT_SIZE_CANVAS","applyInheritedAes","getAxesDataFromForms","applyChartInfoFromAnnotations"],"mappings":";;;;;;;;AAYA,MAAMA,IAAiC,KACjCC,IAAkC;AAEjC,SAASC,EACdC,GACAC,GACAC,GACAC,GACAC,GACA;;AACA,SAAAJ,EAAS,SAASK;AAAA,IAChBC,EAA0BJ,EAAc,QAAqC;AAAA,IAC7EA,EAAc;AAAA,IACdD;AAAA,IACAC,EAAc;AAAA,IACdA,EAAc;AAAA,IACdC;AAAA,KACAI,IAAAP,KAAA,gBAAAA,EAAU,aAAV,gBAAAO,EAAoB,IAAI,CAAAC,MAAKA,EAAE;AAAA,IAC/BC;AAAA,EAAA,GAGFC;AAAA,IACEV;AAAA,IACAE,EAAc,aAAa,WAAW;AAAA,IACtC;AAAA,IACAE;AAAA,IACAF,EAAc;AAAA,EAAA,GAGhB,OAAO;AAAA,IACLF;AAAA,IACAW,EAAqBT,EAAc,cAAcA,EAAc,SAAS;AAAA,EAAA,GAG1EU;AAAA,IACEZ;AAAA,IACAE,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCC;AAAA,EAAA,GAGFH,EAAS,OAAO;AAAA,IACd,OAAOH,IAAiCK,EAAc,aAAa;AAAA,IACnE,QAAQJ,IAAkCI,EAAc,aAAa;AAAA,EAAA,GAGhEF;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","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,EAAE,UAAUA,KAAkBA,EAAe,SAAS,UAAU,GAElIE,IAAmB,CAAA;AAEzB,aAAW,EAAE,WAAAC,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AAAC,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
|
+
{"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,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version":3,"file":"loadUniqueValuesToSave.d.ts","sourceRoot":"","sources":["../../../src/GraphMaker/utils/loadUniqueValuesToSave.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAoB,MAAM,UAAU,CAAC;AACrE,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"loadUniqueValuesToSave.d.ts","sourceRoot":"","sources":["../../../src/GraphMaker/utils/loadUniqueValuesToSave.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAoB,MAAM,UAAU,CAAC;AACrE,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAoBnD,wBAAsB,iCAAiC,CACrD,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,aAAa,EACxB,oBAAoB,EAAE,uBAAuB,GAC5C,OAAO,CAAC,uBAAuB,CAAC,CAwGlC;AACD,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,EACtC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,aAAa,EACxB,oBAAoB,EAAE,uBAAuB,GAC7C,OAAO,CAAC,uBAAuB,CAAC,CAwDjC;AAED,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,EACtC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,aAAa,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAuBpC"}
|