@milaboratories/graph-maker 1.1.177 → 1.1.179

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 (210) hide show
  1. package/dist/components/AesButton.vue.d.ts +6 -6
  2. package/dist/components/AesButton.vue.js +2 -2
  3. package/dist/components/AesButton.vue.js.map +1 -1
  4. package/dist/components/AesSettings/AesDataMappingContinuous.vue.js +14 -14
  5. package/dist/components/AesSettings/AesDataMappingContinuous.vue.js.map +1 -1
  6. package/dist/components/AesSettings/AesDataMappingDiscrete.vue.js +39 -38
  7. package/dist/components/AesSettings/AesDataMappingDiscrete.vue.js.map +1 -1
  8. package/dist/components/AesSettings/FixedColorsList.vue.d.ts +1 -1
  9. package/dist/components/AesSettings/FixedColorsList.vue.js +13 -12
  10. package/dist/components/AesSettings/FixedColorsList.vue.js.map +1 -1
  11. package/dist/components/AesSettings/FixedDotShapeList.vue.js +10 -9
  12. package/dist/components/AesSettings/FixedDotShapeList.vue.js.map +1 -1
  13. package/dist/components/AesSettings/FixedLineTypeList.vue.js +12 -11
  14. package/dist/components/AesSettings/FixedLineTypeList.vue.js.map +1 -1
  15. package/dist/components/AesSettings/FormWrapper.vue.js +2 -2
  16. package/dist/components/AesSettings/FormWrapper.vue.js.map +1 -1
  17. package/dist/components/AesSettings/PalettesForm.vue.js +54 -50
  18. package/dist/components/AesSettings/PalettesForm.vue.js.map +1 -1
  19. package/dist/components/AesSettings/types.d.ts +9 -9
  20. package/dist/components/BtnIconGroup.vue.js +10 -11
  21. package/dist/components/BtnIconGroup.vue.js.map +1 -1
  22. package/dist/components/Chart.vue.js +6 -8
  23. package/dist/components/Chart.vue.js.map +1 -1
  24. package/dist/components/CollapsableBlock.vue.js +2 -2
  25. package/dist/components/CollapsableBlock.vue.js.map +1 -1
  26. package/dist/components/DendroTable.vue.js +2 -2
  27. package/dist/components/DendroTable.vue.js.map +1 -1
  28. package/dist/components/DendroTooltip.vue.js +15 -14
  29. package/dist/components/DendroTooltip.vue.js.map +1 -1
  30. package/dist/components/DragAndDrop/DnDBasketChip.vue.js +2 -2
  31. package/dist/components/DragAndDrop/DnDBasketChip.vue.js.map +1 -1
  32. package/dist/components/DragAndDrop/DnDRangeChip.vue.d.ts +12 -3
  33. package/dist/components/DragAndDrop/DnDRangeChip.vue.js +4 -4
  34. package/dist/components/DragAndDrop/DnDRangeChip.vue.js.map +1 -1
  35. package/dist/components/DragAndDrop/DndBasket.vue.js +26 -26
  36. package/dist/components/DragAndDrop/DndBasket.vue.js.map +1 -1
  37. package/dist/components/DragAndDrop/DndChip.vue.js.map +1 -1
  38. package/dist/components/DragAndDrop/DndDoubleChip.vue.js +2 -2
  39. package/dist/components/DragAndDrop/DndDoubleChip.vue.js.map +1 -1
  40. package/dist/components/DragAndDrop/types.d.ts +1 -1
  41. package/dist/components/LassoControls/index.vue.js +4 -4
  42. package/dist/components/LassoControls/index.vue.js.map +1 -1
  43. package/dist/components/Loading.vue.js +8 -7
  44. package/dist/components/Loading.vue.js.map +1 -1
  45. package/dist/components/MultiselectButton.vue.js +28 -27
  46. package/dist/components/MultiselectButton.vue.js.map +1 -1
  47. package/dist/components/PanelModal.vue.js.map +1 -1
  48. package/dist/components/PlColorSlider.vue.js +12 -12
  49. package/dist/components/PlColorSlider.vue.js.map +1 -1
  50. package/dist/components/PlColorSliderThumb.vue.js +1 -3
  51. package/dist/components/PlColorSliderThumb.vue.js.map +1 -1
  52. package/dist/components/Popup.vue.d.ts +2 -0
  53. package/dist/components/Popup.vue.js +21 -21
  54. package/dist/components/Popup.vue.js.map +1 -1
  55. package/dist/components/ReorderForm.vue.js +20 -17
  56. package/dist/components/ReorderForm.vue.js.map +1 -1
  57. package/dist/components/SettingsTabs/icons/DeleteChartIcon.vue.js.map +1 -1
  58. package/dist/components/SettingsTabs/icons/LogIcon.vue.js.map +1 -1
  59. package/dist/components/SettingsTabs/icons/SettingsIcon.vue.js.map +1 -1
  60. package/dist/components/SettingsTabs/index.vue.d.ts +3 -2
  61. package/dist/components/SettingsTabs/index.vue.js +16 -15
  62. package/dist/components/SettingsTabs/index.vue.js.map +1 -1
  63. package/dist/components/Zoom/ZoomInput.vue.js +11 -11
  64. package/dist/components/Zoom/ZoomInput.vue.js.map +1 -1
  65. package/dist/components/Zoom/index.vue.js.map +1 -1
  66. package/dist/composition/useComponent.js.map +1 -1
  67. package/dist/constantsAesthetic.js.map +1 -1
  68. package/dist/constantsCommon.d.ts +3 -1
  69. package/dist/constantsCommon.js +5 -5
  70. package/dist/constantsCommon.js.map +1 -1
  71. package/dist/dataBindAes.js +4 -2
  72. package/dist/dataBindAes.js.map +1 -1
  73. package/dist/forms/AnnotationsForm.vue.d.ts +17 -0
  74. package/dist/forms/AnnotationsForm.vue.js +16 -0
  75. package/dist/forms/AnnotationsForm.vue.js.map +1 -0
  76. package/dist/forms/AxesSettingsForm/BubbleAxesSettingsForm.vue.js +35 -35
  77. package/dist/forms/AxesSettingsForm/BubbleAxesSettingsForm.vue.js.map +1 -1
  78. package/dist/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js +49 -47
  79. package/dist/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js.map +1 -1
  80. package/dist/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.js +53 -53
  81. package/dist/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.js.map +1 -1
  82. package/dist/forms/AxesSettingsForm/HistogramAxesSettingsForm.vue.js +37 -37
  83. package/dist/forms/AxesSettingsForm/HistogramAxesSettingsForm.vue.js.map +1 -1
  84. package/dist/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.js +38 -38
  85. package/dist/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.js.map +1 -1
  86. package/dist/forms/AxesSettingsForm/index.vue.js.map +1 -1
  87. package/dist/forms/DataMappingForm/BubbleForm.vue.js +4 -4
  88. package/dist/forms/DataMappingForm/BubbleForm.vue.js.map +1 -1
  89. package/dist/forms/DataMappingForm/DendroForm.vue.js +1 -1
  90. package/dist/forms/DataMappingForm/DendroForm.vue.js.map +1 -1
  91. package/dist/forms/DataMappingForm/DiscreteForm.vue.js.map +1 -1
  92. package/dist/forms/DataMappingForm/HeatmapForm.vue.js +2 -2
  93. package/dist/forms/DataMappingForm/HeatmapForm.vue.js.map +1 -1
  94. package/dist/forms/DataMappingForm/HistogramForm.vue.js.map +1 -1
  95. package/dist/forms/DataMappingForm/Layout/FormLayout.vue.js.map +1 -1
  96. package/dist/forms/DataMappingForm/Layout/MandatoryOptions.vue.js.map +1 -1
  97. package/dist/forms/DataMappingForm/Layout/OptionsList.vue.js.map +1 -1
  98. package/dist/forms/DataMappingForm/ScatterplotForm.vue.js +4 -4
  99. package/dist/forms/DataMappingForm/ScatterplotForm.vue.js.map +1 -1
  100. package/dist/forms/DataMappingForm/ScatterplotUmapForm.vue.js +4 -4
  101. package/dist/forms/DataMappingForm/ScatterplotUmapForm.vue.js.map +1 -1
  102. package/dist/forms/DataMappingForm/index.vue.js.map +1 -1
  103. package/dist/forms/DataMappingForm/useBaskets.js.map +1 -1
  104. package/dist/forms/DataMappingForm/utils.d.ts +1 -1
  105. package/dist/forms/DataMappingForm/utils.js +34 -34
  106. package/dist/forms/DataMappingForm/utils.js.map +1 -1
  107. package/dist/forms/LayersForm/AesSelector.vue.js +18 -25
  108. package/dist/forms/LayersForm/AesSelector.vue.js.map +1 -1
  109. package/dist/forms/LayersForm/DotSizeSelector.vue.d.ts +2 -0
  110. package/dist/forms/LayersForm/DotSizeSelector.vue.js +23 -23
  111. package/dist/forms/LayersForm/DotSizeSelector.vue.js.map +1 -1
  112. package/dist/forms/LayersForm/Layer/Bubble.vue.js +32 -34
  113. package/dist/forms/LayersForm/Layer/Bubble.vue.js.map +1 -1
  114. package/dist/forms/LayersForm/Layer/Dendro.vue.js +6 -6
  115. package/dist/forms/LayersForm/Layer/Dendro.vue.js.map +1 -1
  116. package/dist/forms/LayersForm/Layer/discrete/Bar.vue.js +6 -6
  117. package/dist/forms/LayersForm/Layer/discrete/Bar.vue.js.map +1 -1
  118. package/dist/forms/LayersForm/Layer/discrete/BinnedDots.vue.js +3 -3
  119. package/dist/forms/LayersForm/Layer/discrete/BinnedDots.vue.js.map +1 -1
  120. package/dist/forms/LayersForm/Layer/discrete/Boxplot.vue.js +3 -3
  121. package/dist/forms/LayersForm/Layer/discrete/Boxplot.vue.js.map +1 -1
  122. package/dist/forms/LayersForm/Layer/discrete/Errorbar.vue.js +9 -9
  123. package/dist/forms/LayersForm/Layer/discrete/Errorbar.vue.js.map +1 -1
  124. package/dist/forms/LayersForm/Layer/discrete/JitteredDots.vue.js +3 -3
  125. package/dist/forms/LayersForm/Layer/discrete/JitteredDots.vue.js.map +1 -1
  126. package/dist/forms/LayersForm/Layer/discrete/Line.vue.js +8 -8
  127. package/dist/forms/LayersForm/Layer/discrete/Line.vue.js.map +1 -1
  128. package/dist/forms/LayersForm/Layer/discrete/Logo.vue.js +3 -3
  129. package/dist/forms/LayersForm/Layer/discrete/Logo.vue.js.map +1 -1
  130. package/dist/forms/LayersForm/Layer/discrete/Sina.vue.js +3 -3
  131. package/dist/forms/LayersForm/Layer/discrete/Sina.vue.js.map +1 -1
  132. package/dist/forms/LayersForm/Layer/discrete/StackedArea.vue.js +9 -9
  133. package/dist/forms/LayersForm/Layer/discrete/StackedArea.vue.js.map +1 -1
  134. package/dist/forms/LayersForm/Layer/discrete/StackedBar.vue.js +6 -6
  135. package/dist/forms/LayersForm/Layer/discrete/StackedBar.vue.js.map +1 -1
  136. package/dist/forms/LayersForm/Layer/discrete/Violin.vue.js +3 -3
  137. package/dist/forms/LayersForm/Layer/discrete/Violin.vue.js.map +1 -1
  138. package/dist/forms/LayersForm/Layer/discrete/utils.js.map +1 -1
  139. package/dist/forms/LayersForm/Layer/heatmap/Heatmap.vue.js +23 -23
  140. package/dist/forms/LayersForm/Layer/heatmap/Heatmap.vue.js.map +1 -1
  141. package/dist/forms/LayersForm/Layer/heatmap/HeatmapAnnotations.vue.js +6 -6
  142. package/dist/forms/LayersForm/Layer/heatmap/HeatmapAnnotations.vue.js.map +1 -1
  143. package/dist/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue.js +28 -28
  144. package/dist/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue.js.map +1 -1
  145. package/dist/forms/LayersForm/Layer/histogram/Bins.vue.js +3 -3
  146. package/dist/forms/LayersForm/Layer/histogram/Bins.vue.js.map +1 -1
  147. package/dist/forms/LayersForm/Layer/scatterplot/Curve.vue.js.map +1 -1
  148. package/dist/forms/LayersForm/Layer/scatterplot/Scatter.vue.js.map +1 -1
  149. package/dist/forms/LayersForm/Layer/scatterplot-umap/Scatter.vue.js +2 -2
  150. package/dist/forms/LayersForm/Layer/scatterplot-umap/Scatter.vue.js.map +1 -1
  151. package/dist/forms/LayersForm/index.vue.js +56 -52
  152. package/dist/forms/LayersForm/index.vue.js.map +1 -1
  153. package/dist/forms/LogForm.vue.js.map +1 -1
  154. package/dist/forms/SettingsForm.vue.js.map +1 -1
  155. package/dist/forms/StatisticsForm/DiscreteStatisticsForm.vue.js +14 -14
  156. package/dist/forms/StatisticsForm/DiscreteStatisticsForm.vue.js.map +1 -1
  157. package/dist/forms/StatisticsForm/ScatterplotStatisticsForm.vue.js.map +1 -1
  158. package/dist/forms/StatisticsForm/index.vue.js.map +1 -1
  159. package/dist/forms/TemplateForm.vue.js +59 -52
  160. package/dist/forms/TemplateForm.vue.js.map +1 -1
  161. package/dist/forms/index.d.ts +21 -0
  162. package/dist/forms/index.js +53 -46
  163. package/dist/forms/index.js.map +1 -1
  164. package/dist/icons/Annotation.vue.d.ts +2 -0
  165. package/dist/icons/Annotation.vue.js +12 -0
  166. package/dist/icons/Annotation.vue.js.map +1 -0
  167. package/dist/icons/Annotation.vue2.js +5 -0
  168. package/dist/icons/Annotation.vue2.js.map +1 -0
  169. package/dist/icons/BinnedDotsIcon.vue.js.map +1 -1
  170. package/dist/icons/BoxplotAndBinnedIcon.vue.js.map +1 -1
  171. package/dist/icons/BoxplotAndJitterIcon.vue.js.map +1 -1
  172. package/dist/icons/BoxplotIcon.vue.js.map +1 -1
  173. package/dist/icons/EditIcon.vue.js.map +1 -1
  174. package/dist/icons/FrameLeft.vue.js.map +1 -1
  175. package/dist/icons/HeatmapAnnotation.vue.js.map +1 -1
  176. package/dist/icons/LineAndErrorbarIcon.vue.js.map +1 -1
  177. package/dist/icons/LogoIcon.vue.js.map +1 -1
  178. package/dist/icons/PlusIcon.vue.js.map +1 -1
  179. package/dist/icons/SinaIcon.vue.js.map +1 -1
  180. package/dist/icons/StackedAreaIcon.vue.js.map +1 -1
  181. package/dist/index.vue.d.ts +1 -0
  182. package/dist/index.vue.js +148 -146
  183. package/dist/index.vue.js.map +1 -1
  184. package/dist/store.d.ts +1 -1
  185. package/dist/store.js +2 -2
  186. package/dist/store.js.map +1 -1
  187. package/dist/types.d.ts +1 -1
  188. package/dist/utils/addFixedOptionsToState.js.map +1 -1
  189. package/dist/utils/calculateDiscreteGroups.js.map +1 -1
  190. package/dist/utils/createChartSettingsForRender/composeBubbleSettings.js.map +1 -1
  191. package/dist/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
  192. package/dist/utils/createChartSettingsForRender/composeDendroSettings.js.map +1 -1
  193. package/dist/utils/createChartSettingsForRender/composeDiscreteSettings.js +1 -1
  194. package/dist/utils/createChartSettingsForRender/composeDiscreteSettings.js.map +1 -1
  195. package/dist/utils/createChartSettingsForRender/composeHeatmapSettings.js.map +1 -1
  196. package/dist/utils/createChartSettingsForRender/composeHistogramSettings.js.map +1 -1
  197. package/dist/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
  198. package/dist/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +1 -1
  199. package/dist/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
  200. package/dist/utils/createChartSettingsForRender/getAxesDataFromForms.js +24 -24
  201. package/dist/utils/createChartSettingsForRender/getAxesDataFromForms.js.map +1 -1
  202. package/dist/utils/createChartSettingsForRender/getLayersDataFromForms.js.map +1 -1
  203. package/dist/utils/getPopupHeightForFixedAesList.js.map +1 -1
  204. package/dist/utils/getStatisticsOptions.js.map +1 -1
  205. package/dist/utils/getUsedAesInMapping.js +1 -1
  206. package/dist/utils/getUsedAesInMapping.js.map +1 -1
  207. package/dist/utils/loadDefaultSources.js.map +1 -1
  208. package/dist/utils/loadUniqueValuesToSave.js.map +1 -1
  209. package/dist/utils/saveToFile.js.map +1 -1
  210. package/package.json +5 -3
