@milaboratories/graph-maker 1.1.166 → 1.1.168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/GraphMaker/constantsCommon.d.ts +2 -9
  2. package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
  3. package/dist/GraphMaker/constantsCommon.js +78 -83
  4. package/dist/GraphMaker/constantsCommon.js.map +1 -1
  5. package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js +8 -2
  6. package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js.map +1 -1
  7. package/dist/GraphMaker/forms/DataMappingForm/DiscreteForm.vue.js +26 -20
  8. package/dist/GraphMaker/forms/DataMappingForm/DiscreteForm.vue.js.map +1 -1
  9. package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue.d.ts.map +1 -1
  10. package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue.js +56 -38
  11. package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedArea.vue.js.map +1 -1
  12. package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedBar.vue.d.ts.map +1 -1
  13. package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedBar.vue.js +48 -30
  14. package/dist/GraphMaker/forms/LayersForm/Layer/discrete/StackedBar.vue.js.map +1 -1
  15. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot/Scatter.vue.d.ts.map +1 -1
  16. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot/Scatter.vue.js +37 -31
  17. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot/Scatter.vue.js.map +1 -1
  18. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot-umap/Scatter.vue.js +30 -24
  19. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot-umap/Scatter.vue.js.map +1 -1
  20. package/dist/GraphMaker/forms/StatisticsForm/DiscreteStatisticsForm.vue.js +33 -27
  21. package/dist/GraphMaker/forms/StatisticsForm/DiscreteStatisticsForm.vue.js.map +1 -1
  22. package/dist/GraphMaker/index.vue.js +8 -2
  23. package/dist/GraphMaker/index.vue.js.map +1 -1
  24. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.js +22 -16
  25. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.js.map +1 -1
  26. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +2 -0
  27. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
  28. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.js +17 -11
  29. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.js.map +1 -1
  30. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js +26 -20
  31. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js.map +1 -1
  32. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.js +29 -23
  33. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.js.map +1 -1
  34. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
  35. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +83 -68
  36. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
  37. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +25 -19
  38. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
  39. package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.d.ts.map +1 -1
  40. package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.js +7 -5
  41. package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.js.map +1 -1
  42. package/dist/GraphMaker/utils/getUsedAesInMapping.js +37 -31
  43. package/dist/GraphMaker/utils/getUsedAesInMapping.js.map +1 -1
  44. package/dist/GraphMaker/utils/loadDefaultSources.d.ts.map +1 -1
  45. package/dist/GraphMaker/utils/loadDefaultSources.js +36 -31
  46. package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
  47. package/dist/_virtual/stringify.js +5 -0
  48. package/dist/_virtual/stringify.js.map +1 -0
  49. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +8 -8
  50. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
  51. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +8 -8
  52. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js +54 -29
  53. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js.map +1 -1
  54. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js +12 -6
  55. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js.map +1 -1
  56. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +2 -0
  57. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
  58. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +106 -107
  59. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -1
  60. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +120 -121
  61. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -1
  62. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +83 -84
  63. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -1
  64. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +4 -4
  65. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js +11 -11
  66. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +123 -124
  67. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -1
  68. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +8 -8
  69. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +116 -117
  70. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -1
  71. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +100 -102
  72. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -1
  73. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +148 -119
  74. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -1
  75. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/components/PlDataTable.js +4 -4
  76. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js +5 -5
  77. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js +8 -0
  78. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js.map +1 -0
  79. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +182 -0
  80. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -0
  81. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/errors.js +18 -0
  82. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/errors.js.map +1 -0
  83. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/json.js +12 -0
  84. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/json.js.map +1 -0
  85. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/plid.js +7 -0
  86. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/plid.js.map +1 -0
  87. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/ref.js +8 -0
  88. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/ref.js.map +1 -0
  89. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +105 -111
  90. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -1
  91. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +158 -163
  92. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
  93. package/dist/node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js +36 -0
  94. package/dist/node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js.map +1 -0
  95. package/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js +8 -0
  96. package/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js.map +1 -0
  97. package/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +52 -0
  98. package/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -0
  99. package/dist/node_modules/@milaboratories/pl-model-common/dist/plid.js +7 -0
  100. package/dist/node_modules/@milaboratories/pl-model-common/dist/plid.js.map +1 -0
  101. package/dist/node_modules/@milaboratories/pl-model-common/dist/ref.js +8 -0
  102. package/dist/node_modules/@milaboratories/pl-model-common/dist/ref.js.map +1 -0
  103. package/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js +16 -0
  104. package/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js.map +1 -0
  105. package/dist/node_modules/json-stringify-safe/stringify.js +20 -0
  106. package/dist/node_modules/json-stringify-safe/stringify.js.map +1 -0
  107. package/dist/node_modules/zod/lib/index.js +2978 -0
  108. package/dist/node_modules/zod/lib/index.js.map +1 -0
  109. package/package.json +4 -4
  110. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +0 -18
  111. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +0 -1