@@ -1,19 +1,19 @@
1
1
  import { computed as p } from "vue";
2
- function I(e, t, o, n, r) {
2
+ function F(e, t, o, n, s) {
3
3
  return p({
4
4
  get() {
5
- return e.value.components[t].selectorStates.map((s) => s.selectedSource);
5
+ return e.value.components[t].selectorStates.map((r) => r.selectedSource);
6
6
  },
7
- set(s) {
7
+ set(r) {
8
8
  if (!n)
9
9
  return;
10
- const c = s.map((l) => {
11
- const a = e.value.components[t].selectorStates.find((u) => u.selectedSource === l);
12
- if (a)
13
- return a;
10
+ const c = r.map((l) => {
11
+ const u = e.value.components[t].selectorStates.find((a) => a.selectedSource === l);
12
+ if (u)
13
+ return u;
14
14
  {
15
- const u = r.value.getSourceInfo(l);
16
- return u.isSubsetFilter ? { selectedSource: l, type: "subset" } : u.isDiscreteFilter ? {
15
+ const a = s.value.getSourceInfo(l);
16
+ return a.isSubsetFilter ? { selectedSource: l, type: "subset" } : a.isDiscreteFilter ? {
17
17
  selectedSource: l,
18
18
  type: "equals",
19
19
  selectedFilterValue: void 0
@@ -28,7 +28,7 @@ function I(e, t, o, n, r) {
28
28
  }
29
29
  });
30
30
  }
31
- function F(e, t, o, n, r) {
31
+ function I(e, t, o, n) {
32
32
  return p({
33
33
  get() {
34
34
  return e.value.components[t].selectorStates.map((s) => s.selectedSource);
@@ -36,22 +36,22 @@ function F(e, t, o, n, r) {
36
36
  set(s) {
37
37
  if (!n)
38
38
  return;
39
- const c = s.map((l) => {
40
- const a = e.value.components[t].selectorStates.find((u) => u.selectedSource === l);
41
- return a || { selectedSource: l };
39
+ const r = s.map((c) => {
40
+ const l = e.value.components[t].selectorStates.find((u) => u.selectedSource === c);
41
+ return l || { selectedSource: c };
42
42
  });
43
- e.value = o.changeSelected(t, n, e.value, c);
43
+ e.value = o.changeSelected(t, n, e.value, r);
44
44
  }
45
45
  });
46
46
  }
47
47
  function y(e, t, o, n) {
48
48
  return p({
49
49
  get() {
50
- var r;
51
- return ((r = e.value.components[t].selectorStates.map((s) => s.selectedSource)) == null ? void 0 : r[0]) ?? void 0;
50
+ var s;
51
+ return ((s = e.value.components[t].selectorStates.map((r) => r.selectedSource)) == null ? void 0 : s[0]) ?? void 0;
52
52
  },
53
- set(r) {
54
- n && (e.value = o.changeSelected(t, n, e.value, typeof r > "u" ? [] : [{ selectedSource: r }]));
53
+ set(s) {
54
+ n && (e.value = o.changeSelected(t, n, e.value, typeof s > "u" ? [] : [{ selectedSource: s }]));
55
55
  }
56
56
  });
57
57
  }
@@ -59,7 +59,7 @@ function d(e, t) {
59
59
  return e.options.map((n) => ({
60
60
  text: t(n.value).label,
61
61
  value: e.stateConsistency[n.value] === !1 ? "Inconsistent value" : n.value
62
- })).sort((n, r) => n.text > r.text ? 1 : -1);
62
+ })).sort((n, s) => n.text > s.text ? 1 : -1);
63
63
  }
64
64
  function x(e, t) {
65
65
  return Object.keys(e.components).reduce(
@@ -76,14 +76,14 @@ function f(e, t) {
76
76
  const o = /* @__PURE__ */ new Set();
77
77
  return t.forEach(
78
78
  (n) => {
79
- e.value.components[n].options.forEach(({ value: s }) => {
80
- o.add(s);
79
+ e.value.components[n].options.forEach(({ value: r }) => {
80
+ o.add(r);
81
81
  });
82
82
  }
83
83
  ), [...o].map((n) => ({
84
84
  id: n,
85
85
  info: e.value.getSourceInfo(n)
86
- })).sort((n, r) => n.info.label.localeCompare(r.info.label));
86
+ })).sort((n, s) => n.info.label.localeCompare(s.info.label));
87
87
  }
88
88
  function k(e, t) {
89
89
  return f(e, t).filter(
@@ -102,25 +102,25 @@ function h(e, t) {
102
102
  return g(e, t) ? " " : "";
103
103
  }
104
104
  function C(e, t, o, n) {
105
- return n.reduce((r, s) => {
105
+ return n.reduce((s, r) => {
106
106
  var m;
107
- const c = e.getSourceInfo(s), a = [
107
+ const c = e.getSourceInfo(r), u = [
108
108
  ...Object.keys(e.components).filter(
109
109
  (i) => e.components[i].options.find(
110
- (v) => v.value === s && !t[i].selectorStates.some((S) => S.selectedSource === s)
110
+ (v) => v.value === r && !t[i].selectorStates.some((S) => S.selectedSource === r)
111
111
  )
112
112
  )
113
- ], u = Object.values(e.components).some(({ stateConsistency: i }) => i[s] === !1);
114
- return r[s] = {
115
- id: s,
116
- title: u ? "Inconsistent value" : c.label,
113
+ ], a = Object.values(e.components).some(({ stateConsistency: i }) => i[r] === !1);
114
+ return s[r] = {
115
+ id: r,
116
+ title: a ? "Inconsistent value" : c.label,
117
117
  type: c.type,
118
118
  nonHomogenous: c.kind === "axis" && c.isNonHomogenous,
119
119
  isSubsetFilter: c.isSubsetFilter,
120
120
  isDiscreteFilter: c.isDiscreteFilter,
121
- availableBasketIds: new Set(a),
122
- uniqueValues: (((m = o[s]) == null ? void 0 : m.options) ?? []).map((i) => i.label)
123
- }, r;
121
+ availableBasketIds: new Set(u),
122
+ uniqueValues: (((m = o[r]) == null ? void 0 : m.options) ?? []).map((i) => i.label)
123
+ }, s;
124
124
  }, {});
125
125
  }
126
126
  export {
@@ -131,8 +131,8 @@ export {
131
131
  k as getFreeMetaOptions,
132
132
  f as getFreeOptions,
133
133
  g as hasInputError,
134
- I as toFiltersMulti,
135
- F as toSimpleMulti,
134
+ F as toFiltersMulti,
135
+ I as toSimpleMulti,
136
136
  y as toSimpleSingle
137
137
  };
138
138
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/forms/DataMappingForm/utils.ts"],"sourcesContent":["import {\n AxisData,\n ColumnData,\n ComponentGuideFilter,\n ComponentGuideSimple,\n Controller,\n DemoDataStore,\n InputGuide,\n InputState\n} from '@milaboratories/pf-plots';\nimport { computed, Ref } from 'vue';\nimport { ChipInfo } from '../../components/DragAndDrop/types';\nimport { ReactiveState, UniqueValuesBySourceMap } from '../../types';\n\ntype Option = { text: string; value: string }; // as an Option type in pl-uikit\n\n/** Bidirectionally extracts selectedSource from the filter state,\n * and preserve selectedFilterValue in unmodified items on write. */\nexport function toFiltersMulti(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n refToInputGuide: Ref<InputGuide<InputState>>\n): Ref<string[]> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource);\n },\n set(nextSelected) {\n if (!store) {\n return;\n }\n const nextSelectorStates = nextSelected.map((s) => {\n const el = refToState.value.components[inputName].selectorStates.find((v) => v.selectedSource === s);\n if (el) {\n return el;\n } else {\n const info = refToInputGuide.value.getSourceInfo(s);\n return info.isSubsetFilter\n ? { selectedSource: s, type: 'subset' }\n : info.isDiscreteFilter\n ? {\n selectedSource: s,\n type: 'equals',\n selectedFilterValue: undefined\n }\n : {\n selectedSource: s,\n type: 'range',\n selectedFilterRange: { min: undefined, max: undefined }\n };\n }\n });\n refToState.value = controller.changeSelected(inputName, store, refToState.value, nextSelectorStates);\n }\n });\n}\n\nexport function toSimpleMulti(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n refToInputGuide: Ref<InputGuide<InputState>>\n): Ref<string[]> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource);\n },\n set(nextSelected: string[]) {\n if (!store) {\n return;\n }\n const nextSelectorStates = nextSelected.map((s) => {\n const el = refToState.value.components[inputName].selectorStates.find((v) => v.selectedSource === s);\n if (el) {\n return el;\n } else {\n return { selectedSource: s }\n }\n });\n refToState.value = controller.changeSelected(inputName, store, refToState.value, nextSelectorStates);\n }\n });\n}\n\nexport function toSimpleSingle(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null\n): Ref<string | undefined> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource)?.[0] ?? undefined;\n },\n set(newValue: string | undefined) {\n if (!store) {\n return;\n }\n refToState.value = controller.changeSelected(inputName, store, refToState.value, typeof newValue === 'undefined' ? [] : [{ selectedSource: newValue }]);\n }\n });\n}\n\nexport type AllStateOptions<State extends InputState> = {\n [K in keyof State['components']]: Option[];\n};\n\nfunction getInputOptions(\n guide: ComponentGuideSimple | ComponentGuideFilter,\n getSourceInfo: (optionId: string) => ColumnData | AxisData,\n): Option[] {\n const options = guide.options.map((v) => ({\n text: getSourceInfo(v.value).label,\n value: guide.stateConsistency[v.value] === false ? 'Inconsistent value' : v.value\n }));\n return options.sort((a, b) => (a.text > b.text ? 1 : -1));\n}\n\nexport function getAllInputsOptions<T extends InputState>(\n inputState: T,\n inputGuide: Ref<InputGuide<T>>\n): AllStateOptions<T> {\n return Object.keys(inputState.components).reduce(\n (res: Record<string, Option[]>, name) => {\n res[name] = getInputOptions(\n inputGuide.value.components[name],\n inputGuide.value.getSourceInfo\n );\n return res;\n },\n {}\n ) as AllStateOptions<T>;\n}\n\nexport function getFreeOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n if (!inputGuide.value.readyData) {\n return [];\n }\n const optionsSet = new Set<string>();\n basketsIds.forEach((id) => {\n const item: ComponentGuideFilter | ComponentGuideSimple = inputGuide.value.components[id];\n item.options.forEach(({ value }) => {\n optionsSet.add(value);\n });\n }\n );\n return [...optionsSet].map((id) => ({\n id,\n info: inputGuide.value.getSourceInfo(id)\n })).sort((a, b) => a.info.label.localeCompare(b.info.label));\n}\n\nexport function getFreeMetaOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n return getFreeOptions(inputGuide, basketsIds).filter(\n ({ info }) => info.kind !== 'axis' || !info.mustBeConsumed\n );\n}\n\nexport function getFreeMandatoryOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[]\n) {\n return getFreeOptions(inputGuide, basketsIds).filter(({ info }) =>\n info.kind === 'axis' && info.mustBeConsumed\n );\n}\n\nexport function hasInputError<T extends InputState>(\n name: keyof T['components'],\n inputGuide: InputGuide<T>\n) {\n return Object.values(inputGuide.components[name].stateConsistency).some((v) => !v);\n}\n\nexport function getErrorForPlDropdown<T extends InputState>(\n name: keyof T['components'],\n inputGuide: InputGuide<T>\n) {\n return hasInputError(name, inputGuide) ? ' ' : ''; // if return value is not empty, dropdown marked with red frame\n}\n\nexport function getChipInfo(\n inputGuide: InputGuide<InputState>,\n optionsState: InputState['components'],\n labelsInfo: UniqueValuesBySourceMap,\n sourceIds: string[]\n): Record<string, ChipInfo> {\n return sourceIds.reduce((res: Record<string, ChipInfo>, id) => {\n const info = inputGuide.getSourceInfo(id);\n const basketsMeta = Object.keys(inputGuide.components);\n const availableBasketsIds = [\n ...basketsMeta.filter((name) =>\n inputGuide.components[name].options.find(\n (option) => option.value === id &&\n !optionsState[name].selectorStates.some(s => s.selectedSource === id)\n )\n )\n ];\n const isInconsistent = Object.values(inputGuide.components).some(({ stateConsistency }) => stateConsistency[id] === false);\n res[id] = {\n id,\n title: isInconsistent ? 'Inconsistent value' : info.label,\n type: info.type,\n nonHomogenous: info.kind === 'axis' && info.isNonHomogenous,\n isSubsetFilter: info.isSubsetFilter,\n isDiscreteFilter: info.isDiscreteFilter,\n availableBasketIds: new Set(availableBasketsIds),\n uniqueValues: (labelsInfo[id]?.options ?? []).map(v => v.label)\n };\n return res;\n }, {});\n}\n"],"names":["toFiltersMulti","refToState","inputName","controller","store","refToInputGuide","computed","v","nextSelected","nextSelectorStates","s","el","info","toSimpleMulti","toSimpleSingle","_a","newValue","getInputOptions","guide","getSourceInfo","a","b","getAllInputsOptions","inputState","inputGuide","res","name","getFreeOptions","basketsIds","optionsSet","id","value","getFreeMetaOptions","getFreeMandatoryOptions","hasInputError","getErrorForPlDropdown","getChipInfo","optionsState","labelsInfo","sourceIds","availableBasketsIds","option","isInconsistent","stateConsistency"],"mappings":";AAkBO,SAASA,EACdC,GACAC,GACAC,GACAC,GACAC,GACe;AACf,SAAOC,EAAS;AAAA,IACd,MAAM;AACJ,aAAOL,EAAW,MAAM,WAAWC,CAAS,EAAE,eAAe,IAAI,CAACK,MAAMA,EAAE,cAAc;AAAA,IAC1F;AAAA,IACA,IAAIC,GAAc;AAChB,UAAI,CAACJ;AACH;AAEF,YAAMK,IAAqBD,EAAa,IAAI,CAACE,MAAM;AACjD,cAAMC,IAAKV,EAAW,MAAM,WAAWC,CAAS,EAAE,eAAe,KAAK,CAACK,MAAMA,EAAE,mBAAmBG,CAAC;AACnG,YAAIC;AACF,iBAAOA;AACF;AACL,gBAAMC,IAAOP,EAAgB,MAAM,cAAcK,CAAC;AAClD,iBAAOE,EAAK,iBACR,EAAE,gBAAgBF,GAAG,MAAM,SAAA,IAC3BE,EAAK,mBACH;AAAA,YACE,gBAAgBF;AAAA,YAChB,MAAM;AAAA,YACN,qBAAqB;AAAA,UAAA,IAEvB;AAAA,YACA,gBAAgBA;AAAA,YAChB,MAAM;AAAA,YACN,qBAAqB,EAAE,KAAK,QAAW,KAAK,OAAA;AAAA,UAAU;AAAA,QAE9D;AAAA,MACF,CAAC;AACD,MAAAT,EAAW,QAAQE,EAAW,eAAeD,GAAWE,GAAOH,EAAW,OAAOQ,CAAkB;AAAA,IACrG;AAAA,EAAA,CACD;AACH;AAEO,SAASI,EACdZ,GACAC,GACAC,GACAC,GACAC,GACe;AACf,SAAOC,EAAS;AAAA,IACd,MAAM;AACJ,aAAOL,EAAW,MAAM,WAAWC,CAAS,EAAE,eAAe,IAAI,CAACK,MAAMA,EAAE,cAAc;AAAA,IAC1F;AAAA,IACA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AAC7D,UAAMlB,IAAOY,EAAW,cAAcM,CAAE,GAElCU,IAAsB;AAAA,MAC1B,GAFkB,OAAO,KAAKhB,EAAW,UAAU,EAEpC;AAAA,QAAO,CAACE,MACrBF,EAAW,WAAWE,CAAI,EAAE,QAAQ;AAAA,UAClC,CAACe,MAAWA,EAAO,UAAUX,KAC7B,CAACO,EAAaX,CAAI,EAAE,eAAe,KAAK,CAAAhB,MAAKA,EAAE,mBAAmBoB,CAAE;AAAA,QAAA;AAAA,MACtE;AAAA,IACF,GAEIY,IAAiB,OAAO,OAAOlB,EAAW,UAAU,EAAE,KAAK,CAAC,EAAE,kBAAAmB,EAAA,MAAuBA,EAAiBb,CAAE,MAAM,EAAK;AACzH,WAAAL,EAAIK,CAAE,IAAI;AAAA,MACR,IAAAA;AAAA,MACA,OAAOY,IAAiB,uBAAuB9B,EAAK;AAAA,MACpD,MAAMA,EAAK;AAAA,MACX,eAAeA,EAAK,SAAS,UAAUA,EAAK;AAAA,MAC5C,gBAAgBA,EAAK;AAAA,MACrB,kBAAkBA,EAAK;AAAA,MACvB,oBAAoB,IAAI,IAAI4B,CAAmB;AAAA,MAC/C,iBAAezB,IAAAuB,EAAWR,CAAE,MAAb,gBAAAf,EAAgB,YAAW,CAAA,GAAI,IAAI,CAAAR,MAAKA,EAAE,KAAK;AAAA,IAAA,GAEzDkB;AAAA,EACT,GAAG,CAAA,CAAE;AACP;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/forms/DataMappingForm/utils.ts"],"sourcesContent":["import type {\n AxisData,\n ColumnData,\n ComponentGuideFilter,\n ComponentGuideSimple,\n Controller,\n DemoDataStore,\n InputGuide,\n InputState,\n} from '@milaboratories/pf-plots';\nimport type { Ref } from 'vue';\nimport { computed } from 'vue';\nimport type { ChipInfo } from '../../components/DragAndDrop/types';\nimport type { UniqueValuesBySourceMap } from '../../types';\n\ntype Option = { text: string; value: string }; // as an Option type in pl-uikit\n\n/** Bidirectionally extracts selectedSource from the filter state,\n * and preserve selectedFilterValue in unmodified items on write. */\nexport function toFiltersMulti(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n refToInputGuide: Ref<InputGuide<InputState>>,\n): Ref<string[]> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource);\n },\n set(nextSelected) {\n if (!store) {\n return;\n }\n const nextSelectorStates = nextSelected.map((s) => {\n const el = refToState.value.components[inputName].selectorStates.find((v) => v.selectedSource === s);\n if (el) {\n return el;\n } else {\n const info = refToInputGuide.value.getSourceInfo(s);\n return info.isSubsetFilter\n ? { selectedSource: s, type: 'subset' }\n : info.isDiscreteFilter\n ? {\n selectedSource: s,\n type: 'equals',\n selectedFilterValue: undefined,\n }\n : {\n selectedSource: s,\n type: 'range',\n selectedFilterRange: { min: undefined, max: undefined },\n };\n }\n });\n refToState.value = controller.changeSelected(inputName, store, refToState.value, nextSelectorStates);\n },\n });\n}\n\nexport function toSimpleMulti(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n): Ref<string[]> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource);\n },\n set(nextSelected: string[]) {\n if (!store) {\n return;\n }\n const nextSelectorStates = nextSelected.map((s) => {\n const el = refToState.value.components[inputName].selectorStates.find((v) => v.selectedSource === s);\n if (el) {\n return el;\n } else {\n return { selectedSource: s };\n }\n });\n refToState.value = controller.changeSelected(inputName, store, refToState.value, nextSelectorStates);\n },\n });\n}\n\nexport function toSimpleSingle(\n refToState: Ref<InputState>,\n inputName: keyof InputState['components'],\n controller: Controller<InputState>,\n store: DemoDataStore | null,\n): Ref<string | undefined> {\n return computed({\n get() {\n return refToState.value.components[inputName].selectorStates.map((v) => v.selectedSource)?.[0] ?? undefined;\n },\n set(newValue: string | undefined) {\n if (!store) {\n return;\n }\n refToState.value = controller.changeSelected(inputName, store, refToState.value, typeof newValue === 'undefined' ? [] : [{ selectedSource: newValue }]);\n },\n });\n}\n\nexport type AllStateOptions<State extends InputState> = {\n [K in keyof State['components']]: Option[];\n};\n\nfunction getInputOptions(\n guide: ComponentGuideSimple | ComponentGuideFilter,\n getSourceInfo: (optionId: string) => ColumnData | AxisData,\n): Option[] {\n const options = guide.options.map((v) => ({\n text: getSourceInfo(v.value).label,\n value: guide.stateConsistency[v.value] === false ? 'Inconsistent value' : v.value,\n }));\n return options.sort((a, b) => (a.text > b.text ? 1 : -1));\n}\n\nexport function getAllInputsOptions<T extends InputState>(\n inputState: T,\n inputGuide: Ref<InputGuide<T>>,\n): AllStateOptions<T> {\n return Object.keys(inputState.components).reduce(\n (res: Record<string, Option[]>, name) => {\n res[name] = getInputOptions(\n inputGuide.value.components[name],\n inputGuide.value.getSourceInfo,\n );\n return res;\n },\n {},\n ) as AllStateOptions<T>;\n}\n\nexport function getFreeOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[],\n) {\n if (!inputGuide.value.readyData) {\n return [];\n }\n const optionsSet = new Set<string>();\n basketsIds.forEach((id) => {\n const item: ComponentGuideFilter | ComponentGuideSimple = inputGuide.value.components[id];\n item.options.forEach(({ value }) => {\n optionsSet.add(value);\n });\n },\n );\n return [...optionsSet].map((id) => ({\n id,\n info: inputGuide.value.getSourceInfo(id),\n })).sort((a, b) => a.info.label.localeCompare(b.info.label));\n}\n\nexport function getFreeMetaOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[],\n) {\n return getFreeOptions(inputGuide, basketsIds).filter(\n ({ info }) => info.kind !== 'axis' || !info.mustBeConsumed,\n );\n}\n\nexport function getFreeMandatoryOptions<T extends InputState>(\n inputGuide: Ref<InputGuide<T>>,\n basketsIds: (keyof InputGuide<T>['components'])[],\n) {\n return getFreeOptions(inputGuide, basketsIds).filter(({ info }) =>\n info.kind === 'axis' && info.mustBeConsumed,\n );\n}\n\nexport function hasInputError<T extends InputState>(\n name: keyof T['components'],\n inputGuide: InputGuide<T>,\n) {\n return Object.values(inputGuide.components[name].stateConsistency).some((v) => !v);\n}\n\nexport function getErrorForPlDropdown<T extends InputState>(\n name: keyof T['components'],\n inputGuide: InputGuide<T>,\n) {\n return hasInputError(name, inputGuide) ? ' ' : ''; // if return value is not empty, dropdown marked with red frame\n}\n\nexport function getChipInfo(\n inputGuide: InputGuide<InputState>,\n optionsState: InputState['components'],\n labelsInfo: UniqueValuesBySourceMap,\n sourceIds: string[],\n): Record<string, ChipInfo> {\n return sourceIds.reduce((res: Record<string, ChipInfo>, id) => {\n const info = inputGuide.getSourceInfo(id);\n const basketsMeta = Object.keys(inputGuide.components);\n const availableBasketsIds = [\n ...basketsMeta.filter((name) =>\n inputGuide.components[name].options.find(\n (option) => option.value === id\n && !optionsState[name].selectorStates.some((s) => s.selectedSource === id),\n ),\n ),\n ];\n const isInconsistent = Object.values(inputGuide.components).some(({ stateConsistency }) => stateConsistency[id] === false);\n res[id] = {\n id,\n title: isInconsistent ? 'Inconsistent value' : info.label,\n type: info.type,\n nonHomogenous: info.kind === 'axis' && info.isNonHomogenous,\n isSubsetFilter: info.isSubsetFilter,\n isDiscreteFilter: info.isDiscreteFilter,\n availableBasketIds: new Set(availableBasketsIds),\n uniqueValues: (labelsInfo[id]?.options ?? []).map((v) => v.label),\n };\n return res;\n }, {});\n}\n"],"names":["toFiltersMulti","refToState","inputName","controller","store","refToInputGuide","computed","v","nextSelected","nextSelectorStates","s","el","info","toSimpleMulti","toSimpleSingle","_a","newValue","getInputOptions","guide","getSourceInfo","a","b","getAllInputsOptions","inputState","inputGuide","res","name","getFreeOptions","basketsIds","optionsSet","id","value","getFreeMetaOptions","getFreeMandatoryOptions","hasInputError","getErrorForPlDropdown","getChipInfo","optionsState","labelsInfo","sourceIds","availableBasketsIds","option","isInconsistent","stateConsistency"],"mappings":";AAmBO,SAASA,EACdC,GACAC,GACAC,GACAC,GACAC,GAC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AAChB,MAAMA,EAAE,mBAAmBoB,CAAE;AAAA,QAAA;AAAA,MAC7E;AAAA,IACF,GAEIY,IAAiB,OAAO,OAAOlB,EAAW,UAAU,EAAE,KAAK,CAAC,EAAE,kBAAAmB,EAAA,MAAuBA,EAAiBb,CAAE,MAAM,EAAK;AACzH,WAAAL,EAAIK,CAAE,IAAI;AAAA,MACR,IAAAA;AAAA,MACA,OAAOY,IAAiB,uBAAuB9B,EAAK;AAAA,MACpD,MAAMA,EAAK;AAAA,MACX,eAAeA,EAAK,SAAS,UAAUA,EAAK;AAAA,MAC5C,gBAAgBA,EAAK;AAAA,MACrB,kBAAkBA,EAAK;AAAA,MACvB,oBAAoB,IAAI,IAAI4B,CAAmB;AAAA,MAC/C,iBAAezB,IAAAuB,EAAWR,CAAE,MAAb,gBAAAf,EAAgB,YAAW,CAAA,GAAI,IAAI,CAACR,MAAMA,EAAE,KAAK;AAAA,IAAA,GAE3DkB;AAAA,EACT,GAAG,CAAA,CAAE;AACP;"}
@@ -139,14 +139,7 @@ const Ee = { class: "aes-input-row" }, Ne = /* @__PURE__ */ Z({
139
139
  e.type === "fix" ? D("aes-update", m.value, e) : e.type === "dataCategorical" ? (x.value = e.initialData, D("aes-update", e.initialData, e)) : e.type === "dataContinuous" && (I.value = e.initialData, D("aes-update", e.initialData, e));
140
140
  }
141
141
  );
142
- const U = F(), Q = y(() => {
143
- if (r.type === "lineType")
144
- return se.length * 32 + 32;
145
- if (r.type === "dotShape")
146
- return Math.ceil(re.length / 6) * 36 + 40;
147
- if (r.type === "fill" || r.type === "stroke")
148
- return Math.ceil(A.length / 6) * 36 + 40;
149
- });
142
+ const U = F(), Q = y(() => r.type === "lineType" ? se.length * 32 + 32 : r.type === "dotShape" ? Math.ceil(re.length / 6) * 36 + 40 : r.type === "fill" || r.type === "stroke" ? Math.ceil(A.length / 6) * 36 + 40 : 0);
150
143
  return (l, e) => {
151
144
  var v, a;
152
145
  return g(), _(ee, null, [
@@ -157,12 +150,12 @@ const Ee = { class: "aes-input-row" }, Ne = /* @__PURE__ */ Z({
157
150
  }, ["stop"]))
158
151
  }, [
159
152
  R(w(ae), {
153
+ modelValue: s.value,
154
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => s.value = t),
160
155
  disabled: i.disabled || N.value.length < 2,
161
156
  label: i.label,
162
- options: N.value,
163
- modelValue: s.value,
164
- "onUpdate:modelValue": e[0] || (e[0] = (t) => s.value = t)
165
- }, null, 8, ["disabled", "label", "options", "modelValue"])
157
+ options: N.value
158
+ }, null, 8, ["modelValue", "disabled", "label", "options"])
166
159
  ]),
167
160
  R(de, {
168
161
  data: {
@@ -184,13 +177,13 @@ const Ee = { class: "aes-input-row" }, Ne = /* @__PURE__ */ Z({
184
177
  }, [
185
178
  i.type === "fill" || i.type === "stroke" ? (g(), S(fe, {
186
179
  key: 0,
187
- "color-using": i.type,
188
180
  modelValue: m.value,
189
181
  "onUpdate:modelValue": [
190
182
  e[4] || (e[4] = (t) => m.value = t),
191
183
  e[5] || (e[5] = (t) => l.$emit("aes-update", t, d.value.fix))
192
- ]
193
- }, null, 8, ["color-using", "modelValue"])) : T("", !0),
184
+ ],
185
+ "color-using": i.type
186
+ }, null, 8, ["modelValue", "color-using"])) : T("", !0),
194
187
  i.type === "dotShape" ? (g(), S(me, {
195
188
  key: 1,
196
189
  modelValue: m.value,
@@ -223,27 +216,27 @@ const Ee = { class: "aes-input-row" }, Ne = /* @__PURE__ */ Z({
223
216
  return [
224
217
  ((t = n.value) == null ? void 0 : t.type) === "dataCategorical" && x.value ? (g(), S(Se, {
225
218
  key: 0,
219
+ modelValue: x.value,
220
+ "onUpdate:modelValue": [
221
+ e[11] || (e[11] = (f) => x.value = f),
222
+ e[12] || (e[12] = (f) => l.$emit("aes-update", f, n.value))
223
+ ],
226
224
  "column-value-labels": n.value.labels,
227
225
  "data-column-label": ((u = n.value.selectedSourceInfo) == null ? void 0 : u.label) ?? "",
228
226
  "used-aes-in-mapping": Y.value[n.value.selectedSource],
229
227
  "allow-hiding": o.value === "discrete",
230
228
  "allow-reordering": o.value === "discrete" || o.value === "histogram" || o.value === "scatterplot" || o.value === "scatterplot-umap",
231
- "allow-null-option": o.value === "discrete" && (s.value === "primaryGrouping" && w(p).reactive.axesSettings.axisX.allowNullPrimaryGroups || s.value === "secondaryGrouping" && w(p).reactive.axesSettings.axisX.allowNullSecondaryGroups) || o.value === "scatterplot" || o.value === "scatterplot-umap",
232
- modelValue: x.value,
233
- "onUpdate:modelValue": [
234
- e[11] || (e[11] = (f) => x.value = f),
235
- e[12] || (e[12] = (f) => l.$emit("aes-update", f, n.value))
236
- ]
237
- }, null, 8, ["column-value-labels", "data-column-label", "used-aes-in-mapping", "allow-hiding", "allow-reordering", "allow-null-option", "modelValue"])) : T("", !0),
229
+ "allow-null-option": o.value === "discrete" && (s.value === "primaryGrouping" && w(p).reactive.axesSettings.axisX.allowNullPrimaryGroups || s.value === "secondaryGrouping" && w(p).reactive.axesSettings.axisX.allowNullSecondaryGroups) || o.value === "scatterplot" || o.value === "scatterplot-umap"
230
+ }, null, 8, ["modelValue", "column-value-labels", "data-column-label", "used-aes-in-mapping", "allow-hiding", "allow-reordering", "allow-null-option"])) : T("", !0),
238
231
  ((c = n.value) == null ? void 0 : c.type) === "dataContinuous" && I.value ? (g(), S(Te, {
239
232
  key: 1,
240
- "data-column-label": ((b = n.value.selectedSourceInfo) == null ? void 0 : b.label) ?? "",
241
233
  modelValue: I.value,
242
234
  "onUpdate:modelValue": [
243
235
  e[13] || (e[13] = (f) => I.value = f),
244
236
  e[14] || (e[14] = (f) => l.$emit("aes-update", f, n.value))
245
- ]
246
- }, null, 8, ["data-column-label", "modelValue"])) : T("", !0)
237
+ ],
238
+ "data-column-label": ((b = n.value.selectedSourceInfo) == null ? void 0 : b.label) ?? ""
239
+ }, null, 8, ["modelValue", "data-column-label"])) : T("", !0)
247
240
  ];
248
241
  }),
249
242
  _: 1
@@ -1 +1 @@
1
- {"version":3,"file":"AesSelector.vue.js","sources":["../../../src/forms/LayersForm/AesSelector.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ref, computed, watch } from 'vue';\nimport { PlDropdown } from '@platforma-sdk/ui-vue';\nimport {\n AestheticMappingCategorical, AestheticMappingContinuous, createContinuousMappingFromPalette,\n createDefaultMapping\n} from '../../dataBindAes';\nimport {\n AesOption,\n DotShape,\n LineType\n} from '../../components/AesSettings/types';\nimport {\n DEFAULT_CONTINUOUS_PALETTE,\n DEFAULT_DOT_SHAPE,\n DEFAULT_LINE_TYPE,\n FIXED_COLORS,\n FIXED_LINE_TYPES,\n FIXES_DOT_SHAPES\n} from '../../constantsAesthetic';\nimport AesButton, { type AesButtonProps } from '../../components/AesButton.vue';\nimport { useStore } from '../../store';\nimport { AesType, isMappedAes, MappingLink } from '../../constantsCommon';\nimport Popup from '../../components/Popup.vue';\nimport FixedColorsList from '../../components/AesSettings/FixedColorsList.vue';\nimport FixedDotShapeList from '../../components/AesSettings/FixedDotShapeList.vue';\nimport FixedLineTypeList from '../../components/AesSettings/FixedLineTypeList.vue';\nimport FormWrapper from '../../components/AesSettings/FormWrapper.vue';\nimport AesDataMappingDiscrete from '../../components/AesSettings/AesDataMappingDiscrete.vue';\nimport AesDataMappingContinuous from '../../components/AesSettings/AesDataMappingContinuous.vue';\nimport { ChartType } from '@milaboratories/pf-plots';\n\nconst props = defineProps<{\n label: string;\n type: AesType;\n selected: string | MappingLink;\n formTitle: string;\n formBackTitle: string;\n possibleAesSourceInputs?: string[];\n withoutFixed?: boolean;\n disabled?: boolean;\n}>();\n\nconst store = useStore();\nconst chartType = computed(() => store.value.reactive.chartType);\nconst emit = defineEmits(['aes-update', 'aes-selector-close']);\n\nconst DEFAULT_AES_INPUTS: Record<ChartType, string[]> = {\n discrete: ['primaryGrouping', 'secondaryGrouping'],\n scatterplot: ['grouping'],\n 'scatterplot-umap': ['grouping'],\n dendro: [],\n heatmap: [],\n histogram: ['grouping'],\n bubble: []\n};\nconst possibleAesSourceInputs = props.possibleAesSourceInputs ?? DEFAULT_AES_INPUTS[chartType.value];\nconst usedAesInMapping = computed(\n () => {\n const v = store.value.commonHelpersData.usedAesInMapping.value;\n return v;\n }\n);\n\nfunction getKeyFromSelectedType(value: MappingLink | string) {\n if (typeof value === 'string') {\n return value;\n }\n if (chartType.value === 'scatterplot') {\n return `grouping_${value.value}`;\n }\n if (chartType.value === 'dendro') {\n return `${value.type}_${value.value}`;\n }\n return value.type;\n}\n\nconst selectedType = ref(\n isMappedAes(props.selected) ? getKeyFromSelectedType(props.selected) : 'fix'\n);\nconst DEFAULT_BY_TYPES: Record<AesType, string | DotShape | LineType> = {\n fill: FIXED_COLORS[0].color,\n stroke: FIXED_COLORS[0].color,\n dotShape: DEFAULT_DOT_SHAPE,\n lineType: DEFAULT_LINE_TYPE,\n size: '' // temporary\n};\n\nconst inputGuide = computed(() => store.value.inputGuide.value);\nconst labelsInfo = computed(() => store.value.uniqueValuesData.value);\n\nconst chartTypesWithContinuousColors = new Set<ChartType>([\n 'scatterplot', 'scatterplot-umap', 'heatmap'\n]);\n\nconst optionsInfo = computed(() => {\n const res: Record<string, AesOption> = {};\n const inputStateMap = store.value.reactive.optionsState.components;\n\n function addInfo(name: string, source: string) {\n const selectedSourceInfo = inputGuide.value.getSourceInfo(source);\n const uniqueValuesItem = labelsInfo.value[source];\n const uniqueValues = uniqueValuesItem?.list ?? [];\n const valueLabels = uniqueValuesItem?.labels ?? {};\n const key = getKeyFromSelectedType({ type: name, value: source });\n if (\n chartTypesWithContinuousColors.has(chartType.value) && selectedSourceInfo.type === 'String' ||\n !chartTypesWithContinuousColors.has(chartType.value)\n ) {\n const mapping = (store.value.reactive.dataBindAes[source] ?? createDefaultMapping(uniqueValues)) as AestheticMappingCategorical;\n res[key] = {\n type: 'dataCategorical',\n value: key,\n initialData: mapping,\n inputName: name,\n selectedSource: source,\n selectedSourceInfo,\n selectedSourceValues: uniqueValues,\n labels: mapping.order.reduce(\n (res: Record<string, string>, v: string | number) => {\n res[v] = valueLabels[v] ?? String(v);\n return res;\n },\n {}\n )\n };\n } else {\n const mapping = (store.value.reactive.dataBindAes[source] ?? createContinuousMappingFromPalette(DEFAULT_CONTINUOUS_PALETTE)) as AestheticMappingContinuous;\n res[key] = {\n type: 'dataContinuous',\n value: key,\n initialData: mapping,\n inputName: name,\n selectedSource: source,\n selectedSourceInfo,\n selectedSourceValues: uniqueValues\n };\n }\n }\n\n possibleAesSourceInputs.forEach((name) => {\n if (inputStateMap?.[name]?.selectorStates.length) {\n inputStateMap[name].selectorStates.forEach(({ selectedSource }) => {\n addInfo(name, selectedSource);\n });\n }\n });\n\n if (!props.withoutFixed) {\n res['fix'] = {\n type: 'fix',\n value: 'fix',\n initialData: isMappedAes(props.selected)\n ? DEFAULT_BY_TYPES[props.type]\n : props.selected\n };\n }\n return res;\n});\n\nconst option = computed<AesOption | null>(\n () => optionsInfo.value[selectedType.value] ?? null\n);\n\nfunction getTitle(option: AesOption, selected: string) {\n if (option.type === 'fix') {\n return 'Fixed';\n }\n if (selected === option.value) {\n return `${option.selectedSourceInfo?.label}`;\n }\n if (chartType.value === 'discrete') {\n return `${\n option.value === 'primaryGrouping' ? 'Primary' : 'Secondary'\n } grouping: ${option.selectedSourceInfo?.label}`;\n }\n if (chartType.value === 'scatterplot' || chartType.value === 'dendro') {\n return `Grouping: ${option.selectedSourceInfo?.label}`;\n }\n return option.selectedSourceInfo?.label ?? '';\n}\n\nconst typeOptions = computed(() => {\n const options = [];\n const inputStateMap = store.value.reactive.optionsState.components;\n\n function addOption(name: string, source: string) {\n const key = getKeyFromSelectedType({\n type: name === 'shape' ? 'grouping' : name,\n value: source\n });\n if (optionsInfo.value[key]) {\n options.push({\n text: getTitle(optionsInfo.value[key], selectedType.value),\n value: key\n });\n }\n }\n\n possibleAesSourceInputs.forEach((name) => {\n if (inputStateMap?.[name]?.selectorStates.length) {\n inputStateMap[name].selectorStates.forEach(({ selectedSource }) => {\n addOption(name, selectedSource);\n });\n }\n });\n if (!optionsInfo.value[selectedType.value]) {\n let text = 'Not consistent (grouping)';\n if (chartType.value === 'discrete') {\n text = `${\n selectedType.value === 'primaryGrouping' ? 'Primary' : 'Secondary'\n } grouping (not selected)`;\n }\n options.push({ text, value: selectedType.value });\n }\n if (!props.withoutFixed) {\n options.push({ text: 'Fixed', value: 'fix' });\n }\n return options;\n});\n\nconst openForm = ref(false);\n\nconst defaultFixed = ref(\n optionsInfo.value['fix']\n ? (optionsInfo.value['fix'].initialData as string)\n : null\n);\nconst defaultMappingCategorical = ref(\n option.value?.type === 'dataCategorical'\n ? (option.value.initialData as AestheticMappingCategorical)\n : null\n);\n\nconst defaultMappingContinuous = ref(\n option.value?.type === 'dataContinuous'\n ? (option.value.initialData as AestheticMappingContinuous)\n : null\n);\nwatch(\n () => selectedType.value,\n (value) => {\n const option = optionsInfo.value[value];\n if (option.type === 'fix') {\n emit('aes-update', defaultFixed.value, option);\n } else if (option.type === 'dataCategorical') {\n defaultMappingCategorical.value = option.initialData;\n emit('aes-update', option.initialData, option);\n } else if (option.type === 'dataContinuous') {\n defaultMappingContinuous.value = option.initialData;\n emit('aes-update', option.initialData, option);\n }\n }\n);\n\nconst aesButtonRef = ref();\n\n//TODO: move to utils\nconst popupHeight = computed(() => {\n if (props.type === 'lineType') {\n const ROW_HEIGHT = 32;\n const OFFSET = 16;\n return FIXED_LINE_TYPES.length * ROW_HEIGHT + OFFSET * 2;\n }\n if (props.type === 'dotShape') {\n const ROW_HEIGHT = 36;\n const OFFSET = 20;\n return Math.ceil(FIXES_DOT_SHAPES.length / 6) * ROW_HEIGHT + OFFSET * 2;\n }\n if (props.type === 'fill' || props.type === 'stroke') {\n const ROW_HEIGHT = 36;\n const OFFSET = 20;\n return Math.ceil(FIXED_COLORS.length / 6) * ROW_HEIGHT + OFFSET * 2;\n }\n});\n\n</script>\n\n<template>\n <div class=\"aes-input-row\">\n <div class=\"aes-input-select\" @click.stop>\n <pl-dropdown\n :disabled=\"disabled || typeOptions.length < 2\"\n :label=\"label\"\n :options=\"typeOptions\"\n v-model=\"selectedType\"\n />\n </div>\n <aes-button\n :data=\"{\n type: selectedType === 'fix' ? type : 'data',\n value: selectedType === 'fix' ? type === 'size' ? Number(selected) : selected as string : null\n } as AesButtonProps['data']\"\n @click=\"openForm = !openForm\"\n @ref=\"(el:Element) => (aesButtonRef = el)\"\n />\n <popup\n v-if=\"selectedType === 'fix' && openForm && defaultFixed\"\n :height=\"popupHeight\"\n :targetRef=\"aesButtonRef\"\n @popup:close=\"openForm = false\"\n >\n <div\n class=\"fixed-aes-list\"\n :class=\"{ 'fixed-aes-list__rows': type === 'lineType' }\"\n >\n <fixed-colors-list\n v-if=\"type === 'fill' || type === 'stroke'\"\n :color-using=\"type\"\n v-model=\"defaultFixed\"\n @update:modelValue=\"\n (value:string) => $emit('aes-update', value, optionsInfo['fix'])\n \"\n />\n <fixed-dot-shape-list\n v-if=\"type === 'dotShape'\"\n v-model=\"defaultFixed\"\n @update:modelValue=\"\n (value:DotShape) => $emit('aes-update', value, optionsInfo['fix'])\n \"\n />\n <fixed-line-type-list\n v-if=\"type === 'lineType'\"\n v-model=\"defaultFixed\"\n @update:modelValue=\"\n (value:LineType) => $emit('aes-update', value, optionsInfo['fix'])\n \"\n />\n </div>\n </popup>\n </div>\n <template v-if=\"(\n (option?.type === 'dataCategorical' && defaultMappingCategorical) ||\n (option?.type === 'dataContinuous' && defaultMappingContinuous)) && openForm\">\n <form-wrapper\n :title=\"formTitle\"\n :back-title=\"formBackTitle\"\n @form:close=\"openForm = false\"\n >\n <aes-data-mapping-discrete\n v-if=\"option?.type === 'dataCategorical' && defaultMappingCategorical\"\n :column-value-labels=\"option.labels\"\n :data-column-label=\"option.selectedSourceInfo?.label ?? ''\"\n :used-aes-in-mapping=\"usedAesInMapping[option.selectedSource]\"\n :allow-hiding=\"chartType === 'discrete'\"\n :allow-reordering=\"chartType === 'discrete' || chartType === 'histogram' || chartType === 'scatterplot' || chartType === 'scatterplot-umap'\"\n :allow-null-option=\"chartType === 'discrete' && (\n selectedType === 'primaryGrouping' && store.reactive.axesSettings.axisX.allowNullPrimaryGroups ||\n selectedType === 'secondaryGrouping' && store.reactive.axesSettings.axisX.allowNullSecondaryGroups\n ) || chartType === 'scatterplot' || chartType === 'scatterplot-umap'\"\n v-model=\"defaultMappingCategorical\"\n @update:modelValue=\"(value:AestheticMappingCategorical) => $emit('aes-update', value, option)\"\n />\n <aes-data-mapping-continuous\n v-if=\"option?.type === 'dataContinuous' && defaultMappingContinuous\"\n :data-column-label=\"option.selectedSourceInfo?.label ?? ''\"\n v-model=\"defaultMappingContinuous\"\n @update:modelValue=\"(value:AestheticMappingContinuous) => $emit('aes-update', value, option)\"\n />\n </form-wrapper>\n </template>\n</template>\n"],"names":["props","__props","store","useStore","chartType","computed","emit","__emit","DEFAULT_AES_INPUTS","possibleAesSourceInputs","usedAesInMapping","getKeyFromSelectedType","value","selectedType","ref","isMappedAes","DEFAULT_BY_TYPES","FIXED_COLORS","DEFAULT_DOT_SHAPE","DEFAULT_LINE_TYPE","inputGuide","labelsInfo","chartTypesWithContinuousColors","optionsInfo","res","inputStateMap","addInfo","name","source","selectedSourceInfo","uniqueValuesItem","uniqueValues","valueLabels","key","mapping","createDefaultMapping","v","createContinuousMappingFromPalette","DEFAULT_CONTINUOUS_PALETTE","_a","selectedSource","option","getTitle","selected","typeOptions","options","addOption","text","openForm","defaultFixed","defaultMappingCategorical","defaultMappingContinuous","_b","watch","aesButtonRef","popupHeight","FIXED_LINE_TYPES","FIXES_DOT_SHAPES","_createElementVNode","_hoisted_1","_createVNode","_unref","PlDropdown","$event","AesButton","_cache","el","_createBlock","Popup","_normalizeClass","FixedColorsList","$emit","FixedDotShapeList","FixedLineTypeList","FormWrapper","AesDataMappingDiscrete","_c","AesDataMappingContinuous","_d"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,UAAMA,IAAQC,GAWRC,IAAQC,GAAA,GACRC,IAAYC,EAAS,MAAMH,EAAM,MAAM,SAAS,SAAS,GAC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AAc;AAAA,gBAC3D,gBAAcrC,EAAA,UAAS;AAAA,gBACvB,oBAAkBA,EAAA,UAAS,cAAmBA,YAAS,eAAoBA,EAAA,2BAA+BA,EAAA,UAAS;AAAA,gBACnH,qBAAmBA,EAAA,UAAS,eAA+BS,EAAA,UAAY,qBAA0BgD,KAAM,SAAS,aAAa,MAAM,0BAAoChD,EAAA,UAAY,uBAA4BgD,KAAM,SAAS,aAAa,MAAM,6BAAsCzD,EAAA,2BAA+BA,EAAA,UAAS;AAAA,4BAIvT8C,EAAA;AAAA;2CAAAA,EAAyB,QAAAa;AAAA,kBACbE,EAAA,EAAA,MAAAA,EAAA,EAAA,IAAA,CAAArD,MAAsC2D,EAAAA,MAAK,cAAe3D,GAAO6B,EAAA,KAAM;AAAA,gBAAA;AAAA;gBAGtFmC,IAAAnC,EAAA,UAAA,gBAAAmC,EAAQ,UAAI,oBAAyBzB,EAAA,cAD7CgB,EAKEU,IAAA;AAAA;gBAHC,uBAAmBC,IAAArC,EAAA,MAAO,uBAAP,gBAAAqC,EAA2B,UAAK;AAAA,4BAC3C3B,EAAA;AAAA;2CAAAA,EAAwB,QAAAY;AAAA,kBACZE,EAAA,EAAA,MAAAA,EAAA,EAAA,IAAA,CAAArD,MAAqC2D,EAAAA,MAAK,cAAe3D,GAAO6B,EAAA,KAAM;AAAA,gBAAA;AAAA;;;;;;;;;"}
1
+ {"version":3,"file":"AesSelector.vue.js","sources":["../../../src/forms/LayersForm/AesSelector.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ref, computed, watch } from 'vue';\nimport { PlDropdown } from '@platforma-sdk/ui-vue';\nimport type {\n AestheticMappingCategorical, AestheticMappingContinuous } from '../../dataBindAes';\nimport { createContinuousMappingFromPalette,\n createDefaultMapping,\n} from '../../dataBindAes';\nimport type {\n AesOption,\n DotShape,\n LineType,\n} from '../../components/AesSettings/types';\nimport {\n DEFAULT_CONTINUOUS_PALETTE,\n DEFAULT_DOT_SHAPE,\n DEFAULT_LINE_TYPE,\n FIXED_COLORS,\n FIXED_LINE_TYPES,\n FIXES_DOT_SHAPES,\n} from '../../constantsAesthetic';\nimport AesButton, { type AesButtonProps } from '../../components/AesButton.vue';\nimport { useStore } from '../../store';\nimport type { AesType, MappingLink } from '../../constantsCommon';\nimport { isMappedAes } from '../../constantsCommon';\nimport Popup from '../../components/Popup.vue';\nimport FixedColorsList from '../../components/AesSettings/FixedColorsList.vue';\nimport FixedDotShapeList from '../../components/AesSettings/FixedDotShapeList.vue';\nimport FixedLineTypeList from '../../components/AesSettings/FixedLineTypeList.vue';\nimport FormWrapper from '../../components/AesSettings/FormWrapper.vue';\nimport AesDataMappingDiscrete from '../../components/AesSettings/AesDataMappingDiscrete.vue';\nimport AesDataMappingContinuous from '../../components/AesSettings/AesDataMappingContinuous.vue';\nimport type { ChartType } from '@milaboratories/pf-plots';\n\nconst props = defineProps<{\n label: string;\n type: AesType;\n selected: string | MappingLink;\n formTitle: string;\n formBackTitle: string;\n possibleAesSourceInputs?: string[];\n withoutFixed?: boolean;\n disabled?: boolean;\n}>();\n\nconst store = useStore();\nconst chartType = computed(() => store.value.reactive.chartType);\nconst emit = defineEmits(['aes-update', 'aes-selector-close']);\n\nconst DEFAULT_AES_INPUTS: Record<ChartType, string[]> = {\n 'discrete': ['primaryGrouping', 'secondaryGrouping'],\n 'scatterplot': ['grouping'],\n 'scatterplot-umap': ['grouping'],\n 'dendro': [],\n 'heatmap': [],\n 'histogram': ['grouping'],\n 'bubble': [],\n};\nconst possibleAesSourceInputs = props.possibleAesSourceInputs ?? DEFAULT_AES_INPUTS[chartType.value];\nconst usedAesInMapping = computed(\n () => {\n const v = store.value.commonHelpersData.usedAesInMapping.value;\n return v;\n },\n);\n\nfunction getKeyFromSelectedType(value: MappingLink | string) {\n if (typeof value === 'string') {\n return value;\n }\n if (chartType.value === 'scatterplot') {\n return `grouping_${value.value}`;\n }\n if (chartType.value === 'dendro') {\n return `${value.type}_${value.value}`;\n }\n return value.type;\n}\n\nconst selectedType = ref(\n isMappedAes(props.selected) ? getKeyFromSelectedType(props.selected) : 'fix',\n);\nconst DEFAULT_BY_TYPES: Record<AesType, string | DotShape | LineType> = {\n fill: FIXED_COLORS[0].color,\n stroke: FIXED_COLORS[0].color,\n dotShape: DEFAULT_DOT_SHAPE,\n lineType: DEFAULT_LINE_TYPE,\n size: '', // temporary\n};\n\nconst inputGuide = computed(() => store.value.inputGuide.value);\nconst labelsInfo = computed(() => store.value.uniqueValuesData.value);\n\nconst chartTypesWithContinuousColors = new Set<ChartType>([\n 'scatterplot', 'scatterplot-umap', 'heatmap',\n]);\n\nconst optionsInfo = computed(() => {\n const res: Record<string, AesOption> = {};\n const inputStateMap = store.value.reactive.optionsState.components;\n\n function addInfo(name: string, source: string) {\n const selectedSourceInfo = inputGuide.value.getSourceInfo(source);\n const uniqueValuesItem = labelsInfo.value[source];\n const uniqueValues = uniqueValuesItem?.list ?? [];\n const valueLabels = uniqueValuesItem?.labels ?? {};\n const key = getKeyFromSelectedType({ type: name, value: source });\n if (\n (chartTypesWithContinuousColors.has(chartType.value) && selectedSourceInfo.type === 'String')\n || !chartTypesWithContinuousColors.has(chartType.value)\n ) {\n const mapping = (store.value.reactive.dataBindAes[source] ?? createDefaultMapping(uniqueValues)) as AestheticMappingCategorical;\n res[key] = {\n type: 'dataCategorical',\n value: key,\n initialData: mapping,\n inputName: name,\n selectedSource: source,\n selectedSourceInfo,\n selectedSourceValues: uniqueValues,\n labels: mapping.order.reduce(\n (res: Record<string, string>, v: string | number) => {\n res[v] = valueLabels[v] ?? String(v);\n return res;\n },\n {},\n ),\n };\n } else {\n const mapping = (store.value.reactive.dataBindAes[source] ?? createContinuousMappingFromPalette(DEFAULT_CONTINUOUS_PALETTE)) as AestheticMappingContinuous;\n res[key] = {\n type: 'dataContinuous',\n value: key,\n initialData: mapping,\n inputName: name,\n selectedSource: source,\n selectedSourceInfo,\n selectedSourceValues: uniqueValues,\n };\n }\n }\n\n possibleAesSourceInputs.forEach((name) => {\n if (inputStateMap?.[name]?.selectorStates.length) {\n inputStateMap[name].selectorStates.forEach(({ selectedSource }) => {\n addInfo(name, selectedSource);\n });\n }\n });\n\n if (!props.withoutFixed) {\n res['fix'] = {\n type: 'fix',\n value: 'fix',\n initialData: isMappedAes(props.selected)\n ? DEFAULT_BY_TYPES[props.type]\n : props.selected,\n };\n }\n return res;\n});\n\nconst option = computed<AesOption | null>(\n () => optionsInfo.value[selectedType.value] ?? null,\n);\n\nfunction getTitle(option: AesOption, selected: string) {\n if (option.type === 'fix') {\n return 'Fixed';\n }\n if (selected === option.value) {\n return `${option.selectedSourceInfo?.label}`;\n }\n if (chartType.value === 'discrete') {\n return `${\n option.value === 'primaryGrouping' ? 'Primary' : 'Secondary'\n } grouping: ${option.selectedSourceInfo?.label}`;\n }\n if (chartType.value === 'scatterplot' || chartType.value === 'dendro') {\n return `Grouping: ${option.selectedSourceInfo?.label}`;\n }\n return option.selectedSourceInfo?.label ?? '';\n}\n\nconst typeOptions = computed(() => {\n const options = [];\n const inputStateMap = store.value.reactive.optionsState.components;\n\n function addOption(name: string, source: string) {\n const key = getKeyFromSelectedType({\n type: name === 'shape' ? 'grouping' : name,\n value: source,\n });\n if (optionsInfo.value[key]) {\n options.push({\n text: getTitle(optionsInfo.value[key], selectedType.value),\n value: key,\n });\n }\n }\n\n possibleAesSourceInputs.forEach((name) => {\n if (inputStateMap?.[name]?.selectorStates.length) {\n inputStateMap[name].selectorStates.forEach(({ selectedSource }) => {\n addOption(name, selectedSource);\n });\n }\n });\n if (!optionsInfo.value[selectedType.value]) {\n let text = 'Not consistent (grouping)';\n if (chartType.value === 'discrete') {\n text = `${\n selectedType.value === 'primaryGrouping' ? 'Primary' : 'Secondary'\n } grouping (not selected)`;\n }\n options.push({ text, value: selectedType.value });\n }\n if (!props.withoutFixed) {\n options.push({ text: 'Fixed', value: 'fix' });\n }\n return options;\n});\n\nconst openForm = ref(false);\n\nconst defaultFixed = ref(\n optionsInfo.value['fix']\n ? (optionsInfo.value['fix'].initialData as string)\n : null,\n);\nconst defaultMappingCategorical = ref(\n option.value?.type === 'dataCategorical'\n ? (option.value.initialData as AestheticMappingCategorical)\n : null,\n);\n\nconst defaultMappingContinuous = ref(\n option.value?.type === 'dataContinuous'\n ? (option.value.initialData as AestheticMappingContinuous)\n : null,\n);\nwatch(\n () => selectedType.value,\n (value) => {\n const option = optionsInfo.value[value];\n if (option.type === 'fix') {\n emit('aes-update', defaultFixed.value, option);\n } else if (option.type === 'dataCategorical') {\n defaultMappingCategorical.value = option.initialData;\n emit('aes-update', option.initialData, option);\n } else if (option.type === 'dataContinuous') {\n defaultMappingContinuous.value = option.initialData;\n emit('aes-update', option.initialData, option);\n }\n },\n);\n\nconst aesButtonRef = ref();\n\n// TODO: move to utils\nconst popupHeight = computed(() => {\n if (props.type === 'lineType') {\n const ROW_HEIGHT = 32;\n const OFFSET = 16;\n return FIXED_LINE_TYPES.length * ROW_HEIGHT + OFFSET * 2;\n }\n if (props.type === 'dotShape') {\n const ROW_HEIGHT = 36;\n const OFFSET = 20;\n return Math.ceil(FIXES_DOT_SHAPES.length / 6) * ROW_HEIGHT + OFFSET * 2;\n }\n if (props.type === 'fill' || props.type === 'stroke') {\n const ROW_HEIGHT = 36;\n const OFFSET = 20;\n return Math.ceil(FIXED_COLORS.length / 6) * ROW_HEIGHT + OFFSET * 2;\n }\n return 0;\n});\n\n</script>\n\n<template>\n <div class=\"aes-input-row\">\n <div class=\"aes-input-select\" @click.stop>\n <PlDropdown\n v-model=\"selectedType\"\n :disabled=\"disabled || typeOptions.length < 2\"\n :label=\"label\"\n :options=\"typeOptions\"\n />\n </div>\n <AesButton\n :data=\"{\n type: selectedType === 'fix' ? type : 'data',\n value: selectedType === 'fix' ? type === 'size' ? Number(selected) : selected as string : null\n } as AesButtonProps['data']\"\n @click=\"openForm = !openForm\"\n @ref=\"(el:Element) => (aesButtonRef = el)\"\n />\n <Popup\n v-if=\"selectedType === 'fix' && openForm && defaultFixed\"\n :height=\"popupHeight\"\n :targetRef=\"aesButtonRef\"\n @popup:close=\"openForm = false\"\n >\n <div\n class=\"fixed-aes-list\"\n :class=\"{ 'fixed-aes-list__rows': type === 'lineType' }\"\n >\n <FixedColorsList\n v-if=\"type === 'fill' || type === 'stroke'\"\n v-model=\"defaultFixed\"\n :color-using=\"type\"\n @update:modelValue=\"\n (value:string) => $emit('aes-update', value, optionsInfo['fix'])\n \"\n />\n <FixedDotShapeList\n v-if=\"type === 'dotShape'\"\n v-model=\"defaultFixed\"\n @update:modelValue=\"\n (value:DotShape) => $emit('aes-update', value, optionsInfo['fix'])\n \"\n />\n <FixedLineTypeList\n v-if=\"type === 'lineType'\"\n v-model=\"defaultFixed\"\n @update:modelValue=\"\n (value:LineType) => $emit('aes-update', value, optionsInfo['fix'])\n \"\n />\n </div>\n </Popup>\n </div>\n <template\n v-if=\"(\n (option?.type === 'dataCategorical' && defaultMappingCategorical) ||\n (option?.type === 'dataContinuous' && defaultMappingContinuous)) && openForm\"\n >\n <FormWrapper\n :title=\"formTitle\"\n :back-title=\"formBackTitle\"\n @form:close=\"openForm = false\"\n >\n <AesDataMappingDiscrete\n v-if=\"option?.type === 'dataCategorical' && defaultMappingCategorical\"\n v-model=\"defaultMappingCategorical\"\n :column-value-labels=\"option.labels\"\n :data-column-label=\"option.selectedSourceInfo?.label ?? ''\"\n :used-aes-in-mapping=\"usedAesInMapping[option.selectedSource]\"\n :allow-hiding=\"chartType === 'discrete'\"\n :allow-reordering=\"chartType === 'discrete' || chartType === 'histogram' || chartType === 'scatterplot' || chartType === 'scatterplot-umap'\"\n :allow-null-option=\"chartType === 'discrete' && (\n selectedType === 'primaryGrouping' && store.reactive.axesSettings.axisX.allowNullPrimaryGroups ||\n selectedType === 'secondaryGrouping' && store.reactive.axesSettings.axisX.allowNullSecondaryGroups\n ) || chartType === 'scatterplot' || chartType === 'scatterplot-umap'\"\n @update:modelValue=\"(value:AestheticMappingCategorical) => $emit('aes-update', value, option)\"\n />\n <AesDataMappingContinuous\n v-if=\"option?.type === 'dataContinuous' && defaultMappingContinuous\"\n v-model=\"defaultMappingContinuous\"\n :data-column-label=\"option.selectedSourceInfo?.label ?? ''\"\n @update:modelValue=\"(value:AestheticMappingContinuous) => $emit('aes-update', value, option)\"\n />\n </FormWrapper>\n </template>\n</template>\n"],"names":["props","__props","store","useStore","chartType","computed","emit","__emit","DEFAULT_AES_INPUTS","possibleAesSourceInputs","usedAesInMapping","getKeyFromSelectedType","value","selectedType","ref","isMappedAes","DEFAULT_BY_TYPES","FIXED_COLORS","DEFAULT_DOT_SHAPE","DEFAULT_LINE_TYPE","inputGuide","labelsInfo","chartTypesWithContinuousColors","optionsInfo","res","inputStateMap","addInfo","name","source","selectedSourceInfo","uniqueValuesItem","uniqueValues","valueLabels","key","mapping","createDefaultMapping","v","createContinuousMappingFromPalette","DEFAULT_CONTINUOUS_PALETTE","_a","selectedSource","option","getTitle","selected","typeOptions","options","addOption","text","openForm","defaultFixed","defaultMappingCategorical","defaultMappingContinuous","_b","watch","aesButtonRef","popupHeight","FIXED_LINE_TYPES","FIXES_DOT_SHAPES","_createElementVNode","_hoisted_1","_createVNode","_unref","PlDropdown","$event","AesButton","_cache","el","_createBlock","Popup","_normalizeClass","FixedColorsList","$emit","FixedDotShapeList","FixedLineTypeList","FormWrapper","AesDataMappingDiscrete","_c","AesDataMappingContinuous","_d"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,UAAMA,IAAQC,GAWRC,IAAQC,GAAA,GACRC,IAAYC,EAAS,MAAMH,EAAM,MAAM,SAAS,SAAS,GACzDI,IAAOC,GAEPC,IAAkD;AAAA,MACtD,UAAY,CAAC,mBAAmB,mBAAmB;AAAA,MACnD,aAAe,CAAC,UAAU;AAAA,MAC1B,oBAAoB,CAAC,UAAU;AAAA,MAC/B,QAAU,CAAA;AAAA,MACV,SAAW,CAAA;AAAA,MACX,WAAa,CAAC,UAAU;AAAA,MACxB,QAAU,CAAA;AAAA,IAAC,GAEPC,IAA0BT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AA,gBACnH,qBAAmBA,EAAA,UAAS,eAA+BS,EAAA,UAAY,qBAA0BgD,KAAM,SAAS,aAAa,MAAM,0BAAoChD,EAAA,UAAY,uBAA4BgD,KAAM,SAAS,aAAa,MAAM,6BAAsCzD,EAAA,2BAA+BA,EAAA,UAAS;AAAA,cAAA;gBAO1TwE,IAAAnC,EAAA,UAAA,gBAAAmC,EAAQ,UAAI,oBAAyBzB,EAAA,cAD7CgB,EAKEU,IAAA;AAAA;4BAHS1B,EAAA;AAAA;2CAAAA,EAAwB,QAAAY;AAAA,kBAEZE,EAAA,EAAA,MAAAA,EAAA,EAAA,IAAA,CAAArD,MAAqC2D,EAAAA,MAAK,cAAe3D,GAAO6B,EAAA,KAAM;AAAA,gBAAA;AAAA,gBAD1F,uBAAmBqC,IAAArC,EAAA,MAAO,uBAAP,gBAAAqC,EAA2B,UAAK;AAAA,cAAA;;;;;;;;;"}
@@ -12,7 +12,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
12
12
  "onAes-update"?: ((...args: any[]) => any) | undefined;
13
13
  "onAes-selector-close"?: ((...args: any[]) => any) | undefined;
14
14
  }>, {
15
+ selected: number | ContinuousDataMappingSize;
15
16
  min: number;
16
17
  max: number;
18
+ possibleAesSourceInputs: string[];
17
19
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
18
20
  export default _default;
@@ -6,14 +6,14 @@ import { isContinuousDataMapping as S } from "../../constantsCommon.js";
6
6
  const C = { class: "dot-size-selector" }, L = { class: "dot-size-selector__row" }, O = { class: "dot-size-selector-row" }, j = /* @__PURE__ */ U({
7
7
  __name: "DotSizeSelector",
8
8
  props: {
9
- selected: {},
9
+ selected: { default: void 0 },
10
10
  min: { default: 3 },
11
11
  max: { default: 10 },
12
- possibleAesSourceInputs: {}
12
+ possibleAesSourceInputs: { default: void 0 }
13
13
  },
14
14
  emits: ["aes-update", "aes-selector-close"],
15
15
  setup(s, { emit: h }) {
16
- const o = s, r = B(), m = p(() => r.value.reactive.chartType), i = h, k = {
16
+ const o = s, r = B(), d = p(() => r.value.reactive.chartType), i = h, k = {
17
17
  discrete: ["primaryGrouping", "secondaryGrouping"],
18
18
  scatterplot: ["size"],
19
19
  "scatterplot-umap": ["size"],
@@ -21,21 +21,21 @@ const C = { class: "dot-size-selector" }, L = { class: "dot-size-selector__row"
21
21
  heatmap: [],
22
22
  histogram: [],
23
23
  bubble: []
24
- }, y = o.possibleAesSourceInputs ?? k[m.value], l = v(
24
+ }, y = o.possibleAesSourceInputs ?? k[d.value], l = v(
25
25
  S(o.selected) ? o.selected.column : "fix"
26
26
  ), V = p(() => r.value.inputGuide.value);
27
27
  function A(t) {
28
28
  const e = V.value.getSourceInfo(t);
29
- return m.value === "scatterplot" || m.value === "dendro" ? `Grouping: ${e == null ? void 0 : e.label}` : e ? (e == null ? void 0 : e.label) ?? "" : "Not consistent (grouping)";
29
+ return d.value === "scatterplot" || d.value === "dendro" ? `Grouping: ${e == null ? void 0 : e.label}` : e ? (e == null ? void 0 : e.label) ?? "" : "Not consistent (grouping)";
30
30
  }
31
- const c = p(() => {
31
+ const m = p(() => {
32
32
  const t = [], e = r.value.reactive.optionsState.components;
33
33
  return y.forEach((a) => {
34
34
  var D;
35
- (D = e == null ? void 0 : e[a]) != null && D.selectorStates.length && e[a].selectorStates.forEach(({ selectedSource: d }) => {
36
- V.value.getSourceInfo(d).type !== "String" && t.push({
37
- text: A(d),
38
- value: d
35
+ (D = e == null ? void 0 : e[a]) != null && D.selectorStates.length && e[a].selectorStates.forEach(({ selectedSource: c }) => {
36
+ V.value.getSourceInfo(c).type !== "String" && t.push({
37
+ text: A(c),
38
+ value: c
39
39
  });
40
40
  });
41
41
  }), t.length ? t : [{ text: "Fixed", value: "fix" }];
@@ -77,33 +77,33 @@ const C = { class: "dot-size-selector" }, L = { class: "dot-size-selector__row"
77
77
  }, ["stop"]))
78
78
  }, [
79
79
  w(b(N), {
80
- disabled: c.value.length < 2 && c.value[0].value === l.value,
81
- label: "Dot size source",
82
- options: c.value,
83
80
  modelValue: l.value,
84
- "onUpdate:modelValue": e[0] || (e[0] = (a) => l.value = a)
85
- }, null, 8, ["disabled", "options", "modelValue"])
81
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => l.value = a),
82
+ disabled: m.value.length < 2 && m.value[0].value === l.value,
83
+ label: "Dot size source",
84
+ options: m.value
85
+ }, null, 8, ["modelValue", "disabled", "options"])
86
86
  ])
87
87
  ]),
88
88
  g("div", O, [
89
89
  l.value !== "fix" ? (x(), E(b(F), {
90
90
  key: 0,
91
+ modelValue: n.value,
92
+ "onUpdate:modelValue": e[2] || (e[2] = (a) => n.value = a),
91
93
  min: s.min,
92
94
  max: s.max,
93
95
  breakpoints: !0,
94
- label: "Dot size range",
95
- modelValue: n.value,
96
- "onUpdate:modelValue": e[2] || (e[2] = (a) => n.value = a)
97
- }, null, 8, ["min", "max", "modelValue"])) : (x(), E(b(_), {
96
+ label: "Dot size range"
97
+ }, null, 8, ["modelValue", "min", "max"])) : (x(), E(b(_), {
98
98
  key: 1,
99
+ modelValue: u.value,
100
+ "onUpdate:modelValue": e[3] || (e[3] = (a) => u.value = a),
99
101
  min: s.min,
100
102
  max: s.max,
101
103
  step: 1,
102
104
  breakpoints: !0,
103
- label: "Dot size",
104
- modelValue: u.value,
105
- "onUpdate:modelValue": e[3] || (e[3] = (a) => u.value = a)
106
- }, null, 8, ["min", "max", "modelValue"]))
105
+ label: "Dot size"
106
+ }, null, 8, ["modelValue", "min", "max"]))
107
107
  ])
108
108
  ]));
109
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DotSizeSelector.vue.js","sources":["../../../src/forms/LayersForm/DotSizeSelector.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ref, computed, watch } from 'vue';\nimport { PlDropdown, Slider, SliderRange } from '@platforma-sdk/ui-vue';\nimport { DEFAULT_DOT_RANGE, DEFAULT_DOT_SIZE } from '../../dataBindAes';\nimport { useStore } from '../../store';\nimport { ContinuousDataMappingSize, isContinuousDataMapping } from '../../constantsCommon';\nimport { ChartType } from '@milaboratories/pf-plots';\n\nconst props = withDefaults(defineProps<{\n selected?: number | ContinuousDataMappingSize;\n min?: number;\n max?: number;\n possibleAesSourceInputs?: string[];\n}>(), {min: 3, max: 10});\n\nconst store = useStore();\nconst chartType = computed(() => store.value.reactive.chartType);\nconst emit = defineEmits(['aes-update', 'aes-selector-close']);\n\nconst DEFAULT_AES_INPUTS: Record<ChartType, string[]> = {\n discrete: ['primaryGrouping', 'secondaryGrouping'],\n scatterplot: ['size'],\n 'scatterplot-umap': ['size'],\n dendro: [],\n heatmap: [],\n histogram: [],\n bubble: []\n};\nconst possibleAesSourceInputs = props.possibleAesSourceInputs ?? DEFAULT_AES_INPUTS[chartType.value];\n\nconst selectedKey = ref(\n isContinuousDataMapping(props.selected) ? props.selected.column : 'fix'\n);\n\nconst inputGuide = computed(() => store.value.inputGuide.value);\n\nfunction getOptionTitle(selected: string) {\n const selectedSourceInfo = inputGuide.value.getSourceInfo(selected);\n\n if (chartType.value === 'scatterplot' || chartType.value === 'dendro') {\n return `Grouping: ${selectedSourceInfo?.label}`;\n }\n if (!selectedSourceInfo) {\n return 'Not consistent (grouping)';\n }\n return selectedSourceInfo?.label ?? '';\n}\n\nconst options = computed(() => {\n const options: { text: string, value: string }[] = [];\n const inputStateMap = store.value.reactive.optionsState.components;\n\n possibleAesSourceInputs.forEach((name) => {\n if (inputStateMap?.[name]?.selectorStates.length) {\n inputStateMap[name].selectorStates.forEach(({ selectedSource }) => {\n const selectedSourceInfo = inputGuide.value.getSourceInfo(selectedSource);\n if (selectedSourceInfo.type !== 'String') {\n options.push({\n text: getOptionTitle(selectedSource),\n value: selectedSource\n });\n }\n });\n }\n });\n return options.length ? options : [{ text: 'Fixed', value: 'fix' }];\n});\n\nconst fixedValue = ref(isContinuousDataMapping(props.selected) ? DEFAULT_DOT_SIZE : props.selected ?? DEFAULT_DOT_SIZE);\nconst rangeValue = ref<[number, number]>(isContinuousDataMapping(props.selected) ? [props.selected.range.min, props.selected.range.max] : [DEFAULT_DOT_RANGE.min, DEFAULT_DOT_RANGE.max]);\n\nwatch(\n () => selectedKey.value,\n (value) => {\n if (value === 'fix') {\n emit('aes-update', fixedValue.value);\n } else {\n const mapping = {\n column: value,\n range: { min: rangeValue.value[0], max: rangeValue.value[1] }\n } as ContinuousDataMappingSize;\n emit('aes-update', mapping);\n }\n }\n);\n\nwatch(\n () => fixedValue.value,\n (value) => {\n if (selectedKey.value === 'fix') {\n emit('aes-update', value);\n }\n }\n);\n\nwatch(\n () => rangeValue.value,\n (rangeV) => {\n if (selectedKey.value !== 'fix') {\n const mapping = {\n column: selectedKey.value,\n range: { min: rangeV[0], max: rangeV[1] }\n } as ContinuousDataMappingSize;\n emit('aes-update', mapping);\n }\n }\n);\n\n</script>\n\n<template>\n <div class=\"dot-size-selector\">\n <div class=\"dot-size-selector__row\">\n <div class=\"aes-input-select\" @click.stop>\n <pl-dropdown\n :disabled=\"options.length < 2 && options[0].value === selectedKey\"\n label=\"Dot size source\"\n :options=\"options\"\n v-model=\"selectedKey\"\n />\n </div>\n </div>\n <div class=\"dot-size-selector-row\">\n <SliderRange v-if=\"selectedKey !== 'fix'\"\n :min=\"min\"\n :max=\"max\"\n :breakpoints=\"true\"\n label=\"Dot size range\"\n v-model=\"rangeValue\"\n />\n <Slider v-else\n :min=\"min\"\n :max=\"max\"\n :step=\"1\"\n :breakpoints=\"true\"\n label=\"Dot size\"\n v-model=\"fixedValue\"\n />\n </div>\n </div>\n</template>\n<style>\n .dot-size-selector {\n margin-top: 24px\n }\n .dot-size-selector__row {\n margin: 12px 0;\n }\n</style>\n"],"names":["props","__props","store","useStore","chartType","computed","emit","__emit","DEFAULT_AES_INPUTS","possibleAesSourceInputs","selectedKey","ref","isContinuousDataMapping","inputGuide","getOptionTitle","selected","selectedSourceInfo","options","inputStateMap","name","_a","selectedSource","fixedValue","DEFAULT_DOT_SIZE","rangeValue","DEFAULT_DOT_RANGE","watch","value","mapping","rangeV","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_createVNode","_unref","PlDropdown","$event","_hoisted_3","_createBlock","SliderRange","Slider"],"mappings":";;;;;;;;;;;;;;;AAQA,UAAMA,IAAQC,GAORC,IAAQC,EAAA,GACRC,IAAYC,EAAS,MAAMH,EAAM,MAAM,SAAS,SAAS,GACzDI,IAAOC,GAEPC,IAAkD;AAAA,MACtD,UAAU,CAAC,mBAAmB,mBAAmB;AAAA,MACjD,aAAa,CAAC,MAAM;AAAA,MACpB,oBAAoB,CAAC,MAAM;AAAA,MAC3B,QAAQ,CAAA;AAAA,MACR,SAAS,CAAA;AAAA,MACT,WAAW,CAAA;AAAA,MACX,QAAQ,CAAA;AAAA,IAAC,GAELC,IAA0BT,EAAM,2BAA2BQ,EAAmBJ,EAAU,KAAK,GAE7FM,IAAcC;AAAA,MAClBC,EAAwBZ,EAAM,QAAQ,IAAIA,EAAM,SAAS,SAAS;AAAA,IAAA,GAG9Da,IAAaR,EAAS,MAAMH,EAAM,MAAM,WAAW,KAAK;AAE9D,aAASY,EAAeC,GAAkB;AACxC,YAAMC,IAAqBH,EAAW,MAAM,cAAcE,CAAQ;AAElE,aAAIX,EAAU,UAAU,iBAAiBA,EAAU,UAAU,WACpD,aAAaY,KAAA,gBAAAA,EAAoB,KAAK,KAE1CA,KAGEA,KAAA,gBAAAA,EAAoB,UAAS,KAF3B;AAAA,IAGX;AAEA,UAAMC,IAAUZ,EAAS,MAAM;AAC7B,YAAMY,IAA6C,CAAA,GAC7CC,IAAgBhB,EAAM,MAAM,SAAS,aAAa;AAExD,aAAAO,EAAwB,QAAQ,CAACU,MAAS;;AACxC,SAAIC,IAAAF,KAAA,gBAAAA,EAAgBC,OAAhB,QAAAC,EAAuB,eAAe,UACxCF,EAAcC,CAAI,EAAE,eAAe,QAAQ,CAAC,EAAE,gBAAAE,QAAqB;AAEjE,UAD2BR,EAAW,MAAM,cAAcQ,CAAc,E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,EAAA,GAAAC,EA4BM,OA5BNC,GA4BM;AAAA,MA3BJC,EASM,OATNC,GASM;AAAA,QARJD,EAOM,OAAA;AAAA,UAPD,OAAM;AAAA,UAAoB,2BAAD,MAAA;AAAA,UAAA,GAAW,CAAA,MAAA,CAAA;AAAA,QAAA;UACvCE,EAKEC,EAAAC,CAAA,GAAA;AAAA,YAJC,UAAUpB,QAAQ,cAAcA,EAAA,MAAO,CAAA,EAAI,UAAUP,EAAA;AAAA,YACtD,OAAM;AAAA,YACL,SAASO,EAAA;AAAA,wBACDP,EAAA;AAAA,0DAAAA,EAAW,QAAA4B;AAAA,UAAA;;;MAI1BL,EAgBM,OAhBNM,GAgBM;AAAA,QAfe7B,EAAA,UAAW,cAA9B8B,EAMEJ,EAAAK,CAAA,GAAA;AAAA;UALY,KAAKxC,EAAA;AAAA,UACL,KAAKA,EAAA;AAAA,UACL,aAAa;AAAA,UACd,OAAM;AAAA,sBACGuB,EAAA;AAAA,wDAAAA,EAAU,QAAAc;AAAA,QAAA,mDAEhCE,EAOEJ,EAAAM,CAAA,GAAA;AAAA;UANO,KAAKzC,EAAA;AAAA,UACL,KAAKA,EAAA;AAAA,UACL,MAAM;AAAA,UACN,aAAa;AAAA,UACd,OAAM;AAAA,sBACGqB,EAAA;AAAA,wDAAAA,EAAU,QAAAgB;AAAA,QAAA;;;;;"}
1
+ {"version":3,"file":"DotSizeSelector.vue.js","sources":["../../../src/forms/LayersForm/DotSizeSelector.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ref, computed, watch } from 'vue';\nimport { PlDropdown, Slider, SliderRange } from '@platforma-sdk/ui-vue';\nimport { DEFAULT_DOT_RANGE, DEFAULT_DOT_SIZE } from '../../dataBindAes';\nimport { useStore } from '../../store';\nimport type { ContinuousDataMappingSize } from '../../constantsCommon';\nimport { isContinuousDataMapping } from '../../constantsCommon';\nimport type { ChartType } from '@milaboratories/pf-plots';\n\nconst props = withDefaults(defineProps<{\n selected?: number | ContinuousDataMappingSize;\n min?: number;\n max?: number;\n possibleAesSourceInputs?: string[];\n}>(), { selected: undefined, min: 3, max: 10, possibleAesSourceInputs: undefined });\n\nconst store = useStore();\nconst chartType = computed(() => store.value.reactive.chartType);\nconst emit = defineEmits(['aes-update', 'aes-selector-close']);\n\nconst DEFAULT_AES_INPUTS: Record<ChartType, string[]> = {\n 'discrete': ['primaryGrouping', 'secondaryGrouping'],\n 'scatterplot': ['size'],\n 'scatterplot-umap': ['size'],\n 'dendro': [],\n 'heatmap': [],\n 'histogram': [],\n 'bubble': [],\n};\nconst possibleAesSourceInputs = props.possibleAesSourceInputs ?? DEFAULT_AES_INPUTS[chartType.value];\n\nconst selectedKey = ref(\n isContinuousDataMapping(props.selected) ? props.selected.column : 'fix',\n);\n\nconst inputGuide = computed(() => store.value.inputGuide.value);\n\nfunction getOptionTitle(selected: string) {\n const selectedSourceInfo = inputGuide.value.getSourceInfo(selected);\n\n if (chartType.value === 'scatterplot' || chartType.value === 'dendro') {\n return `Grouping: ${selectedSourceInfo?.label}`;\n }\n if (!selectedSourceInfo) {\n return 'Not consistent (grouping)';\n }\n return selectedSourceInfo?.label ?? '';\n}\n\nconst options = computed(() => {\n const options: { text: string; value: string }[] = [];\n const inputStateMap = store.value.reactive.optionsState.components;\n\n possibleAesSourceInputs.forEach((name) => {\n if (inputStateMap?.[name]?.selectorStates.length) {\n inputStateMap[name].selectorStates.forEach(({ selectedSource }) => {\n const selectedSourceInfo = inputGuide.value.getSourceInfo(selectedSource);\n if (selectedSourceInfo.type !== 'String') {\n options.push({\n text: getOptionTitle(selectedSource),\n value: selectedSource,\n });\n }\n });\n }\n });\n return options.length ? options : [{ text: 'Fixed', value: 'fix' }];\n});\n\nconst fixedValue = ref(isContinuousDataMapping(props.selected) ? DEFAULT_DOT_SIZE : props.selected ?? DEFAULT_DOT_SIZE);\nconst rangeValue = ref<[number, number]>(isContinuousDataMapping(props.selected) ? [props.selected.range.min, props.selected.range.max] : [DEFAULT_DOT_RANGE.min, DEFAULT_DOT_RANGE.max]);\n\nwatch(\n () => selectedKey.value,\n (value) => {\n if (value === 'fix') {\n emit('aes-update', fixedValue.value);\n } else {\n const mapping = {\n column: value,\n range: { min: rangeValue.value[0], max: rangeValue.value[1] },\n } as ContinuousDataMappingSize;\n emit('aes-update', mapping);\n }\n },\n);\n\nwatch(\n () => fixedValue.value,\n (value) => {\n if (selectedKey.value === 'fix') {\n emit('aes-update', value);\n }\n },\n);\n\nwatch(\n () => rangeValue.value,\n (rangeV) => {\n if (selectedKey.value !== 'fix') {\n const mapping = {\n column: selectedKey.value,\n range: { min: rangeV[0], max: rangeV[1] },\n } as ContinuousDataMappingSize;\n emit('aes-update', mapping);\n }\n },\n);\n\n</script>\n\n<template>\n <div class=\"dot-size-selector\">\n <div class=\"dot-size-selector__row\">\n <div class=\"aes-input-select\" @click.stop>\n <PlDropdown\n v-model=\"selectedKey\"\n :disabled=\"options.length < 2 && options[0].value === selectedKey\"\n label=\"Dot size source\"\n :options=\"options\"\n />\n </div>\n </div>\n <div class=\"dot-size-selector-row\">\n <SliderRange\n v-if=\"selectedKey !== 'fix'\"\n v-model=\"rangeValue\"\n :min=\"min\"\n :max=\"max\"\n :breakpoints=\"true\"\n label=\"Dot size range\"\n />\n <Slider\n v-else\n v-model=\"fixedValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"1\"\n :breakpoints=\"true\"\n label=\"Dot size\"\n />\n </div>\n </div>\n</template>\n<style>\n .dot-size-selector {\n margin-top: 24px\n }\n .dot-size-selector__row {\n margin: 12px 0;\n }\n</style>\n"],"names":["props","__props","store","useStore","chartType","computed","emit","__emit","DEFAULT_AES_INPUTS","possibleAesSourceInputs","selectedKey","ref","isContinuousDataMapping","inputGuide","getOptionTitle","selected","selectedSourceInfo","options","inputStateMap","name","_a","selectedSource","fixedValue","DEFAULT_DOT_SIZE","rangeValue","DEFAULT_DOT_RANGE","watch","value","mapping","rangeV","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_createVN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