@@ -1,97 +1,112 @@
1
- import { PALETTE_MAP as C, DEFAULT_CATEGORICAL_PALETTE as K, UNKNOWN_COLOR as M, DEFAULT_BLACK as U } from "../../constantsAesthetic.js";
2
- import { SCATTERPLOT_TEMPLATES_MAP as Y, isMappedAes as H, THRESHOLDS_KEY as D, PALETTE_KEY as F, UPPER_LIMIT_KEY as y, LOWER_LIMIT_KEY as _, SYMMETRIC_RANGE_KEY as h } from "../../constantsCommon.js";
3
- import { getScatterplotAes as W, DEFAULT_LINE_WIDTH as j, DEFAULT_DOT_SIZE as k, DEFAULT_DOT_SHAPE as V } from "../../dataBindAes.js";
4
- import { getScatterplotLayersSettings as w } from "./getLayersDataFromForms.js";
1
+ import { PALETTE_MAP as F, DEFAULT_CATEGORICAL_PALETTE as P, UNKNOWN_COLOR as U, DEFAULT_BLACK as w } from "../../constantsAesthetic.js";
2
+ import { SCATTERPLOT_TEMPLATES_MAP as G, isMappedAes as K } from "../../constantsCommon.js";
3
+ import { getScatterplotAes as M, DEFAULT_LINE_WIDTH as j, DEFAULT_DOT_SIZE as k, DEFAULT_DOT_SHAPE as V } from "../../dataBindAes.js";
4
+ import { getScatterplotLayersSettings as W } from "./getLayersDataFromForms.js";
5
5
  import { getAxesDataFromFormsScatterplot as B } from "./getAxesDataFromForms.js";
6
6
  import "../../../node_modules/@milaboratories/pf-plots/dist/index.js";
7
+ import "../../../node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js";
8
+ import { readAnnotation as u, Annotation as A } from "../../../node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js";
9
+ import "../../../node_modules/@milaboratories/pl-model-common/dist/plid.js";
10
+ import "../../../node_modules/@milaboratories/pl-model-common/dist/ref.js";
11
+ import "../../../node_modules/@platforma-sdk/model/dist/render/util/label.js";
12
+ import "../../../node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js";
7
13
  import "vue";
8
- function J(o, E, n, f, r) {
9
- var d, A, S, L, x;
10
- const s = (d = E.selectorStates[0]) == null ? void 0 : d.selectedSource, i = (A = n.selectorStates[0]) == null ? void 0 : A.selectedSource, c = (S = f.selectorStates[0]) == null ? void 0 : S.selectedSource, t = r.getSourceInfo(i), e = r.getSourceInfo(c);
11
- o.grouping = [...o.grouping ?? []].map((a) => ({ ...a }));
12
- const m = o.xAxis, l = o.yAxis;
13
- if (E.selectorStates.length) {
14
- const a = r.getSourceInfo(s).annotations;
15
- if (a != null && a[D] && (JSON.parse(a[D]) ?? []).forEach((N) => {
16
- var g;
17
- const { columnId: p, value: T } = N;
18
- p && t.kind === "column" && t.type === p.valueType && t.name === p.name && ((g = o.xAxis) == null ? void 0 : g.scale) === "discrete" && (m.significantLines || (m.significantLines = []), m.significantLines.push(Number(T))), p && e.kind === "column" && e.type === p.valueType && e.name === p.name && (l.significantLines || (l.significantLines = []), l.significantLines.push(Number(T)));
19
- }), a != null && a[F]) {
20
- const O = JSON.parse(a[F]), { mapping: N = {}, name: p = "" } = O;
21
- o.layers.forEach((u) => {
22
- u.type === "dots" && (u.aes || (u.aes = {}), u.aes.dotFill = { type: "grouping", value: s });
14
+ function H(o, S, e, d, i) {
15
+ var g, y, E, T, D;
16
+ const r = (g = S.selectorStates[0]) == null ? void 0 : g.selectedSource, a = (y = e.selectorStates[0]) == null ? void 0 : y.selectedSource, c = (E = d.selectorStates[0]) == null ? void 0 : E.selectedSource, n = i.getSourceInfo(a), t = i.getSourceInfo(c);
17
+ o.grouping = [...o.grouping ?? []].map((s) => ({ ...s }));
18
+ const h = o.xAxis, p = o.yAxis;
19
+ if (S.selectorStates.length) {
20
+ const s = i.getSourceInfo(r).spec, l = u(s, A.Graph.Thresholds);
21
+ l && (JSON.parse(l) ?? []).forEach((b) => {
22
+ var N;
23
+ const { columnId: f, value: x } = b;
24
+ f && n.kind === "column" && n.type === f.valueType && n.name === f.name && ((N = o.xAxis) == null ? void 0 : N.scale) === "discrete" && (h.significantLines || (h.significantLines = []), h.significantLines.push(Number(x))), f && t.kind === "column" && t.type === f.valueType && t.name === f.name && (p.significantLines || (p.significantLines = []), p.significantLines.push(Number(x)));
25
+ });
26
+ const m = u(s, A.Graph.Palette);
27
+ if (m) {
28
+ const I = JSON.parse(m), { mapping: b = {}, name: f = "" } = I;
29
+ o.layers.forEach((L) => {
30
+ L.type === "dots" && (L.aes || (L.aes = {}), L.aes.dotFill = { type: "grouping", value: r });
23
31
  });
24
- const T = [...Object.entries(N), ["null", M]], g = ((L = C[p]) == null ? void 0 : L.colors) ?? [];
25
- (x = o.grouping) == null || x.forEach((u) => {
26
- u.columnName.value === s && (u.inheritedAes = T.reduce((b, [P, R]) => {
27
- const I = g[Number(R)] ?? U;
28
- return b[P] = {
29
- fillColor: I,
30
- lineColor: I,
31
- dotFill: I,
32
+ const x = [...Object.entries(b), ["null", U]], N = ((T = F[f]) == null ? void 0 : T.colors) ?? [];
33
+ (D = o.grouping) == null || D.forEach((L) => {
34
+ L.columnName.value === r && (L.inheritedAes = x.reduce((O, [C, R]) => {
35
+ const _ = N[Number(R)] ?? w;
36
+ return O[C] = {
37
+ fillColor: _,
38
+ lineColor: _,
39
+ dotFill: _,
32
40
  dotShape: V,
33
41
  dotSize: k,
34
42
  lineWidth: j
35
- }, b;
43
+ }, O;
36
44
  }, {}));
37
45
  });
38
46
  }
39
47
  }
40
- t.annotations && (t.annotations[y] && (m.upperValue = Number(t.annotations[y])), t.annotations[_] && (m.lowerValue = Number(t.annotations[_])), t.annotations[h] && (m.symmetricRange = Number(t.annotations[h]))), e.annotations && (e.annotations[y] && (l.upperValue = Number(e.annotations[y])), e.annotations[_] && (l.lowerValue = Number(e.annotations[_])), e.annotations[h] && (l.symmetricRange = Number(e.annotations[h])));
48
+ if (n.annotations) {
49
+ const s = u(n, A.Graph.Axis.UpperLimit), l = u(n, A.Graph.Axis.LowerLimit), m = u(n, A.Graph.Axis.SymmetricRange);
50
+ s && (h.upperValue = Number(s)), l && (h.lowerValue = Number(l)), m && (h.symmetricRange = Number(m));
51
+ }
52
+ if (t.annotations) {
53
+ const s = u(t, A.Graph.Axis.UpperLimit), l = u(t, A.Graph.Axis.LowerLimit), m = u(t, A.Graph.Axis.SymmetricRange);
54
+ s && (p.upperValue = Number(s)), l && (p.lowerValue = Number(l)), m && (p.symmetricRange = Number(m));
55
+ }
41
56
  }
42
- function z(o, E, n, f, r) {
43
- (E.selectorStates.length || n != null && n.selectorStates.length) && (o.grouping = [...o.grouping ?? []].map((s) => ({ ...s })), o.grouping.forEach((s) => {
44
- const i = s.columnName.value, c = W(i, f, r);
45
- c.order.length ? (s.order = c.order, s.inheritedAes = c.inheritedAes) : o.layers.forEach((t) => {
46
- const e = t.aes;
47
- if (!e)
57
+ function J(o, S, e, d, i) {
58
+ (S.selectorStates.length || e != null && e.selectorStates.length) && (o.grouping = [...o.grouping ?? []].map((r) => ({ ...r })), o.grouping.forEach((r) => {
59
+ const a = r.columnName.value, c = M(a, d, i);
60
+ c.order.length ? (r.order = c.order, r.inheritedAes = c.inheritedAes) : o.layers.forEach((n) => {
61
+ const t = n.aes;
62
+ if (!t)
48
63
  return;
49
- Object.keys(e).forEach((l) => {
50
- var A, S;
51
- const d = e[l];
52
- if (H(d) && d.value === i) {
53
- const L = ((S = C[((A = r[i]) == null ? void 0 : A.palette) ?? K]) == null ? void 0 : S.colors) ?? [];
54
- d.palette = L;
64
+ Object.keys(t).forEach((p) => {
65
+ var y, E;
66
+ const g = t[p];
67
+ if (K(g) && g.value === a) {
68
+ const T = ((E = F[((y = i[a]) == null ? void 0 : y.palette) ?? P]) == null ? void 0 : E.colors) ?? [];
69
+ g.palette = T;
55
70
  }
56
71
  });
57
72
  });
58
73
  }));
59
74
  }
60
- function oo(o, E, n, f, r) {
61
- var c, t;
62
- o.layers = w(
63
- Y[n.template],
64
- n.layersSettings,
65
- E,
66
- n.optionsState,
67
- n.dataBindAes,
68
- f,
69
- (c = o == null ? void 0 : o.grouping) == null ? void 0 : c.map((e) => e.columnName)
70
- ), z(
75
+ function so(o, S, e, d, i) {
76
+ var c, n;
77
+ o.layers = W(
78
+ G[e.template],
79
+ e.layersSettings,
80
+ S,
81
+ e.optionsState,
82
+ e.dataBindAes,
83
+ d,
84
+ (c = o == null ? void 0 : o.grouping) == null ? void 0 : c.map((t) => t.columnName)
85
+ ), J(
71
86
  o,
72
- n.optionsState.components.grouping,
73
- n.optionsState.components.shape,
74
- r,
75
- n.dataBindAes
87
+ e.optionsState.components.grouping,
88
+ e.optionsState.components.shape,
89
+ i,
90
+ e.dataBindAes
76
91
  );
77
- const s = n.statisticsSettings, i = o.layers.find((e) => e.type === "dots");
78
- return s.trend.on && i && (o.trend = {
79
- color: (t = i.aes) == null ? void 0 : t.dotFill,
92
+ const r = e.statisticsSettings, a = o.layers.find((t) => t.type === "dots");
93
+ return r.trend.on && a && (o.trend = {
94
+ color: (n = a.aes) == null ? void 0 : n.dotFill,
80
95
  bounded: !1
81
96
  }), Object.assign(
82
97
  o,
83
- B(n.axesSettings, r, n.optionsState, f)
84
- ), J(
98
+ B(e.axesSettings, i, e.optionsState, d)
99
+ ), H(
85
100
  o,
86
- n.optionsState.components.grouping,
87
- n.optionsState.components.x,
88
- n.optionsState.components.y,
89
- f
101
+ e.optionsState.components.grouping,
102
+ e.optionsState.components.x,
103
+ e.optionsState.components.y,
104
+ d
90
105
  ), o;
91
106
  }
92
107
  export {
93
- J as applyChartInfoFromAnnotations,
94
- z as applyInheritedAes,
95
- oo as composeScatterplotSettings
108
+ H as applyChartInfoFromAnnotations,
109
+ J as applyInheritedAes,
110
+ so as composeScatterplotSettings
96
111
  };
97
112
  //# sourceMappingURL=composeScatterplotSettings.js.map
@@ -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, getAxesDataFromFormsScatterplot, getScatterplotLayersSettings } from '../index';\nimport { AxisSettingsContinuous } from '@milaboratories/miplots4';\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 const xAxis = settings.xAxis as AxisSettingsContinuous;\n const yAxis = settings.yAxis as AxisSettingsContinuous;\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 && settings.xAxis?.scale === 'discrete')) {\n if (!xAxis.significantLines) {\n xAxis.significantLines = [];\n }\n xAxis.significantLines.push(Number(value));\n }\n\n if (columnId && (yInfo.kind === 'column' && yInfo.type === columnId.valueType && yInfo.name === columnId.name)) {\n if (!yAxis.significantLines) {\n yAxis.significantLines = [];\n }\n 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 xAxis!.upperValue = Number(xInfo.annotations[UPPER_LIMIT_KEY]);\n }\n if (xInfo.annotations[LOWER_LIMIT_KEY]) {\n xAxis!.lowerValue = Number(xInfo.annotations[LOWER_LIMIT_KEY]);\n }\n if (xInfo.annotations[SYMMETRIC_RANGE_KEY]) {\n xAxis!.symmetricRange = Number(xInfo.annotations[SYMMETRIC_RANGE_KEY]);\n }\n }\n\n if (yInfo.annotations) {\n if (yInfo.annotations[UPPER_LIMIT_KEY]) {\n yAxis!.upperValue = Number(yInfo.annotations[UPPER_LIMIT_KEY]);\n }\n if (yInfo.annotations[LOWER_LIMIT_KEY]) {\n yAxis!.lowerValue = Number(yInfo.annotations[LOWER_LIMIT_KEY]);\n }\n if (yInfo.annotations[SYMMETRIC_RANGE_KEY]) {\n 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 getAxesDataFromFormsScatterplot(reactiveState.axesSettings, uniqueValuesData, reactiveState.optionsState, inputGuide)\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","xAxis","yAxis","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","getAxesDataFromFormsScatterplot"],"mappings":";;;;;;;AAsCO,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,EAAAT,EAAS,WAAW,CAAC,GAAIA,EAAS,YAAY,CAAA,CAAG,EAAE,IAAI,CAAAa,OAAM,EAAC,GAAGA,IAAG;AAEpE,QAAMC,IAAQd,EAAS,OACjBe,IAAQf,EAAS;AACvB,MAAIC,EAAS,eAAe,QAAQ;AAClC,UAAMe,IAAcZ,EAAW,cAAcC,CAAc,EAAE;AAsB7D,QArBIW,KAAA,QAAAA,EAAcC,OACO,KAAK,MAAMD,EAAYC,C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A,IACEC;AAAA,IACA0D,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCtD;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 MappingLink,\n SCATTERPLOT_TEMPLATES_MAP,\n ScatterplotStatisticsState,\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, getAxesDataFromFormsScatterplot, getScatterplotLayersSettings } from '../index';\nimport { AxisSettingsContinuous } from '@milaboratories/miplots4';\nimport { Annotation, readAnnotation } from '@platforma-sdk/model';\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 const xAxis = settings.xAxis as AxisSettingsContinuous;\n const yAxis = settings.yAxis as AxisSettingsContinuous;\n if (grouping.selectorStates.length) {\n const spec = inputGuide.getSourceInfo(groupingSource).spec;\n const thresholds = readAnnotation(spec, Annotation.Graph.Thresholds);\n if (thresholds) {\n const thresholdsData = JSON.parse(thresholds) ?? [];\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 && settings.xAxis?.scale === 'discrete')) {\n if (!xAxis.significantLines) {\n xAxis.significantLines = [];\n }\n xAxis.significantLines.push(Number(value));\n }\n\n if (columnId && (yInfo.kind === 'column' && yInfo.type === columnId.valueType && yInfo.name === columnId.name)) {\n if (!yAxis.significantLines) {\n yAxis.significantLines = [];\n }\n yAxis.significantLines.push(Number(value));\n }\n });\n }\n\n const palette = readAnnotation(spec, Annotation.Graph.Palette);\n if (palette) {\n const paletteData = JSON.parse(palette);\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 const upperLimit = readAnnotation(xInfo, Annotation.Graph.Axis.UpperLimit);\n const lowerLimit = readAnnotation(xInfo, Annotation.Graph.Axis.LowerLimit);\n const symmetricRange = readAnnotation(xInfo, Annotation.Graph.Axis.SymmetricRange);\n if (upperLimit) {\n xAxis!.upperValue = Number(upperLimit);\n }\n if (lowerLimit) {\n xAxis!.lowerValue = Number(lowerLimit);\n }\n if (symmetricRange) {\n xAxis!.symmetricRange = Number(symmetricRange);\n }\n }\n\n if (yInfo.annotations) {\n const upperLimit = readAnnotation(yInfo, Annotation.Graph.Axis.UpperLimit);\n const lowerLimit = readAnnotation(yInfo, Annotation.Graph.Axis.LowerLimit);\n const symmetricRange = readAnnotation(yInfo, Annotation.Graph.Axis.SymmetricRange);\n if (upperLimit) {\n yAxis!.upperValue = Number(upperLimit);\n }\n if (lowerLimit) {\n yAxis!.lowerValue = Number(lowerLimit);\n }\n if (symmetricRange) {\n yAxis!.symmetricRange = Number(symmetricRange);\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 getAxesDataFromFormsScatterplot(reactiveState.axesSettings, uniqueValuesData, reactiveState.optionsState, inputGuide)\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","xAxis","yAxis","spec","thresholds","readAnnotation","Annotation","thresholdData","columnId","value","palette","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","upperLimit","lowerLimit","symmetricRange","applyInheritedAes","shape","uniqueValuesData","dataBindAes","el","selectedSource","savedData","getScatterplotAes","layerAes","aesKey","isMappedAes","colors","DEFAULT_CATEGORICAL_PALETTE","composeScatterplotSettings","dataByColumns","reactiveState","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","statisticsSettings","dotsLayer","getAxesDataFromFormsScatterplot"],"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,EAAAT,EAAS,WAAW,CAAC,GAAIA,EAAS,YAAY,CAAA,CAAG,EAAE,IAAI,CAAAa,OAAM,EAAC,GAAGA,IAAG;AAEpE,QAAMC,IAAQd,EAAS,OACjBe,IAAQf,EAAS;AACvB,MAAIC,EAAS,eAAe,QAAQ;AAClC,UAAMe,IAAOZ,EAAW,cAAcC,CAAc,EAAE,MAChDY,IAAaC,EAAeF,GAAMG,EAAW,MAAM,UAAU;AACnE,IAAIF,MACqB,KAAK,MAAMA,CAAU,KAAK,CAAA,GAElC,QAAQ,CAACG,MAAuE;;AAC7F,YAAM,EAAE,UAAAC,GAAU,OAAAC,EAAA,IAAUF;AAC5B,MAAIC,KAAaV,EAAM,SAAS,YAAYA,EAAM,SAASU,EAAS,aAAaV,EAAM,SAASU,EAAS,UAAQf,IAAAN,EAAS,UAAT,gBAAAM,EAAgB,WAAU,eACpIQ,EAAM,qBACTA,EAAM,mBAAmB,CAAA,IAE3BA,EA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EAAA,GAGKJ;AACT;"}
@@ -1,44 +1,50 @@
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 { getAxesDataFromFormsScatterplot as s } from "./getAxesDataFromForms.js";
1
+ import { SCATTERPLOT_TEMPLATES_MAP as t } from "../../constantsCommon.js";
2
+ import { DEFAULT_DOT_SIZE_CANVAS as _ } from "../../dataBindAes.js";
3
+ import { getScatterplotLayersSettings as i } from "./getLayersDataFromForms.js";
4
+ import { getAxesDataFromFormsScatterplot as l } from "./getAxesDataFromForms.js";
5
5
  import "../../../node_modules/@milaboratories/pf-plots/dist/index.js";
6
+ import "../../../node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js";
7
+ import "../../../node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js";
8
+ import "../../../node_modules/@milaboratories/pl-model-common/dist/plid.js";
9
+ import "../../../node_modules/@milaboratories/pl-model-common/dist/ref.js";
10
+ import "../../../node_modules/@platforma-sdk/model/dist/render/util/label.js";
11
+ import "../../../node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js";
6
12
  import "vue";
7
13
  import "../../constantsAesthetic.js";
8
- import { applyInheritedAes as t, applyChartInfoFromAnnotations as S } from "./composeScatterplotSettings.js";
9
- const L = 750, f = 450;
10
- function C(p, A, o, m, n) {
11
- var r;
12
- return p.layers = E(
13
- _[o.template],
14
+ import { applyInheritedAes as E, applyChartInfoFromAnnotations as s } from "./composeScatterplotSettings.js";
15
+ const S = 750, L = 450;
16
+ function x(p, A, o, m, r) {
17
+ var n;
18
+ return p.layers = i(
19
+ t[o.template],
14
20
  o.layersSettings,
15
21
  A,
16
22
  o.optionsState,
17
23
  o.dataBindAes,
18
24
  m,
19
- (r = p == null ? void 0 : p.grouping) == null ? void 0 : r.map((T) => T.columnName),
20
- l
21
- ), t(
25
+ (n = p == null ? void 0 : p.grouping) == null ? void 0 : n.map((T) => T.columnName),
26
+ _
27
+ ), E(
22
28
  p,
23
29
  o.optionsState.components.grouping,
24
30
  void 0,
25
- n,
31
+ r,
26
32
  o.dataBindAes
27
33
  ), Object.assign(
28
34
  p,
29
- s(o.axesSettings, n, o.optionsState, m)
30
- ), S(
35
+ l(o.axesSettings, r, o.optionsState, m)
36
+ ), s(
31
37
  p,
32
38
  o.optionsState.components.grouping,
33
39
  o.optionsState.components.x,
34
40
  o.optionsState.components.y,
35
41
  m
36
42
  ), p.size = {
37
- width: L * o.chartScale / 100,
38
- height: f * o.chartScale / 100
43
+ width: S * o.chartScale / 100,
44
+ height: L * o.chartScale / 100
39
45
  }, p;
40
46
  }
41
47
  export {
42
- C as composeScatterplotUmapSettings
48
+ x as composeScatterplotUmapSettings
43
49
  };
44
50
  //# sourceMappingURL=composeScatterplotUmapSettings.js.map
@@ -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 { getAxesDataFromFormsScatterplot, 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 getAxesDataFromFormsScatterplot(reactiveState.axesSettings, uniqueValuesData, reactiveState.optionsState, inputGuide)\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","getAxesDataFromFormsScatterplot","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,EAAgCT,EAAc,cAAcE,GAAkBF,EAAc,cAAcC,CAAU;AAAA,EAAA,GAGtHS;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
+ {"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 { getAxesDataFromFormsScatterplot, 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 getAxesDataFromFormsScatterplot(reactiveState.axesSettings, uniqueValuesData, reactiveState.optionsState, inputGuide)\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","getAxesDataFromFormsScatterplot","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,EAAgCT,EAAc,cAAcE,GAAkBF,EAAc,cAAcC,CAAU;AAAA,EAAA,GAGtHS;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 +1 @@
1
- {"version":3,"file":"getLayersDataFromForms.d.ts","sourceRoot":"","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,WAAW,EACX,uBAAuB,EACvB,gBAAgB,EAIjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,EACL,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EAAE,UAAU,EAC3B,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAaxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,wBAAgB,aAAa,CAAC,kBAAkB,EAAE,uBAAuB,wBAiDxE;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,KAAK,EAAE,EACf,aAAa,EAAE,cAAc,EAC7B,kBAAkB,EAAE,u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AAG,WAAW,GAAG;QACjG,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,KAAK,EAAE,MAAM,EAAE,CAAA;KAChB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG;QACrD,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,KAAK,EAAE,MAAM,EAAE,CAAA;KAChB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACzE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { isContinuousDataMapping as g } from "../../constantsCommon.js";
1
+ import { isContinuousDataMapping as T } from "../../constantsCommon.js";
2
2
  import { AMINOACID_COLOR_MAPPING as L, NUCLEOTIDE_COLOR_MAPPING as A, PALETTE_MAP as b, DEFAULT_BLACK as y, DEFAULT_CONTINUOUS_PALETTE as F, DEFAULT_DOT_SHAPE as I } from "../../constantsAesthetic.js";
3
3
  import { DEFAULT_DOT_SIZE as V, DEFAULT_DOT_RANGE as _, isAestheticMappingContinuous as P, createContinuousMappingFromPalette as N } from "../../dataBindAes.js";
4
4
  function x(r) {
@@ -111,6 +111,7 @@ function B(r, l, p, u, d) {
111
111
  o.push({
112
112
  type: "stackedBar",
113
113
  normalize: e.normalize,
114
+ height: e.height,
114
115
  aes: {
115
116
  fillColor: i(e.fillColor),
116
117
  lineColor: i(e.lineColor),
@@ -124,6 +125,7 @@ function B(r, l, p, u, d) {
124
125
  type: "stackedArea",
125
126
  normalize: e.normalize,
126
127
  showBars: e.showBars,
128
+ height: e.height,
127
129
  aes: {
128
130
  fillColor: i(e.fillColor),
129
131
  lineColor: i(e.lineColor),
@@ -187,13 +189,13 @@ function B(r, l, p, u, d) {
187
189
  }
188
190
  function z(r, l, p, u) {
189
191
  if (r) {
190
- const d = g(l) ? l : { column: r.value, range: _ }, o = [1 / 0, -1 / 0];
192
+ const d = T(l) ? l : { column: r.value, range: _ }, o = [1 / 0, -1 / 0];
191
193
  return p.values[r.value].forEach((n) => {
192
194
  const c = Number(n);
193
195
  c < o[0] && (o[0] = c), c > o[1] && (o[1] = c);
194
196
  }), { columnName: r, domain: o, range: [d.range.min, d.range.max] };
195
197
  }
196
- return g(l) ? u : l ?? u;
198
+ return T(l) ? u : l ?? u;
197
199
  }
198
200
  function w(r, l, p, u) {
199
201
  const d = p.find((n) => n.value === r);
@@ -222,8 +224,8 @@ function R(r, l, p, u, d, o, n = [], c = V) {
222
224
  function t(a, s, D, G = !1) {
223
225
  var v;
224
226
  if (s.length) {
225
- 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]];
226
- return a === null || O === "String" || !G || !P(T) ? E : w(s[0], T, n, p);
227
+ 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), g = d[s[0]];
228
+ return a === null || O === "String" || !G || !P(g) ? E : w(s[0], g, n, p);
227
229
  }
228
230
  return typeof a == "object" ? D : a;
229
231
  }
@@ -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 === '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 emptyGroupValue: settings.emptyGroupValue ?? 0,\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 | number | 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,IAAIA,EAAmB,eAAe,KAAK;AAAA,IAAA;AAE7C,IAAIA,EAAmB,eAAe,KAAK,qBAAqB,WAC9DE,EAAM,mBACJF,EAAmB,eAAe,KAAK,mBAE3CC,EAAO,KAAKC,CAAK;AAAA,EACnB;AACA,MACEF,EAAmB,SAAS,KAAK,cACjCA,EAAmB,SAAS,SAAS,YACrC;AACA,UAAME,IAA4B;AAAA,MAChC,MAAM;AAAA,MACN,UAAU;AAAA,MACV,YAAYF,EAAmB,SAAS,KAAK;AAAA,MAC7C,QAAQA,EAAmB,SAAS,KAAK;AAAA,M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AiB;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
+ {"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 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 === 'stackedArea') {\n const settings = layerSettings[layer];\n result.push({\n type: 'stackedArea',\n normalize: settings.normalize,\n showBars: settings.showBars,\n height: settings.height,\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 emptyGroupValue: settings.emptyGroupValue ?? 0,\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 | number | 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;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