@milaboratories/graph-maker 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Chart.js.map +1 -1
- package/dist/components/Chart.vue.d.ts.map +1 -1
- package/dist/components/Chart.vue2.js +23 -3
- package/dist/components/Chart.vue2.js.map +1 -1
- package/dist/components/ChartTruncationWarningAlert.js.map +1 -1
- package/dist/components/ChartTruncationWarningAlert.style.js.map +1 -1
- package/dist/components/ChartTruncationWarningAlert.vue.d.ts.map +1 -1
- package/dist/components/ChartTruncationWarningAlert.vue2.js +30 -17
- package/dist/components/ChartTruncationWarningAlert.vue2.js.map +1 -1
- package/dist/constantsCommon.d.ts +6 -0
- package/dist/constantsCommon.d.ts.map +1 -1
- package/dist/constantsCommon.js +9 -3
- package/dist/constantsCommon.js.map +1 -1
- package/dist/forms/DataMappingForm/DendroForm.js.map +1 -1
- package/dist/forms/DataMappingForm/DendroForm.vue.d.ts.map +1 -1
- package/dist/forms/DataMappingForm/DendroForm.vue2.js +22 -3
- package/dist/forms/DataMappingForm/DendroForm.vue2.js.map +1 -1
- package/dist/forms/DataMappingForm/useBaskets.d.ts.map +1 -1
- package/dist/forms/DataMappingForm/useBaskets.js +22 -3
- package/dist/forms/DataMappingForm/useBaskets.js.map +1 -1
- package/dist/forms/LayersForm/Layer/Bubble.js.map +1 -1
- package/dist/forms/LayersForm/Layer/Bubble.vue.d.ts.map +1 -1
- package/dist/forms/LayersForm/Layer/Bubble.vue2.js +53 -45
- package/dist/forms/LayersForm/Layer/Bubble.vue2.js.map +1 -1
- package/dist/forms/LayersForm/Layer/heatmap/Heatmap.js.map +1 -1
- package/dist/forms/LayersForm/Layer/heatmap/Heatmap.vue.d.ts.map +1 -1
- package/dist/forms/LayersForm/Layer/heatmap/Heatmap.vue2.js +49 -41
- package/dist/forms/LayersForm/Layer/heatmap/Heatmap.vue2.js.map +1 -1
- package/dist/forms/LayersForm/Layer/heatmap/HeatmapClustered.js.map +1 -1
- package/dist/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue.d.ts.map +1 -1
- package/dist/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue2.js +63 -55
- package/dist/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue2.js.map +1 -1
- package/dist/store.js +7 -1
- package/dist/store.js.map +1 -1
- package/dist/ui.d.ts +0 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +1 -2
- package/dist/ui.vue2.js +1 -1
- package/dist/ui.vue2.js.map +1 -1
- package/dist/ui2.js.map +1 -1
- package/dist/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +2 -0
- package/dist/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
- package/dist/utils/createChartSettingsForRender/composeBubbleSettings.js +1 -1
- package/dist/utils/createChartSettingsForRender/composeBubbleSettings.js.map +1 -1
- package/dist/utils/createChartSettingsForRender/composeChartSettings.d.ts +5 -1
- package/dist/utils/createChartSettingsForRender/composeChartSettings.d.ts.map +1 -1
- package/dist/utils/createChartSettingsForRender/composeChartSettings.js +5 -1
- package/dist/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
- package/dist/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +2 -0
- package/dist/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
- package/dist/utils/createChartSettingsForRender/composeHeatmapSettings.js +1 -1
- package/dist/utils/createChartSettingsForRender/composeHeatmapSettings.js.map +1 -1
- package/dist/utils/loadUniqueValuesToSave.d.ts.map +1 -1
- package/dist/utils/loadUniqueValuesToSave.js +16 -3
- package/dist/utils/loadUniqueValuesToSave.js.map +1 -1
- package/package.json +3 -3
- package/dist/GraphMakerPlugin.js +0 -5
- package/dist/GraphMakerPlugin.js.map +0 -1
- package/dist/GraphMakerPlugin.vue.d.ts +0 -37
- package/dist/GraphMakerPlugin.vue.d.ts.map +0 -1
- package/dist/GraphMakerPlugin.vue2.js +0 -61
- package/dist/GraphMakerPlugin.vue2.js.map +0 -1
|
@@ -19,14 +19,14 @@ var S = { class: "checkbox-item" }, C = {
|
|
|
19
19
|
display: "flex",
|
|
20
20
|
alignItems: "end"
|
|
21
21
|
}
|
|
22
|
-
}, M = "
|
|
22
|
+
}, M = { class: "checkbox-item" }, N = { class: "checkbox-item" }, P = "heatmapClustered", F = /* @__PURE__ */ m({
|
|
23
23
|
__name: "HeatmapClustered",
|
|
24
24
|
setup(m) {
|
|
25
|
-
let
|
|
26
|
-
function
|
|
27
|
-
|
|
25
|
+
let F = o(), I = c(() => F.value.reactive.layersSettings[P]), L = c(() => F.value.reactive.optionsState), R = c(() => F.value.inputGuide.value), z = c(() => L.value.components.value.selectorStates[0]?.selectedSource), B = c(() => z.value ? F.value.reactive.dataBindAes[z.value]?.palette : void 0), V = g(!1), H = g(B.value ?? F.value.defaultPalette.continuous);
|
|
26
|
+
function U(e) {
|
|
27
|
+
H.value = e, V.value = !1, z.value && (F.value.reactive.dataBindAes[z.value] = t(e));
|
|
28
28
|
}
|
|
29
|
-
let
|
|
29
|
+
let W = [
|
|
30
30
|
{
|
|
31
31
|
label: "None",
|
|
32
32
|
value: null
|
|
@@ -39,111 +39,119 @@ var S = { class: "checkbox-item" }, C = {
|
|
|
39
39
|
label: "Rows",
|
|
40
40
|
value: "row"
|
|
41
41
|
}
|
|
42
|
-
],
|
|
42
|
+
], G = [{
|
|
43
43
|
label: "z-score",
|
|
44
44
|
value: "standardScaling"
|
|
45
45
|
}, {
|
|
46
46
|
label: "Min-max",
|
|
47
47
|
value: "meanNormalization"
|
|
48
|
-
}],
|
|
48
|
+
}], K = [{
|
|
49
49
|
label: "empty",
|
|
50
50
|
value: null
|
|
51
51
|
}, {
|
|
52
52
|
label: "Special value",
|
|
53
53
|
value: "custom"
|
|
54
|
-
}],
|
|
54
|
+
}], q = n, J = g(I.value.NAValueAs === null ? I.value.NAValueAs : "custom"), Y = g(I.value.NAValueAs ?? 0);
|
|
55
55
|
return (t, n) => (h(), d(s, null, [
|
|
56
56
|
p(a, {
|
|
57
57
|
label: "Color Palette ",
|
|
58
|
-
title: _(e)[
|
|
59
|
-
palette:
|
|
58
|
+
title: _(e)[H.value].title,
|
|
59
|
+
palette: H.value,
|
|
60
60
|
onButtonClick: n[0] ||= (e) => {
|
|
61
|
-
|
|
61
|
+
V.value = !0;
|
|
62
62
|
}
|
|
63
63
|
}, null, 8, ["title", "palette"]),
|
|
64
|
-
|
|
64
|
+
V.value ? (h(), l(r, {
|
|
65
65
|
key: 0,
|
|
66
66
|
title: "Color Palette",
|
|
67
67
|
"back-title": "Color mapping",
|
|
68
|
-
"onForm:close": n[1] ||= (e) =>
|
|
68
|
+
"onForm:close": n[1] ||= (e) => V.value = !1
|
|
69
69
|
}, {
|
|
70
70
|
default: v(() => [p(i, {
|
|
71
|
-
selected:
|
|
72
|
-
categorical:
|
|
73
|
-
onSelect:
|
|
71
|
+
selected: H.value,
|
|
72
|
+
categorical: z.value ? R.value.getSourceInfo(z.value).type === "String" : !1,
|
|
73
|
+
onSelect: U
|
|
74
74
|
}, null, 8, ["selected", "categorical"])]),
|
|
75
75
|
_: 1
|
|
76
76
|
})) : u("", !0),
|
|
77
77
|
f("div", S, [p(_(b), {
|
|
78
|
-
modelValue:
|
|
79
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
80
|
-
}, null, 8, ["modelValue"]), n[
|
|
81
|
-
|
|
82
|
-
modelValue:
|
|
83
|
-
"onUpdate:modelValue": n[3] ||= (e) =>
|
|
84
|
-
}, null, 8, ["modelValue"]), n[
|
|
78
|
+
modelValue: I.value.disableClusteringX,
|
|
79
|
+
"onUpdate:modelValue": n[2] ||= (e) => I.value.disableClusteringX = e
|
|
80
|
+
}, null, 8, ["modelValue"]), n[17] ||= f("span", null, "Disable clustering for X axis", -1)]),
|
|
81
|
+
I.value.disableClusteringX ? u("", !0) : (h(), d("div", C, [p(_(b), {
|
|
82
|
+
modelValue: I.value.dendrogramX,
|
|
83
|
+
"onUpdate:modelValue": n[3] ||= (e) => I.value.dendrogramX = e
|
|
84
|
+
}, null, 8, ["modelValue"]), n[18] ||= f("span", null, "Show dendrogram for X axis", -1)])),
|
|
85
85
|
f("div", w, [p(_(b), {
|
|
86
|
-
modelValue:
|
|
87
|
-
"onUpdate:modelValue": n[4] ||= (e) =>
|
|
88
|
-
}, null, 8, ["modelValue"]), n[
|
|
89
|
-
|
|
90
|
-
modelValue:
|
|
91
|
-
"onUpdate:modelValue": n[5] ||= (e) =>
|
|
92
|
-
}, null, 8, ["modelValue"]), n[
|
|
86
|
+
modelValue: I.value.disableClusteringY,
|
|
87
|
+
"onUpdate:modelValue": n[4] ||= (e) => I.value.disableClusteringY = e
|
|
88
|
+
}, null, 8, ["modelValue"]), n[19] ||= f("span", null, "Disable clustering for Y axis", -1)]),
|
|
89
|
+
I.value.disableClusteringY ? u("", !0) : (h(), d("div", T, [p(_(b), {
|
|
90
|
+
modelValue: I.value.dendrogramY,
|
|
91
|
+
"onUpdate:modelValue": n[5] ||= (e) => I.value.dendrogramY = e
|
|
92
|
+
}, null, 8, ["modelValue"]), n[20] ||= f("span", null, "Show dendrogram for Y axis", -1)])),
|
|
93
93
|
f("div", E, [p(_(y), {
|
|
94
|
-
modelValue:
|
|
95
|
-
"onUpdate:modelValue": n[6] ||= (e) =>
|
|
94
|
+
modelValue: I.value.normalizationDirection,
|
|
95
|
+
"onUpdate:modelValue": n[6] ||= (e) => I.value.normalizationDirection = e,
|
|
96
96
|
label: "Normalize by",
|
|
97
|
-
options:
|
|
97
|
+
options: W,
|
|
98
98
|
compact: !0
|
|
99
99
|
}, null, 8, ["modelValue"])]),
|
|
100
100
|
f("div", D, [p(_(y), {
|
|
101
|
-
modelValue:
|
|
102
|
-
"onUpdate:modelValue": n[7] ||= (e) =>
|
|
101
|
+
modelValue: I.value.normalizationMethod,
|
|
102
|
+
"onUpdate:modelValue": n[7] ||= (e) => I.value.normalizationMethod = e,
|
|
103
103
|
label: "Normalization method",
|
|
104
|
-
options:
|
|
104
|
+
options: G,
|
|
105
105
|
compact: !0
|
|
106
106
|
}, null, 8, ["modelValue"])]),
|
|
107
107
|
f("div", O, [p(_(b), {
|
|
108
|
-
modelValue:
|
|
109
|
-
"onUpdate:modelValue": n[8] ||= (e) =>
|
|
110
|
-
}, null, 8, ["modelValue"]), n[
|
|
108
|
+
modelValue: I.value.aggregateByX,
|
|
109
|
+
"onUpdate:modelValue": n[8] ||= (e) => I.value.aggregateByX = e
|
|
110
|
+
}, null, 8, ["modelValue"]), n[21] ||= f("span", null, "Aggregate X groups", -1)]),
|
|
111
111
|
f("div", k, [p(_(b), {
|
|
112
|
-
modelValue:
|
|
113
|
-
"onUpdate:modelValue": n[9] ||= (e) =>
|
|
114
|
-
}, null, 8, ["modelValue"]), n[
|
|
112
|
+
modelValue: I.value.aggregateByY,
|
|
113
|
+
"onUpdate:modelValue": n[9] ||= (e) => I.value.aggregateByY = e
|
|
114
|
+
}, null, 8, ["modelValue"]), n[22] ||= f("span", null, "Aggregate Y groups", -1)]),
|
|
115
115
|
f("div", A, [p(_(y), {
|
|
116
|
-
modelValue:
|
|
117
|
-
"onUpdate:modelValue": n[10] ||= (e) =>
|
|
116
|
+
modelValue: I.value.aggregationMethod,
|
|
117
|
+
"onUpdate:modelValue": n[10] ||= (e) => I.value.aggregationMethod = e,
|
|
118
118
|
label: "Aggregation method",
|
|
119
|
-
options: _(
|
|
119
|
+
options: _(q),
|
|
120
120
|
compact: !0
|
|
121
121
|
}, null, 8, ["modelValue", "options"])]),
|
|
122
122
|
f("div", j, [p(_(y), {
|
|
123
|
-
modelValue:
|
|
124
|
-
"onUpdate:modelValue": [n[11] ||= (e) =>
|
|
125
|
-
e === "custom" ?
|
|
123
|
+
modelValue: J.value,
|
|
124
|
+
"onUpdate:modelValue": [n[11] ||= (e) => J.value = e, n[12] ||= (e) => {
|
|
125
|
+
e === "custom" ? I.value.NAValueAs = Y.value : I.value.NAValueAs = e;
|
|
126
126
|
}],
|
|
127
127
|
label: "Treat NA value as:",
|
|
128
|
-
options:
|
|
128
|
+
options: K,
|
|
129
129
|
compact: !0
|
|
130
130
|
}, null, 8, ["modelValue"]), p(_(x), {
|
|
131
|
-
modelValue:
|
|
132
|
-
"onUpdate:modelValue": [n[13] ||= (e) =>
|
|
133
|
-
e !== void 0 && (
|
|
131
|
+
modelValue: Y.value,
|
|
132
|
+
"onUpdate:modelValue": [n[13] ||= (e) => Y.value = e, n[14] ||= (e) => {
|
|
133
|
+
e !== void 0 && (I.value.NAValueAs = e);
|
|
134
134
|
}],
|
|
135
135
|
style: {
|
|
136
136
|
height: "33px",
|
|
137
137
|
marginLeft: "16px",
|
|
138
138
|
width: "75px"
|
|
139
139
|
},
|
|
140
|
-
disabled:
|
|
140
|
+
disabled: J.value !== "custom",
|
|
141
141
|
label: "NA value",
|
|
142
142
|
useIncrementButtons: !1
|
|
143
|
-
}, null, 8, ["modelValue", "disabled"])])
|
|
143
|
+
}, null, 8, ["modelValue", "disabled"])]),
|
|
144
|
+
f("div", M, [p(_(b), {
|
|
145
|
+
modelValue: I.value.showEmptyRows,
|
|
146
|
+
"onUpdate:modelValue": n[15] ||= (e) => I.value.showEmptyRows = e
|
|
147
|
+
}, null, 8, ["modelValue"]), n[23] ||= f("span", null, "Show empty rows", -1)]),
|
|
148
|
+
f("div", N, [p(_(b), {
|
|
149
|
+
modelValue: I.value.showEmptyColumns,
|
|
150
|
+
"onUpdate:modelValue": n[16] ||= (e) => I.value.showEmptyColumns = e
|
|
151
|
+
}, null, 8, ["modelValue"]), n[24] ||= f("span", null, "Show empty columns", -1)])
|
|
144
152
|
], 64));
|
|
145
153
|
}
|
|
146
154
|
});
|
|
147
|
-
export {
|
|
155
|
+
export { F as default };
|
|
148
156
|
|
|
149
157
|
//# sourceMappingURL=HeatmapClustered.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatmapClustered.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../src/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useStore } from '../../../../store';\nimport type { HeatmapLayer } from '../../../../types';\nimport type { SimpleOption } from '@platforma-sdk/ui-vue';\nimport { PlBtnGroup, PlCheckbox, PlNumberField } from '@platforma-sdk/ui-vue';\nimport { computed, ref } from 'vue';\nimport { PALETTE_MAP } from '../../../../constantsAesthetic';\nimport type { HeatmapUIState, InputGuide } from '@milaboratories/pf-plots';\nimport type { ContinuousPalette } from '../../../../components/AesSettings/types';\nimport { createContinuousMappingFromPalette } from '../../../../dataBindAes';\nimport MultiselectButton from '../../../../components/MultiselectButton.vue';\nimport PalettesForm from '../../../../components/AesSettings/PalettesForm.vue';\nimport FormWrapper from '../../../../components/AesSettings/FormWrapper.vue';\nimport { AGGREGATION_METHOD_OPTIONS } from '../../../../constantsCommon';\n\nconst store = useStore();\nconst layer: HeatmapLayer = 'heatmapClustered';\nconst settings = computed(() => store.value.reactive.layersSettings[layer]);\n\nconst optionsState = computed(() => store.value.reactive.optionsState as HeatmapUIState);\nconst inputGuide = computed(() => store.value.inputGuide.value as InputGuide<HeatmapUIState>);\n\nconst dataSource = computed(() => optionsState.value.components.value.selectorStates[0]?.selectedSource);\nconst savedDataValuePalette = computed(() => dataSource.value ? store.value.reactive.dataBindAes[dataSource.value]?.palette : undefined);\n\nconst palettesOpen = ref(false);\nconst palette = ref<ContinuousPalette>(savedDataValuePalette.value as ContinuousPalette ?? store.value.defaultPalette.continuous);\n\nfunction onPaletteSelect(value: ContinuousPalette) {\n palette.value = value;\n palettesOpen.value = false;\n if (dataSource.value) {\n store.value.reactive.dataBindAes[dataSource.value] = createContinuousMappingFromPalette(value);\n }\n}\nconst NORMALIZATION_DIRECTION: SimpleOption[] = [\n { label: 'None', value: null },\n { label: 'Columns', value: 'column' },\n { label: 'Rows', value: 'row' },\n];\nconst NORMALIZATION_METHOD: SimpleOption[] = [\n { label: 'z-score', value: 'standardScaling' },\n { label: 'Min-max', value: 'meanNormalization' },\n];\nconst NA_VALUE_OPTIONS: SimpleOption[] = [\n { label: 'empty', value: null },\n { label: 'Special value', value: 'custom' },\n];\nconst AGGREGATION_METHOD = AGGREGATION_METHOD_OPTIONS;\n\nconst NAValueOption = ref(settings.value.NAValueAs !== null ? 'custom' : settings.value.NAValueAs);\nconst customNA = ref(settings.value.NAValueAs ?? 0);\n</script>\n\n<template>\n <MultiselectButton\n label=\"Color Palette \"\n :title=\"PALETTE_MAP[palette].title\"\n :palette=\"palette\"\n @button-click=\"palettesOpen = true;\"\n />\n <FormWrapper\n v-if=\"palettesOpen\"\n title=\"Color Palette\"\n back-title=\"Color mapping\"\n @form:close=\"palettesOpen = false\"\n >\n <PalettesForm :selected=\"palette\" :categorical=\"dataSource ? inputGuide.getSourceInfo(dataSource).type === 'String' : false\" @select=\"onPaletteSelect\" />\n </FormWrapper>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.disableClusteringX\"/>\n <span>Disable clustering for X axis</span>\n </div>\n <div v-if=\"!settings.disableClusteringX\" class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.dendrogramX\" />\n <span>Show dendrogram for X axis</span>\n </div>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.disableClusteringY\"/>\n <span>Disable clustering for Y axis</span>\n </div>\n <div v-if=\"!settings.disableClusteringY\" class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.dendrogramY\"/>\n <span>Show dendrogram for Y axis</span>\n </div>\n <div class=\"button-group-item\">\n <PlBtnGroup\n v-model=\"settings.normalizationDirection\"\n label=\"Normalize by\"\n :options=\"NORMALIZATION_DIRECTION\"\n :compact=\"true\"\n />\n </div>\n <div class=\"button-group-item\">\n <PlBtnGroup\n v-model=\"settings.normalizationMethod\"\n label=\"Normalization method\"\n :options=\"NORMALIZATION_METHOD\"\n :compact=\"true\"\n />\n </div>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.aggregateByX\"/>\n <span>Aggregate X groups</span>\n </div>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.aggregateByY\"/>\n <span>Aggregate Y groups</span>\n </div>\n <div class=\"button-group-item\">\n <PlBtnGroup\n v-model=\"settings.aggregationMethod\"\n label=\"Aggregation method\"\n :options=\"AGGREGATION_METHOD\"\n :compact=\"true\"\n />\n </div>\n <div class=\"button-group-item\" :style=\"{display: 'flex', alignItems: 'end'}\">\n <PlBtnGroup\n v-model=\"NAValueOption\"\n label=\"Treat NA value as:\"\n :options=\"NA_VALUE_OPTIONS\"\n :compact=\"true\"\n @update:modelValue=\"(value:unknown) => {\n if (value === 'custom') {\n settings.NAValueAs = customNA;\n } else {\n settings.NAValueAs = value as number|null;\n }\n }\"\n />\n <PlNumberField\n v-model=\"customNA\"\n :style=\"{height: '33px', marginLeft: '16px', width: '75px'}\"\n :disabled=\"NAValueOption !== 'custom'\"\n label=\"NA value\"\n :useIncrementButtons=\"false\"\n @update:modelValue=\"(value:unknown) => {\n if (value !== undefined) {\n settings.NAValueAs = value as number;\n }\n }\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"HeatmapClustered.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../src/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useStore } from '../../../../store';\nimport type { HeatmapLayer } from '../../../../types';\nimport type { SimpleOption } from '@platforma-sdk/ui-vue';\nimport { PlBtnGroup, PlCheckbox, PlNumberField } from '@platforma-sdk/ui-vue';\nimport { computed, ref } from 'vue';\nimport { PALETTE_MAP } from '../../../../constantsAesthetic';\nimport type { HeatmapUIState, InputGuide } from '@milaboratories/pf-plots';\nimport type { ContinuousPalette } from '../../../../components/AesSettings/types';\nimport { createContinuousMappingFromPalette } from '../../../../dataBindAes';\nimport MultiselectButton from '../../../../components/MultiselectButton.vue';\nimport PalettesForm from '../../../../components/AesSettings/PalettesForm.vue';\nimport FormWrapper from '../../../../components/AesSettings/FormWrapper.vue';\nimport { AGGREGATION_METHOD_OPTIONS } from '../../../../constantsCommon';\n\nconst store = useStore();\nconst layer: HeatmapLayer = 'heatmapClustered';\nconst settings = computed(() => store.value.reactive.layersSettings[layer]);\n\nconst optionsState = computed(() => store.value.reactive.optionsState as HeatmapUIState);\nconst inputGuide = computed(() => store.value.inputGuide.value as InputGuide<HeatmapUIState>);\n\nconst dataSource = computed(() => optionsState.value.components.value.selectorStates[0]?.selectedSource);\nconst savedDataValuePalette = computed(() => dataSource.value ? store.value.reactive.dataBindAes[dataSource.value]?.palette : undefined);\n\nconst palettesOpen = ref(false);\nconst palette = ref<ContinuousPalette>(savedDataValuePalette.value as ContinuousPalette ?? store.value.defaultPalette.continuous);\n\nfunction onPaletteSelect(value: ContinuousPalette) {\n palette.value = value;\n palettesOpen.value = false;\n if (dataSource.value) {\n store.value.reactive.dataBindAes[dataSource.value] = createContinuousMappingFromPalette(value);\n }\n}\nconst NORMALIZATION_DIRECTION: SimpleOption[] = [\n { label: 'None', value: null },\n { label: 'Columns', value: 'column' },\n { label: 'Rows', value: 'row' },\n];\nconst NORMALIZATION_METHOD: SimpleOption[] = [\n { label: 'z-score', value: 'standardScaling' },\n { label: 'Min-max', value: 'meanNormalization' },\n];\nconst NA_VALUE_OPTIONS: SimpleOption[] = [\n { label: 'empty', value: null },\n { label: 'Special value', value: 'custom' },\n];\nconst AGGREGATION_METHOD = AGGREGATION_METHOD_OPTIONS;\n\nconst NAValueOption = ref(settings.value.NAValueAs !== null ? 'custom' : settings.value.NAValueAs);\nconst customNA = ref(settings.value.NAValueAs ?? 0);\n</script>\n\n<template>\n <MultiselectButton\n label=\"Color Palette \"\n :title=\"PALETTE_MAP[palette].title\"\n :palette=\"palette\"\n @button-click=\"palettesOpen = true;\"\n />\n <FormWrapper\n v-if=\"palettesOpen\"\n title=\"Color Palette\"\n back-title=\"Color mapping\"\n @form:close=\"palettesOpen = false\"\n >\n <PalettesForm :selected=\"palette\" :categorical=\"dataSource ? inputGuide.getSourceInfo(dataSource).type === 'String' : false\" @select=\"onPaletteSelect\" />\n </FormWrapper>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.disableClusteringX\"/>\n <span>Disable clustering for X axis</span>\n </div>\n <div v-if=\"!settings.disableClusteringX\" class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.dendrogramX\" />\n <span>Show dendrogram for X axis</span>\n </div>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.disableClusteringY\"/>\n <span>Disable clustering for Y axis</span>\n </div>\n <div v-if=\"!settings.disableClusteringY\" class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.dendrogramY\"/>\n <span>Show dendrogram for Y axis</span>\n </div>\n <div class=\"button-group-item\">\n <PlBtnGroup\n v-model=\"settings.normalizationDirection\"\n label=\"Normalize by\"\n :options=\"NORMALIZATION_DIRECTION\"\n :compact=\"true\"\n />\n </div>\n <div class=\"button-group-item\">\n <PlBtnGroup\n v-model=\"settings.normalizationMethod\"\n label=\"Normalization method\"\n :options=\"NORMALIZATION_METHOD\"\n :compact=\"true\"\n />\n </div>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.aggregateByX\"/>\n <span>Aggregate X groups</span>\n </div>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.aggregateByY\"/>\n <span>Aggregate Y groups</span>\n </div>\n <div class=\"button-group-item\">\n <PlBtnGroup\n v-model=\"settings.aggregationMethod\"\n label=\"Aggregation method\"\n :options=\"AGGREGATION_METHOD\"\n :compact=\"true\"\n />\n </div>\n <div class=\"button-group-item\" :style=\"{display: 'flex', alignItems: 'end'}\">\n <PlBtnGroup\n v-model=\"NAValueOption\"\n label=\"Treat NA value as:\"\n :options=\"NA_VALUE_OPTIONS\"\n :compact=\"true\"\n @update:modelValue=\"(value:unknown) => {\n if (value === 'custom') {\n settings.NAValueAs = customNA;\n } else {\n settings.NAValueAs = value as number|null;\n }\n }\"\n />\n <PlNumberField\n v-model=\"customNA\"\n :style=\"{height: '33px', marginLeft: '16px', width: '75px'}\"\n :disabled=\"NAValueOption !== 'custom'\"\n label=\"NA value\"\n :useIncrementButtons=\"false\"\n @update:modelValue=\"(value:unknown) => {\n if (value !== undefined) {\n settings.NAValueAs = value as number;\n }\n }\"\n />\n </div>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.showEmptyRows\"/>\n <span>Show empty rows</span>\n </div>\n <div class=\"checkbox-item\">\n <PlCheckbox v-model=\"settings.showEmptyColumns\"/>\n <span>Show empty columns</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;mEAgBM,IAAsB;;;EAD5B,IAAM,IAAQ,GAAU,EAElB,IAAW,QAAe,EAAM,MAAM,SAAS,eAAe,GAAO,EAErE,IAAe,QAAe,EAAM,MAAM,SAAS,aAA+B,EAClF,IAAa,QAAe,EAAM,MAAM,WAAW,MAAoC,EAEvF,IAAa,QAAe,EAAa,MAAM,WAAW,MAAM,eAAe,IAAI,eAAe,EAClG,IAAwB,QAAe,EAAW,QAAQ,EAAM,MAAM,SAAS,YAAY,EAAW,QAAQ,UAAU,KAAA,EAAU,EAElI,IAAe,EAAI,GAAM,EACzB,IAAU,EAAuB,EAAsB,SAA8B,EAAM,MAAM,eAAe,WAAW;EAEjI,SAAS,EAAgB,GAA0B;AAGjD,GAFA,EAAQ,QAAQ,GAChB,EAAa,QAAQ,IACjB,EAAW,UACb,EAAM,MAAM,SAAS,YAAY,EAAW,SAAS,EAAmC,EAAM;;EAGlG,IAAM,IAA0C;GAC9C;IAAE,OAAO;IAAQ,OAAO;IAAM;GAC9B;IAAE,OAAO;IAAW,OAAO;IAAU;GACrC;IAAE,OAAO;IAAQ,OAAO;IAAO;GAChC,EACK,IAAuC,CAC3C;GAAE,OAAO;GAAW,OAAO;GAAmB,EAC9C;GAAE,OAAO;GAAW,OAAO;GAAqB,CACjD,EACK,IAAmC,CACvC;GAAE,OAAO;G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B,OAAM;IACL,qBAAqB;;GAQ1B,EAGM,OAHN,GAGM,CAFJ,EAA8C,EAAA,EAAA,EAAA;gBAAzB,EAAA,MAAS;8CAAT,MAAS,gBAAa;0CAC3C,EAA4B,QAAA,MAAtB,mBAAe,GAAA,CAAA,CAAA;GAEvB,EAGM,OAHN,GAGM,CAFJ,EAAiD,EAAA,EAAA,EAAA;gBAA5B,EAAA,MAAS;8CAAT,MAAS,mBAAgB;0CAC9C,EAA+B,QAAA,MAAzB,sBAAkB,GAAA,CAAA,CAAA"}
|
package/dist/store.js
CHANGED
|
@@ -110,7 +110,13 @@ function N(e, t, r, i, a, o, s, l, m) {
|
|
|
110
110
|
R.value++;
|
|
111
111
|
let a = R.value;
|
|
112
112
|
I.value.loading.inputGuide = !0;
|
|
113
|
-
let c = n && r ? Object.values(await f(n, r, null, !1)).flatMap((e) => e.map((e) => e.selectedSource)) : [], l = n ? await b.calculateOptions(
|
|
113
|
+
let c = n && r ? Object.values(await f(n, r, null, !1)).flatMap((e) => e.map((e) => e.selectedSource)) : [], l = n ? await b.calculateOptions({
|
|
114
|
+
store: E(n),
|
|
115
|
+
state: e,
|
|
116
|
+
fixedIds: c,
|
|
117
|
+
dataColumnPredicate: o,
|
|
118
|
+
metaColumnPredicate: s
|
|
119
|
+
}) : b.getEmptyInputGuide(e);
|
|
114
120
|
a === R.value && (S.value = l, I.value.loading.defaults = !1, I.value.loading.inputGuide = !1, I.value.loading.initialInputGuide && (I.value.loading.initialInputGuide = !1));
|
|
115
121
|
}, {
|
|
116
122
|
immediate: !0,
|
package/dist/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","names":[],"sources":["../src/store.ts"],"sourcesContent":["import type {\n ChartType,\n DemoDataStore,\n DendroStateController,\n DendroUIState,\n InputGuide,\n InputNamesByChartType,\n InputState,\n PlotDataAndSettings,\n} from '@milaboratories/pf-plots';\nimport {\n getControllerByType,\n getInitialStateByType,\n} from '@milaboratories/pf-plots';\nimport type { PColumnSpec } from '@platforma-sdk/model';\nimport type { CategoricalPalette, ContinuousPalette, Palette } from './components/AesSettings/types';\nimport type { ComputedRef, Reactive, Ref } from 'vue';\nimport { computed, inject, provide, reactive, ref, toRaw, watch } from 'vue';\nimport type { AesType } from './constantsCommon';\nimport {\n getInitialAxesSettings,\n getInitialLayersSettings,\n getInitialStatisticsState,\n getInitialTemplate,\n} from './constantsCommon';\nimport { updateDataBindAes } from './dataBindAes';\nimport { notEmpty } from './helpers';\nimport { storeKey } from './keys';\nimport type {\n DefaultPalettes,\n DendroNodeInfo,\n FilterLabelsInfoBySourceMap,\n FilterSuggestionsBySourceMap,\n GraphMakerProps,\n GraphMakerState,\n ReactiveState, UniqueValuesBySourceMap,\n} from './types';\nimport type { LoadedDefaultOptionsMap } from './utils';\nimport { createUpdatedWithNewDefaultsOptionsState, isOptionsStateNeedsToBeUpdated, loadDefaultSources } from './utils';\nimport { addFixedOptionsToState } from './utils/addFixedOptionsToState';\nimport { calculateDiscreteGroups } from './utils/calculateDiscreteGroups';\nimport { copyJSON } from './utils/copyJSON';\nimport { loadDataForPlot } from './utils/createChartSettingsForRender/composeChartSettings';\nimport { getUsedAesInMapping } from './utils/getUsedAesInMapping';\nimport {\n getFacetValuesFromReadyChartData,\n getUniqueValuesFromReadyChartData,\n loadFilterLabelsForTitle,\n} from './utils/loadUniqueValuesToSave';\nimport type { FormKey } from './forms';\nimport { tabKeys } from './forms';\nimport { DEFAULT_CATEGORICAL_PALETTE, DEFAULT_CONTINUOUS_PALETTE } from './constantsAesthetic';\n\nfunction getInitialOptionsState(chartType: ChartType, optionsState: InputState | undefined) {\n const defaultState = copyJSON(getInitialStateByType(chartType));\n if (optionsState?.type !== chartType) {\n return defaultState;\n }\n const optionsStateCopy = copyJSON(optionsState);\n\n return {\n ...defaultState,\n ...optionsStateCopy,\n components: {\n ...defaultState.components,\n ...optionsStateCopy.components,\n },\n };\n}\n\nexport function createReactiveState(\n initialData: GraphMakerState,\n chartType: ChartType,\n): Reactive<ReactiveState> {\n return reactive({\n chartType: chartType,\n // from pf-plots\n optionsState: getInitialOptionsState(chartType, initialData.optionsState), // contains user selected inputs\n // previously used default options\n usedDefaultOptions: initialData.usedDefaultOptions ? copyJSON(initialData.usedDefaultOptions ?? {}) as LoadedDefaultOptionsMap<ChartType> : null,\n\n // local form states, updates directly in forms\n template: getInitialTemplate(initialData.template, chartType),\n statisticsSettings: getInitialStatisticsState(chartType, initialData.statisticsSettings),\n layersSettings: getInitialLayersSettings(initialData.layersSettings),\n axesSettings: getInitialAxesSettings(chartType, initialData.axesSettings),\n // common aesthetics data mapped on columns/axes values\n dataBindAes: copyJSON(initialData.dataBindAes ?? {}),\n chartScale: initialData.zoomState ?? 100,\n lassoControlsState: null,\n currentTab: initialData.currentTab === undefined ? 'dataMapping' : initialData.currentTab,\n tabDefaultState: tabKeys().reduce((res, formKey: FormKey) => {\n res[formKey] = {};\n return res;\n }, {} as Record<FormKey, Record<string, boolean>>),\n dendroInfoByClick: null as null | DendroNodeInfo,\n dendroSelectedNodeId: null,\n showTooltipHint: false,\n tooltipHintWasShown: initialData.tooltipHintWasShown ?? false,\n });\n}\n\nexport interface Store {\n reactive: Reactive<ReactiveState>;\n loading: {\n initialInputGuide: boolean;\n initialCharts: boolean;\n initialDefaults: boolean;\n inputGuide: boolean;\n chartData: boolean;\n defaults: boolean;\n chartRendering: boolean;\n dendroTableData: boolean;\n };\n commonHelpersData: {\n primaryGroups: ComputedRef<ReturnType<typeof calculateDiscreteGroups>>;\n secondaryGroups: ComputedRef<ReturnType<typeof calculateDiscreteGroups>>;\n usedAesInMapping: ComputedRef<Record<string, Record<AesType, boolean>>>;\n dendroTableData: Ref<Awaited<ReturnType<DendroStateController['createTableData']>> | null>;\n };\n controller: ReturnType<typeof getControllerByType>;\n columnsDataStore: Ref<DemoDataStore | null>;\n inputGuide: Ref<InputGuide<InputState>>;\n chartData: Ref<PlotDataAndSettings | null>;\n uniqueValuesData: Ref<UniqueValuesBySourceMap>;\n facetValuesData: Ref<UniqueValuesBySourceMap>;\n filterSuggestionsData: Ref<FilterSuggestionsBySourceMap>;\n filterLabelsInfo: Ref<FilterLabelsInfoBySourceMap>;\n readonlyInputs?: InputNamesByChartType[ChartType][];\n defaultPalette: DefaultPalettes;\n}\n\nexport function factoryStore(\n reactiveState: Reactive<ReactiveState>,\n dataStore: Ref<DemoDataStore | null>,\n inputGuide: Ref<InputGuide<InputState>>,\n chartData: Ref<PlotDataAndSettings | null>,\n dendroTableData: Ref<Awaited<ReturnType<DendroStateController['createTableData']>> | null>,\n uniqueValuesData: Ref<UniqueValuesBySourceMap>,\n facetValuesData: Ref<UniqueValuesBySourceMap>,\n filterSuggestionsData: Ref<FilterSuggestionsBySourceMap>,\n filterLabelsInfo: Ref<FilterLabelsInfoBySourceMap>,\n readonlyInputs?: InputNamesByChartType[ChartType][],\n defaultPalette?: Palette | { categorical?: Palette; continuous?: Palette },\n): Store {\n return {\n reactive: reactiveState,\n loading: reactive({\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n defaults: false,\n chartRendering: false,\n dendroTableData: false,\n }),\n commonHelpersData: {\n primaryGroups: computed(() => calculateDiscreteGroups(\n reactiveState.optionsState,\n uniqueValuesData.value,\n 'primaryGrouping',\n ),\n ),\n secondaryGroups: computed(() => calculateDiscreteGroups(\n reactiveState.optionsState,\n uniqueValuesData.value,\n 'secondaryGrouping',\n ),\n ),\n usedAesInMapping: computed<Record<string, Record<AesType, boolean>>>(() =>\n getUsedAesInMapping(\n reactiveState.chartType,\n reactiveState.template,\n reactiveState.layersSettings,\n reactiveState.statisticsSettings,\n reactiveState.optionsState,\n inputGuide.value,\n ),\n ),\n dendroTableData,\n },\n controller: getControllerByType(reactiveState.chartType),\n columnsDataStore: dataStore,\n inputGuide,\n chartData,\n uniqueValuesData,\n facetValuesData,\n filterSuggestionsData,\n filterLabelsInfo,\n readonlyInputs,\n defaultPalette: {\n categorical: typeof defaultPalette === 'object' && defaultPalette.categorical\n ? defaultPalette.categorical as CategoricalPalette\n : typeof defaultPalette === 'string' ? defaultPalette as CategoricalPalette : DEFAULT_CATEGORICAL_PALETTE,\n continuous: typeof defaultPalette === 'object' && defaultPalette.continuous\n ? defaultPalette.continuous as ContinuousPalette\n : typeof defaultPalette === 'string' ? defaultPalette as ContinuousPalette : DEFAULT_CONTINUOUS_PALETTE,\n },\n };\n}\n\nexport type ComputedStore = ComputedRef<Store>;\n\nexport function provideStore(\n initialState: GraphMakerState,\n dataStoreRef: Ref<DemoDataStore | null>,\n chartType: ChartType,\n defaultOptionsRef: Ref<GraphMakerProps['defaultOptions']>,\n fixedOptionsRef: Ref<GraphMakerProps['fixedOptions']>,\n dataColumnPredicate?: (spec: PColumnSpec) => boolean,\n metaColumnPredicate?: (spec: PColumnSpec) => boolean,\n readonlyInputs?: InputNamesByChartType[ChartType][],\n defaultPalette?: GraphMakerProps['defaultPalette'],\n) {\n const reactiveState = createReactiveState(initialState, chartType);\n const controller = getControllerByType(reactiveState.chartType);\n\n const inputGuide = ref<InputGuide<InputState>>(getControllerByType(reactiveState.chartType).getEmptyInputGuide(reactiveState.optionsState));\n const chartData = ref<PlotDataAndSettings | null>(null);\n\n const uniqueValuesData = ref<UniqueValuesBySourceMap>({});\n const facetValuesData = ref<UniqueValuesBySourceMap>({});\n const filterSuggestionsData = ref<FilterSuggestionsBySourceMap>({});\n const filterLabelsInfo = ref<FilterLabelsInfoBySourceMap>({}); // for auto titles of chart if something selected in filter/tabby\n\n const dendroTableData = ref<Awaited<ReturnType<DendroStateController['createTableData']>> | null>(null);\n\n // toRaw removes Vue proxy from dataStore.pframe (PFrame api)\n const store = computed(() => factoryStore(\n reactiveState,\n dataStoreRef,\n inputGuide,\n chartData,\n dendroTableData,\n uniqueValuesData,\n facetValuesData,\n filterSuggestionsData,\n filterLabelsInfo,\n readonlyInputs,\n defaultPalette,\n ));\n\n watch(() => dataStoreRef.value, () => {\n filterLabelsInfo.value = {};\n uniqueValuesData.value = {};\n facetValuesData.value = {};\n filterSuggestionsData.value = {}; // reset saved data; avoid caching of empty results from old empty pframe\n });\n\n const defaultOptionsCounter = ref(0);\n watch([\n () => dataStoreRef.value,\n () => defaultOptionsRef.value,\n ], async ([ds, defaultOptions]) => {\n if (!defaultOptions || defaultOptions?.length === 0 || !ds) {\n return;\n }\n defaultOptionsCounter.value++;\n const counter = defaultOptionsCounter.value;\n store.value.loading.defaults = true;\n if (reactiveState.usedDefaultOptions === null) {\n store.value.loading.initialInputGuide = true;\n }\n const loadedDefaultOptions = await loadDefaultSources(ds, defaultOptions, reactiveState.usedDefaultOptions);\n if (defaultOptionsCounter.value !== counter) {\n return;\n }\n const { usedDefaultOptions, optionsState } = reactiveState;\n const needsToBeUpdated = isOptionsStateNeedsToBeUpdated(optionsState, usedDefaultOptions, loadedDefaultOptions);\n if (!needsToBeUpdated) {\n store.value.loading.defaults = false;\n return;\n }\n store.value.loading.initialCharts = true; // we want to show loader when default are really changed and new chart data is requested\n reactiveState.optionsState.components = createUpdatedWithNewDefaultsOptionsState(optionsState, usedDefaultOptions, loadedDefaultOptions);\n reactiveState.usedDefaultOptions = loadedDefaultOptions;\n }, { immediate: true });\n\n // recalculate input guide - options for every data input, consistency info etc\n const inputGuideCounter = ref(0); // to avoid race condition on async calculations\n watch([\n () => reactiveState.optionsState,\n () => dataStoreRef.value,\n () => fixedOptionsRef.value,\n ], async ([optionsState, ds, fixedOptions]) => {\n if (defaultOptionsRef.value === null || dataStoreRef.value === null) { // they are not ready, waiting for them\n return;\n }\n inputGuideCounter.value++;\n const counter = inputGuideCounter.value;\n store.value.loading.inputGuide = true;\n const ignoredIds = ds && fixedOptions ? Object.values(await loadDefaultSources(ds, fixedOptions, null, false)).flatMap((item) => item.map((s) => s.selectedSource)) : [];\n\n // const start = Date.now();\n const nextInputGuide = ds ? await controller.calculateOptions(toRaw(ds), optionsState, ignoredIds, dataColumnPredicate, metaColumnPredicate) : controller.getEmptyInputGuide(optionsState);\n // console.log('input guide', Date.now() - start);\n\n if (counter === inputGuideCounter.value) { // race condition check\n inputGuide.value = nextInputGuide;\n\n store.value.loading.defaults = false;\n store.value.loading.inputGuide = false;\n if (store.value.loading.initialInputGuide) {\n store.value.loading.initialInputGuide = false;\n }\n }\n }, { immediate: true, deep: true });\n\n // recalculate data for chart rendering (miplots4)\n const chartDataCounter = ref(0); // to avoid race condition on async calculations\n watch(() => inputGuide.value, async (ig) => {\n chartDataCounter.value++;\n const counter = chartDataCounter.value;\n\n store.value.loading.chartData = true;\n\n const ds = toRaw(dataStoreRef.value);\n // const start = Date.now();\n const nextChartData = await loadDataForPlot(ig, reactiveState, ds, fixedOptionsRef.value);\n\n if (nextChartData && ds) {\n const { uniqueValues, filterSuggestions } = await getUniqueValuesFromReadyChartData(\n nextChartData, ig, reactiveState.optionsState.components, controller, ds, toRaw(filterSuggestionsData.value),\n );\n uniqueValuesData.value = uniqueValues;\n facetValuesData.value = getFacetValuesFromReadyChartData(\n nextChartData,\n reactiveState.optionsState.components,\n );\n filterSuggestionsData.value = filterSuggestions;\n updateDataBindAes(reactiveState.optionsState, reactiveState.dataBindAes, uniqueValuesData.value);\n } else {\n facetValuesData.value = {};\n }\n filterLabelsInfo.value = ds\n ? await loadFilterLabelsForTitle(reactiveState.optionsState.components, ig, controller, ds)\n : {};\n // console.log('chart data', Date.now() - start);\n\n if (counter === chartDataCounter.value) { // race condition check\n chartData.value = nextChartData;\n if (ig.ready) {\n store.value.loading.initialCharts = false;\n }\n store.value.loading.chartData = false;\n }\n }, { immediate: true, deep: true });\n\n // watch data for table, only dendro chart; data is also using for popup by tree node click\n if (reactiveState.chartType === 'dendro') {\n const dendroDataCounter = ref(0); // to avoid race condition on async calculations\n watch([\n () => reactiveState.optionsState as DendroUIState,\n () => dataStoreRef.value,\n () => inputGuide.value.readyData,\n () => fixedOptionsRef.value,\n ], async ([optionsState, dataStore, ready, fixed]) => {\n if (ready && dataStore) {\n dendroDataCounter.value++;\n const counter = dendroDataCounter.value;\n store.value.loading.dendroTableData = true;\n const state = (await addFixedOptionsToState(optionsState, dataStore, fixed)) as DendroUIState;\n const nextDendroTableData = await (controller as unknown as DendroStateController).createTableData(dataStore, state);\n\n if (dendroDataCounter.value === counter) {\n dendroTableData.value = nextDendroTableData;\n }\n store.value.loading.dendroTableData = false;\n }\n }, { immediate: true });\n }\n\n provide(storeKey, store);\n return store;\n}\n\nexport function useStore() {\n return notEmpty(inject<ComputedStore>(storeKey), 'Empty store');\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqDA,SAAS,EAAuB,GAAsB,GAAsC;CAC1F,IAAM,IAAe,EAAS,EAAsB,EAAU,CAAC;AAC/D,KAAI,GAAc,SAAS,EACzB,QAAO;CAET,IAAM,IAAmB,EAAS,EAAa;AAE/C,QAAO;EACL,GAAG;EACH,GAAG;EACH,YAAY;GACV,GAAG,EAAa;GAChB,GAAG,EAAiB;GACrB;EACF;;AAGH,SAAgB,EACd,GACA,GACyB;AACzB,QAAO,EAAS;EACH;EAEX,cAAc,EAAuB,GAAW,EAAY,aAAa;EAEzE,oBAAoB,EAAY,qBAAqB,EAAS,EAAY,sBAAsB,EAAE,CAAC,GAAyC;EAG5I,UAAU,EAAmB,EAAY,UAAU,EAAU;EAC7D,oBAAoB,EAA0B,GAAW,EAAY,mBAAmB;EACxF,gBAAgB,EAAyB,EAAY,eAAe;EACpE,cAAc,EAAuB,GAAW,EAAY,aAAa;EAEzE,aAAa,EAAS,EAAY,eAAe,EAAE,CAAC;EACpD,YAAY,EAAY,aAAa;EACrC,oBAAoB;EACpB,YAAY,EAAY,eAAe,KAAA,IAAY,gBAAgB,EAAY;EAC/E,iBAAiB,GAAS,CAAC,QAAQ,GAAK,OACtC,EAAI,KAAW,EAAE,EACV,IACN,EAAE,CAA6C;EAClD,mBAAmB;EACnB,sBAAsB;EACtB,iBAAiB;EACjB,qBAAqB,EAAY,uBAAuB;EACzD,CAAC;;AAiCJ,SAAgB,EACd,GACA,GACA,GACA,GACA,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GAAW;AACtB,MAAkB;IAClB,IAAM,IAAU,EAAkB;AAClC,MAAM,MAAM,QAAQ,kBAAkB;IACtC,IAAM,IAAS,MAAM,EAAuB,GAAc,GAAW,EAAM,EACrE,IAAsB,MAAO,EAAgD,gBAAgB,GAAW,EAAM;AAKpH,IAHI,EAAkB,UAAU,MAC9B,EAAgB,QAAQ,IAE1B,EAAM,MAAM,QAAQ,kBAAkB;;KAEvC,EAAE,WAAW,IAAM,CAAC;;AAIzB,QADA,EAAQ,GAAU,EAAM,EACjB;;AAGT,SAAgB,IAAW;AACzB,QAAO,EAAS,EAAsB,EAAS,EAAE,cAAc"}
|
|
1
|
+
{"version":3,"file":"store.js","names":[],"sources":["../src/store.ts"],"sourcesContent":["import type {\n ChartType,\n DemoDataStore,\n DendroStateController,\n DendroUIState,\n InputGuide,\n InputNamesByChartType,\n InputState,\n PlotDataAndSettings,\n} from '@milaboratories/pf-plots';\nimport {\n getControllerByType,\n getInitialStateByType,\n} from '@milaboratories/pf-plots';\nimport type { PColumnSpec } from '@platforma-sdk/model';\nimport type { CategoricalPalette, ContinuousPalette, Palette } from './components/AesSettings/types';\nimport type { ComputedRef, Reactive, Ref } from 'vue';\nimport { computed, inject, provide, reactive, ref, toRaw, watch } from 'vue';\nimport type { AesType } from './constantsCommon';\nimport {\n getInitialAxesSettings,\n getInitialLayersSettings,\n getInitialStatisticsState,\n getInitialTemplate,\n} from './constantsCommon';\nimport { updateDataBindAes } from './dataBindAes';\nimport { notEmpty } from './helpers';\nimport { storeKey } from './keys';\nimport type {\n DefaultPalettes,\n DendroNodeInfo,\n FilterLabelsInfoBySourceMap,\n FilterSuggestionsBySourceMap,\n GraphMakerProps,\n GraphMakerState,\n ReactiveState, UniqueValuesBySourceMap,\n} from './types';\nimport type { LoadedDefaultOptionsMap } from './utils';\nimport { createUpdatedWithNewDefaultsOptionsState, isOptionsStateNeedsToBeUpdated, loadDefaultSources } from './utils';\nimport { addFixedOptionsToState } from './utils/addFixedOptionsToState';\nimport { calculateDiscreteGroups } from './utils/calculateDiscreteGroups';\nimport { copyJSON } from './utils/copyJSON';\nimport { loadDataForPlot } from './utils/createChartSettingsForRender/composeChartSettings';\nimport { getUsedAesInMapping } from './utils/getUsedAesInMapping';\nimport {\n getFacetValuesFromReadyChartData,\n getUniqueValuesFromReadyChartData,\n loadFilterLabelsForTitle,\n} from './utils/loadUniqueValuesToSave';\nimport type { FormKey } from './forms';\nimport { tabKeys } from './forms';\nimport { DEFAULT_CATEGORICAL_PALETTE, DEFAULT_CONTINUOUS_PALETTE } from './constantsAesthetic';\n\nfunction getInitialOptionsState(chartType: ChartType, optionsState: InputState | undefined) {\n const defaultState = copyJSON(getInitialStateByType(chartType));\n if (optionsState?.type !== chartType) {\n return defaultState;\n }\n const optionsStateCopy = copyJSON(optionsState);\n\n return {\n ...defaultState,\n ...optionsStateCopy,\n components: {\n ...defaultState.components,\n ...optionsStateCopy.components,\n },\n };\n}\n\nexport function createReactiveState(\n initialData: GraphMakerState,\n chartType: ChartType,\n): Reactive<ReactiveState> {\n return reactive({\n chartType: chartType,\n // from pf-plots\n optionsState: getInitialOptionsState(chartType, initialData.optionsState), // contains user selected inputs\n // previously used default options\n usedDefaultOptions: initialData.usedDefaultOptions ? copyJSON(initialData.usedDefaultOptions ?? {}) as LoadedDefaultOptionsMap<ChartType> : null,\n\n // local form states, updates directly in forms\n template: getInitialTemplate(initialData.template, chartType),\n statisticsSettings: getInitialStatisticsState(chartType, initialData.statisticsSettings),\n layersSettings: getInitialLayersSettings(initialData.layersSettings),\n axesSettings: getInitialAxesSettings(chartType, initialData.axesSettings),\n // common aesthetics data mapped on columns/axes values\n dataBindAes: copyJSON(initialData.dataBindAes ?? {}),\n chartScale: initialData.zoomState ?? 100,\n lassoControlsState: null,\n currentTab: initialData.currentTab === undefined ? 'dataMapping' : initialData.currentTab,\n tabDefaultState: tabKeys().reduce((res, formKey: FormKey) => {\n res[formKey] = {};\n return res;\n }, {} as Record<FormKey, Record<string, boolean>>),\n dendroInfoByClick: null as null | DendroNodeInfo,\n dendroSelectedNodeId: null,\n showTooltipHint: false,\n tooltipHintWasShown: initialData.tooltipHintWasShown ?? false,\n });\n}\n\nexport interface Store {\n reactive: Reactive<ReactiveState>;\n loading: {\n initialInputGuide: boolean;\n initialCharts: boolean;\n initialDefaults: boolean;\n inputGuide: boolean;\n chartData: boolean;\n defaults: boolean;\n chartRendering: boolean;\n dendroTableData: boolean;\n };\n commonHelpersData: {\n primaryGroups: ComputedRef<ReturnType<typeof calculateDiscreteGroups>>;\n secondaryGroups: ComputedRef<ReturnType<typeof calculateDiscreteGroups>>;\n usedAesInMapping: ComputedRef<Record<string, Record<AesType, boolean>>>;\n dendroTableData: Ref<Awaited<ReturnType<DendroStateController['createTableData']>> | null>;\n };\n controller: ReturnType<typeof getControllerByType>;\n columnsDataStore: Ref<DemoDataStore | null>;\n inputGuide: Ref<InputGuide<InputState>>;\n chartData: Ref<PlotDataAndSettings | null>;\n uniqueValuesData: Ref<UniqueValuesBySourceMap>;\n facetValuesData: Ref<UniqueValuesBySourceMap>;\n filterSuggestionsData: Ref<FilterSuggestionsBySourceMap>;\n filterLabelsInfo: Ref<FilterLabelsInfoBySourceMap>;\n readonlyInputs?: InputNamesByChartType[ChartType][];\n defaultPalette: DefaultPalettes;\n}\n\nexport function factoryStore(\n reactiveState: Reactive<ReactiveState>,\n dataStore: Ref<DemoDataStore | null>,\n inputGuide: Ref<InputGuide<InputState>>,\n chartData: Ref<PlotDataAndSettings | null>,\n dendroTableData: Ref<Awaited<ReturnType<DendroStateController['createTableData']>> | null>,\n uniqueValuesData: Ref<UniqueValuesBySourceMap>,\n facetValuesData: Ref<UniqueValuesBySourceMap>,\n filterSuggestionsData: Ref<FilterSuggestionsBySourceMap>,\n filterLabelsInfo: Ref<FilterLabelsInfoBySourceMap>,\n readonlyInputs?: InputNamesByChartType[ChartType][],\n defaultPalette?: Palette | { categorical?: Palette; continuous?: Palette },\n): Store {\n return {\n reactive: reactiveState,\n loading: reactive({\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n defaults: false,\n chartRendering: false,\n dendroTableData: false,\n }),\n commonHelpersData: {\n primaryGroups: computed(() => calculateDiscreteGroups(\n reactiveState.optionsState,\n uniqueValuesData.value,\n 'primaryGrouping',\n ),\n ),\n secondaryGroups: computed(() => calculateDiscreteGroups(\n reactiveState.optionsState,\n uniqueValuesData.value,\n 'secondaryGrouping',\n ),\n ),\n usedAesInMapping: computed<Record<string, Record<AesType, boolean>>>(() =>\n getUsedAesInMapping(\n reactiveState.chartType,\n reactiveState.template,\n reactiveState.layersSettings,\n reactiveState.statisticsSettings,\n reactiveState.optionsState,\n inputGuide.value,\n ),\n ),\n dendroTableData,\n },\n controller: getControllerByType(reactiveState.chartType),\n columnsDataStore: dataStore,\n inputGuide,\n chartData,\n uniqueValuesData,\n facetValuesData,\n filterSuggestionsData,\n filterLabelsInfo,\n readonlyInputs,\n defaultPalette: {\n categorical: typeof defaultPalette === 'object' && defaultPalette.categorical\n ? defaultPalette.categorical as CategoricalPalette\n : typeof defaultPalette === 'string' ? defaultPalette as CategoricalPalette : DEFAULT_CATEGORICAL_PALETTE,\n continuous: typeof defaultPalette === 'object' && defaultPalette.continuous\n ? defaultPalette.continuous as ContinuousPalette\n : typeof defaultPalette === 'string' ? defaultPalette as ContinuousPalette : DEFAULT_CONTINUOUS_PALETTE,\n },\n };\n}\n\nexport type ComputedStore = ComputedRef<Store>;\n\nexport function provideStore(\n initialState: GraphMakerState,\n dataStoreRef: Ref<DemoDataStore | null>,\n chartType: ChartType,\n defaultOptionsRef: Ref<GraphMakerProps['defaultOptions']>,\n fixedOptionsRef: Ref<GraphMakerProps['fixedOptions']>,\n dataColumnPredicate?: (spec: PColumnSpec) => boolean,\n metaColumnPredicate?: (spec: PColumnSpec) => boolean,\n readonlyInputs?: InputNamesByChartType[ChartType][],\n defaultPalette?: GraphMakerProps['defaultPalette'],\n) {\n const reactiveState = createReactiveState(initialState, chartType);\n const controller = getControllerByType(reactiveState.chartType);\n\n const inputGuide = ref<InputGuide<InputState>>(getControllerByType(reactiveState.chartType).getEmptyInputGuide(reactiveState.optionsState));\n const chartData = ref<PlotDataAndSettings | null>(null);\n\n const uniqueValuesData = ref<UniqueValuesBySourceMap>({});\n const facetValuesData = ref<UniqueValuesBySourceMap>({});\n const filterSuggestionsData = ref<FilterSuggestionsBySourceMap>({});\n const filterLabelsInfo = ref<FilterLabelsInfoBySourceMap>({}); // for auto titles of chart if something selected in filter/tabby\n\n const dendroTableData = ref<Awaited<ReturnType<DendroStateController['createTableData']>> | null>(null);\n\n // toRaw removes Vue proxy from dataStore.pframe (PFrame api)\n const store = computed(() => factoryStore(\n reactiveState,\n dataStoreRef,\n inputGuide,\n chartData,\n dendroTableData,\n uniqueValuesData,\n facetValuesData,\n filterSuggestionsData,\n filterLabelsInfo,\n readonlyInputs,\n defaultPalette,\n ));\n\n watch(() => dataStoreRef.value, () => {\n filterLabelsInfo.value = {};\n uniqueValuesData.value = {};\n facetValuesData.value = {};\n filterSuggestionsData.value = {}; // reset saved data; avoid caching of empty results from old empty pframe\n });\n\n const defaultOptionsCounter = ref(0);\n watch([\n () => dataStoreRef.value,\n () => defaultOptionsRef.value,\n ], async ([ds, defaultOptions]) => {\n if (!defaultOptions || defaultOptions?.length === 0 || !ds) {\n return;\n }\n defaultOptionsCounter.value++;\n const counter = defaultOptionsCounter.value;\n store.value.loading.defaults = true;\n if (reactiveState.usedDefaultOptions === null) {\n store.value.loading.initialInputGuide = true;\n }\n const loadedDefaultOptions = await loadDefaultSources(ds, defaultOptions, reactiveState.usedDefaultOptions);\n if (defaultOptionsCounter.value !== counter) {\n return;\n }\n const { usedDefaultOptions, optionsState } = reactiveState;\n const needsToBeUpdated = isOptionsStateNeedsToBeUpdated(optionsState, usedDefaultOptions, loadedDefaultOptions);\n if (!needsToBeUpdated) {\n store.value.loading.defaults = false;\n return;\n }\n store.value.loading.initialCharts = true; // we want to show loader when default are really changed and new chart data is requested\n reactiveState.optionsState.components = createUpdatedWithNewDefaultsOptionsState(optionsState, usedDefaultOptions, loadedDefaultOptions);\n reactiveState.usedDefaultOptions = loadedDefaultOptions;\n }, { immediate: true });\n\n // recalculate input guide - options for every data input, consistency info etc\n const inputGuideCounter = ref(0); // to avoid race condition on async calculations\n watch([\n () => reactiveState.optionsState,\n () => dataStoreRef.value,\n () => fixedOptionsRef.value,\n ], async ([optionsState, ds, fixedOptions]) => {\n if (defaultOptionsRef.value === null || dataStoreRef.value === null) { // they are not ready, waiting for them\n return;\n }\n inputGuideCounter.value++;\n const counter = inputGuideCounter.value;\n store.value.loading.inputGuide = true;\n const ignoredIds = ds && fixedOptions ? Object.values(await loadDefaultSources(ds, fixedOptions, null, false)).flatMap((item) => item.map((s) => s.selectedSource)) : [];\n\n // const start = Date.now();\n const nextInputGuide = ds ? await controller.calculateOptions({ store: toRaw(ds), state: optionsState, fixedIds: ignoredIds, dataColumnPredicate, metaColumnPredicate }) : controller.getEmptyInputGuide(optionsState);\n // console.log('input guide', Date.now() - start);\n\n if (counter === inputGuideCounter.value) { // race condition check\n inputGuide.value = nextInputGuide;\n\n store.value.loading.defaults = false;\n store.value.loading.inputGuide = false;\n if (store.value.loading.initialInputGuide) {\n store.value.loading.initialInputGuide = false;\n }\n }\n }, { immediate: true, deep: true });\n\n // recalculate data for chart rendering (miplots4)\n const chartDataCounter = ref(0); // to avoid race condition on async calculations\n watch(() => inputGuide.value, async (ig) => {\n chartDataCounter.value++;\n const counter = chartDataCounter.value;\n\n store.value.loading.chartData = true;\n\n const ds = toRaw(dataStoreRef.value);\n // const start = Date.now();\n const nextChartData = await loadDataForPlot(ig, reactiveState, ds, fixedOptionsRef.value);\n\n if (nextChartData && ds) {\n const { uniqueValues, filterSuggestions } = await getUniqueValuesFromReadyChartData(\n nextChartData, ig, reactiveState.optionsState.components, controller, ds, toRaw(filterSuggestionsData.value),\n );\n uniqueValuesData.value = uniqueValues;\n facetValuesData.value = getFacetValuesFromReadyChartData(\n nextChartData,\n reactiveState.optionsState.components,\n );\n filterSuggestionsData.value = filterSuggestions;\n updateDataBindAes(reactiveState.optionsState, reactiveState.dataBindAes, uniqueValuesData.value);\n } else {\n facetValuesData.value = {};\n }\n filterLabelsInfo.value = ds\n ? await loadFilterLabelsForTitle(reactiveState.optionsState.components, ig, controller, ds)\n : {};\n // console.log('chart data', Date.now() - start);\n\n if (counter === chartDataCounter.value) { // race condition check\n chartData.value = nextChartData;\n if (ig.ready) {\n store.value.loading.initialCharts = false;\n }\n store.value.loading.chartData = false;\n }\n }, { immediate: true, deep: true });\n\n // watch data for table, only dendro chart; data is also using for popup by tree node click\n if (reactiveState.chartType === 'dendro') {\n const dendroDataCounter = ref(0); // to avoid race condition on async calculations\n watch([\n () => reactiveState.optionsState as DendroUIState,\n () => dataStoreRef.value,\n () => inputGuide.value.readyData,\n () => fixedOptionsRef.value,\n ], async ([optionsState, dataStore, ready, fixed]) => {\n if (ready && dataStore) {\n dendroDataCounter.value++;\n const counter = dendroDataCounter.value;\n store.value.loading.dendroTableData = true;\n const state = (await addFixedOptionsToState(optionsState, dataStore, fixed)) as DendroUIState;\n const nextDendroTableData = await (controller as unknown as DendroStateController).createTableData(dataStore, state);\n\n if (dendroDataCounter.value === counter) {\n dendroTableData.value = nextDendroTableData;\n }\n store.value.loading.dendroTableData = false;\n }\n }, { immediate: true });\n }\n\n provide(storeKey, store);\n return store;\n}\n\nexport function useStore() {\n return notEmpty(inject<ComputedStore>(storeKey), 'Empty store');\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqDA,SAAS,EAAuB,GAAsB,GAAsC;CAC1F,IAAM,IAAe,EAAS,EAAsB,EAAU,CAAC;AAC/D,KAAI,GAAc,SAAS,EACzB,QAAO;CAET,IAAM,IAAmB,EAAS,EAAa;AAE/C,QAAO;EACL,GAAG;EACH,GAAG;EACH,YAAY;GACV,GAAG,EAAa;GAChB,GAAG,EAAiB;GACrB;EACF;;AAGH,SAAgB,EACd,GACA,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,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAEjD,cAAc,SAAS,CAAC"}
|
package/dist/ui.js
CHANGED
package/dist/ui.vue2.js
CHANGED
|
@@ -359,7 +359,7 @@ var pe = { class: "graph-maker" }, T = { class: "graph-maker__main-pane" }, E =
|
|
|
359
359
|
key: 0,
|
|
360
360
|
errorInfo: z.value
|
|
361
361
|
}, null, 8, ["errorInfo"])) : l("", !0),
|
|
362
|
-
Z.value
|
|
362
|
+
Z.value ? (p(), c(oe, {
|
|
363
363
|
key: 1,
|
|
364
364
|
"truncation-warning": Z.value
|
|
365
365
|
}, null, 8, ["truncation-warning"])) : l("", !0)
|
package/dist/ui.vue2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../src/ui.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport './assets/ui.scss';\nimport type {\n ChartInterface,\n DataByColumns,\n ErrorInfo,\n LassoControlsState,\n Settings,\n} from '@milaboratories/miplots4';\nimport { MiPlots } from '@milaboratories/miplots4';\nimport type { ChartType, PlotDataAndSettings } from '@milaboratories/pf-plots';\nimport { DemoDataStore } from '@milaboratories/pf-plots';\nimport type { AxisSpec, PFrameDriver, PlSelectionModel, PTableKey } from '@platforma-sdk/model';\nimport { watchDebounced } from '@vueuse/core';\nimport { computed, onMounted, onUnmounted, ref, shallowRef, toRaw, useSlots, watch } from 'vue';\nimport Chart from './components/Chart.vue';\nimport PanelModal from './components/PanelModal.vue';\nimport VTabs from './components/SettingsTabs/index.vue';\nimport TransitionSlidePanel from './components/TransitionSlidePanel.vue';\nimport ChartErrorNotificationAlert from './components/ChartErrorNotificationAlert.vue';\nimport ChartTruncationWarningAlert from './components/ChartTruncationWarningAlert.vue';\nimport { isOwnGraphMakerTab, useSettingsForm } from './forms';\nimport { createReactiveState, provideStore } from './store';\nimport type { DendroNodeInfo, GraphMakerProps, GraphMakerState, GraphStatus } from './types';\nimport { composeChartSettings, saveToFile } from './utils';\nimport type { ChartTruncationWarning } from './utils/createChartSettingsForRender/composeChartSettings';\nimport { copyJSON } from './utils/copyJSON';\nimport GraphStatusScreen from './components/GraphStatusScreen.vue';\n\nconst _emit = defineEmits(['delete-this-graph', 'tooltip-btn-click']);\n\nconst graphMakerState = defineModel<GraphMakerState>({ required: true });\nconst selectionState = defineModel<PlSelectionModel>('selection');\n\nconst props = defineProps<GraphMakerProps>();\n\ndefineExpose({\n /**\n reset() will update data-mapping, axis-settings, layers-settings with the state that is in v-model at the moment.\n In other cases editing of v-model fields doesn't make any impact to graphs and interface.\n */\n reset,\n});\n\nconst dataStore = ref<DemoDataStore | null>(null);\n\nwatch(() => props.pFrame, (pframe) => {\n if (!pframe.ok || !pframe.value) {\n dataStore.value = null;\n return;\n }\n const driver = ('platforma' in window) ? window.platforma?.pFrameDriver as PFrameDriver : props.driver;\n if (!driver) {\n throw new Error('PFrame driver is missing');\n }\n dataStore.value = new DemoDataStore(\n pframe.value,\n driver,\n props.labelsModifier,\n );\n}, { immediate: true, deep: true });\n\n// fixed options can be updated outside, other settings only inside from chart settings interface, so we don't watching other settings\nconst fixedOptions = ref<typeof props.fixedOptions>(props.fixedOptions ?? []);\nwatch(() => props.fixedOptions, (value, oldValue) => {\n if (\n (value && oldValue && JSON.stringify(value) !== JSON.stringify(oldValue))\n || (value && !oldValue)\n || (oldValue && !value)\n ) {\n fixedOptions.value = value;\n }\n}, { deep: true });\nconst defaultOptions = ref<typeof props.defaultOptions>(props.defaultOptions);\nwatch(() => props.defaultOptions, (v) => {\n defaultOptions.value = v;\n}, { deep: true });\nconst state = provideStore(\n toRaw(graphMakerState.value),\n dataStore,\n props.chartType,\n defaultOptions,\n fixedOptions,\n props.dataColumnPredicate,\n props.metaColumnPredicate,\n props.readonlyInputs,\n props.defaultPalette,\n);\n\nfunction reset() {\n const nextReactiveState = createReactiveState(\n toRaw(graphMakerState.value),\n props.chartType,\n );\n Object.assign(state.value.reactive, nextReactiveState);\n Object.assign(state.value.loading, {\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n });\n defaultOptions.value = props.defaultOptions;\n}\n\nconst currentForm = computed(() => useSettingsForm(state.value.reactive.currentTab));\n\nconst chartRef = shallowRef<ChartInterface | null>(null);\nconst chartCalculatedDataRef = ref<Record<string, unknown> | null>(null);\nconst chartError = ref(false);\nconst chartErrorInfo = ref<ErrorInfo | null>(null);\n\nconst isRunning = computed(\n () => props.pFrame.ok && !props.pFrame.value && !props.pFrame.stable,\n);\nconst isInitialLoading = computed(\n () => state.value.loading.initialInputGuide && graphStatus.value === 'loading',\n);\n\nwatch(() => isRunning.value, (val, prevVal) => {\n if (val && !prevVal) {\n state.value.reactive.currentTab = null;\n }\n});\n\nconst graphStatus = computed<GraphStatus>((previousStatus) => {\n if (isRunning.value) {\n return 'running';\n }\n if (props.pFrame.ok && props.pFrame.stable && !props.pFrame.value) {\n return 'noPframe';\n }\n if (!props.pFrame.ok) {\n return 'noPframeWithError';\n }\n const inputGuide = state.value.inputGuide.value;\n const chartData = state.value.chartData.value;\n if (!inputGuide.consistent) {\n return 'inconsistent';\n }\n if (!inputGuide.ready) {\n return defaultOptions.value === null\n || state.value.loading.defaults\n || state.value.loading.initialInputGuide\n ? 'loading'\n : 'notReady';\n }\n if (chartData && Object.values(chartData.data.byColumns.values)[0]?.length === 0) {\n return 'empty';\n }\n if (chartError.value) {\n return chartErrorInfo.value?.type === 'unknownError' ? 'unknownError' : 'knownError';\n }\n if (\n (state.value.loading.initialCharts || (previousStatus !== 'ready' && state.value.loading.chartData) || state.value.loading.chartRendering)\n || (chartRef.value === null && (state.value.loading.inputGuide || state.value.loading.chartData))\n ) {\n return 'loading';\n }\n return 'ready';\n});\n\nfunction onTreeNodeClick(d: DendroNodeInfo) {\n state.value.reactive.dendroSelectedNodeId = d?.info[0]?.id as number;\n state.value.reactive.dendroInfoByClick = d;\n}\n\nconst tooltipHintHideTimerRef = ref<ReturnType<typeof setTimeout> | null>(null);\n\nfunction onTooltipHintSwitch(v: boolean) {\n const reactive = state.value.reactive;\n if (v) {\n if (reactive.tooltipHintWasShown) return;\n if (tooltipHintHideTimerRef.value) {\n clearTimeout(tooltipHintHideTimerRef.value);\n tooltipHintHideTimerRef.value = null;\n }\n reactive.showTooltipHint = true;\n tooltipHintHideTimerRef.value = setTimeout(() => {\n reactive.showTooltipHint = false;\n reactive.tooltipHintWasShown = true;\n tooltipHintHideTimerRef.value = null;\n }, 3000);\n } else {\n reactive.showTooltipHint = false;\n }\n}\n\nfunction onLassoPolygonUpdate(dotIndexes: number[], polygons: { points: [number, number][]; closed: boolean }[]) {\n graphMakerState.value = {\n ...graphMakerState.value,\n selectedPolygons: polygons,\n };\n\n const axesData = state.value.chartData.value?.data?.axesData;\n if (dotIndexes.length === 0 || !axesData) {\n selectionState.value = { axesSpec: [], selectedKeys: [] };\n return;\n }\n\n const axisKeys = Object.keys(axesData);\n const inputGuide = state.value.inputGuide.value;\n selectionState.value = {\n axesSpec: axisKeys.map((axisKey) => inputGuide.getSourceInfo(axisKey).spec as AxisSpec),\n selectedKeys: dotIndexes.map((idx) => axisKeys.map((axisKey) => axesData[axisKey][idx]) as PTableKey),\n };\n}\n\nfunction onLassoStateChange(v: LassoControlsState) {\n state.value.reactive.lassoControlsState = v;\n}\nlet chartRenderingInProgress: ReturnType<typeof setTimeout> | null = null;\nfunction onLoadingStateChange(v: boolean) {\n if (v) {\n chartRenderingInProgress = setTimeout(() => {\n state.value.loading.chartRendering = true;\n }, 1000);\n } else {\n if (chartRenderingInProgress) {\n clearTimeout(chartRenderingInProgress);\n }\n state.value.loading.chartRendering = false;\n }\n}\nconst isScatterplotZoomChanged = ref(false);\nfunction onZoomChange(isZoomChanged: boolean) {\n isScatterplotZoomChanged.value = isZoomChanged;\n}\nconst graphEventHandlers: Record<ChartType, unknown> = {\n 'dendro': [onTreeNodeClick],\n 'scatterplot-umap': {\n onPolygonUpdate: onLassoPolygonUpdate,\n onTooltipHintSwitch,\n onLassoControlsStateUpdate: onLassoStateChange,\n onZoomChange,\n },\n 'discrete': [onTooltipHintSwitch],\n 'scatterplot': {\n onPolygonUpdate: onLassoPolygonUpdate,\n onTooltipHintSwitch,\n onLassoControlsStateUpdate: onLassoStateChange,\n },\n 'histogram': [onTooltipHintSwitch],\n 'heatmap': { onTooltipHintSwitch, onLoadingChange: onLoadingStateChange },\n 'bubble': [onTooltipHintSwitch],\n};\nfunction updateChart(value: { data: PlotDataAndSettings['data']['byColumns']; settings: PlotDataAndSettings['settings'] } | null) {\n // if dataByColumns exists but columns has no data - show empty chart\n if (value && Object.values(value.data.values)[0]?.length > 0) {\n // console.log('value.dataByColumns', toRaw(value.data));\n // console.log('value.settings', toRaw(value.settings));\n if (chartRef.value) {\n chartRef.value.updateSettingsAndData({ ...toRaw(value.data), id: value.data.id + (props.pFrame.ok ? props.pFrame.value : '') }, toRaw(value.settings) as Settings);\n } else {\n const htmlNode = document.getElementById('chartSvgContainer');\n if (htmlNode) {\n chartRef.value = MiPlots.newPlot(toRaw(value.data), toRaw(value.settings) as Settings, graphEventHandlers[value.settings.type as ChartType]);\n if (value.settings.type === 'scatterplot-umap') {\n // set default polygons (from props)\n chartRef.value.updateChartState('polygon', graphMakerState.value.selectedPolygons ?? []);\n }\n chartRef.value.mount(htmlNode);\n }\n }\n // calculated by chart renderer data, tree hierarchy for example\n chartCalculatedDataRef.value = chartRef.value?.calculatedData ? { ...chartRef.value.calculatedData } : null;\n chartError.value = chartRef.value?.hasError ?? false;\n chartErrorInfo.value = chartRef.value?.errorInfo ?? null;\n } else {\n chartRef.value?.unmount();\n chartRef.value = null;\n chartErrorInfo.value = null;\n }\n}\n\nwatch(() => graphStatus.value, (v) => {\n if (v === 'notReady' || v === 'noPframe' || dataStore.value === null) {\n chartRef.value?.unmount();\n chartRef.value = null;\n }\n});\n\nconst chartDataForRender = shallowRef<{ settings: Settings; data: DataByColumns } | null>(null);\nconst chartTruncationWarning = ref<ChartTruncationWarning | null>(null);\n\nfunction applyComposeResult(result: ReturnType<typeof composeChartSettings>) {\n if (!result) {\n chartDataForRender.value = null;\n chartTruncationWarning.value = null;\n return;\n }\n chartDataForRender.value = { settings: result.settings, data: result.data };\n chartTruncationWarning.value = result.truncationWarning;\n}\n\nwatch([\n () => state.value.chartData.value,\n], ([chartData]) => {\n applyComposeResult(composeChartSettings(\n toRaw(chartData),\n toRaw(state.value.inputGuide.value),\n toRaw(state.value.uniqueValuesData.value),\n toRaw(state.value.filterLabelsInfo.value),\n toRaw(state.value.reactive),\n toRaw(state.value.defaultPalette),\n toRaw(state.value.facetValuesData.value),\n ));\n});\nwatch([\n () => state.value.reactive.template,\n () => state.value.reactive.layersSettings,\n () => state.value.reactive.axesSettings,\n () => state.value.reactive.statisticsSettings,\n () => state.value.reactive.dataBindAes,\n () => state.value.reactive.chartScale,\n], () => {\n applyComposeResult(composeChartSettings(\n toRaw(state.value.chartData.value),\n toRaw(state.value.inputGuide.value),\n toRaw(state.value.uniqueValuesData.value),\n toRaw(state.value.filterLabelsInfo.value),\n toRaw(state.value.reactive),\n toRaw(state.value.defaultPalette),\n toRaw(state.value.facetValuesData.value),\n ));\n}, { deep: true });\n\nwatch(() => chartDataForRender.value, (chartData) => {\n updateChart(chartData);\n});\nonMounted(() => {\n updateChart(null);\n});\nonUnmounted(() => {\n if (tooltipHintHideTimerRef.value) {\n clearTimeout(tooltipHintHideTimerRef.value);\n tooltipHintHideTimerRef.value = null;\n }\n chartRef.value?.unmount();\n});\n\nwatchDebounced(() => state.value.reactive.optionsState, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n optionsState: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.usedDefaultOptions, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n usedDefaultOptions: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.statisticsSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n statisticsSettings: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.axesSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n axesSettings: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.layersSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n layersSettings: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.dataBindAes, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n dataBindAes: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\n\nwatchDebounced([\n () => state.value.reactive.chartScale,\n () => state.value.reactive.template,\n () => state.value.reactive.currentTab,\n], ([zoomState, template, currentTab]) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n zoomState,\n template,\n currentTab,\n };\n}, { debounce: 1000 });\n\nwatch(() => state.value.reactive.tooltipHintWasShown, (v) => {\n if (v) {\n graphMakerState.value = { ...graphMakerState.value, tooltipHintWasShown: true };\n }\n});\n\nwatch(() => graphMakerState.value.currentTab, (v) => {\n state.value.reactive.currentTab = v === undefined ? 'dataMapping' : v;\n});\n\nwatch(() => graphMakerState.value?.layersSettings?.dendro?.showTable, (v) => {\n state.value.reactive.layersSettings.dendro.showTable = v ?? false;\n});\n\nfunction onExport() {\n saveToFile(\n new Blob([\n chartRef.value?.export() ?? '',\n ]),\n 'chart.svg',\n );\n}\n\nfunction updateGraphTitle(nextTitle: string) {\n graphMakerState.value = {\n ...graphMakerState.value,\n title: nextTitle,\n };\n}\n\nfunction selectTreeNode(id: number | null) {\n state.value.reactive.dendroSelectedNodeId = id;\n chartRef.value?.updateChartState('selectedNode', id);\n}\n\nconst slots = useSlots();\n\nconst hasAnnotationsSlot = computed(() => Boolean(slots.annotationsSlot));\nconst hasSettingsSlot = computed(() => Boolean(slots.settingsSlot));\nconst hasLogSlot = computed(() => Boolean(slots.logSlot));\n\n</script>\n\n<template>\n <div class=\"graph-maker\">\n <div class=\"graph-maker__main-pane\">\n <Chart\n :graph-status=\"graphStatus\" :graphTitle=\"graphMakerState.title\" :chartData=\"chartCalculatedDataRef\"\n :chart-ref=\"chartRef\" :error-info=\"chartErrorInfo\" :dendroTooltipButton=\"tooltipButton\"\n :custom-status-text=\"statusText\"\n :allow-title-editing=\"allowTitleEditing\"\n :isScatterplotZoomChanged=\"isScatterplotZoomChanged\"\n @graph-title-update=\"updateGraphTitle\" @dendro-node-select=\"selectTreeNode\"\n @dendro-tooltip-btn-click=\"(id: string) => $emit('tooltip-btn-click', id)\"\n >\n <slot name=\"titleLineSlot\" />\n </Chart>\n <GraphStatusScreen v-if=\"isInitialLoading || isRunning\" :graphStatus=\"isRunning ? 'running' : 'loading'\" :top=\"67\" :left=\"12\" :right=\"12\" :bottom=\"12\" :customStatusText=\"statusText\" />\n <TransitionSlidePanel id=\"graph-settings-modal\">\n <PanelModal\n v-if=\"state.reactive.currentTab && !((isInitialLoading || isRunning) && isOwnGraphMakerTab(state.reactive.currentTab))\"\n @close=\"state.reactive.currentTab = null\"\n >\n <component :is=\"currentForm.value\">\n <slot v-if=\"state.reactive.currentTab === 'annotations'\" name=\"annotationsSlot\" />\n <slot v-if=\"state.reactive.currentTab === 'settings'\" name=\"settingsSlot\" />\n <slot v-if=\"state.reactive.currentTab === 'log'\" name=\"logSlot\" />\n </component>\n </PanelModal>\n </TransitionSlidePanel>\n </div>\n <VTabs\n v-model=\"state.reactive.currentTab\" :chart-type=\"state.reactive.chartType\" :graph-status=\"graphStatus\"\n :allowDeleting=\"allowChartDeleting\" :hasAnnotationsSlot=\"hasAnnotationsSlot\" :hasSettingsSlot=\"hasSettingsSlot\"\n :hasLogSlot=\"hasLogSlot\" :initialLoading=\"isInitialLoading || isRunning\" @export=\"onExport\"\n @delete=\"$emit('delete-this-graph')\"\n />\n <ChartErrorNotificationAlert v-if=\"chartErrorInfo?.type === 'unknownError'\" :errorInfo=\"chartErrorInfo\" />\n <ChartTruncationWarningAlert\n v-if=\"chartTruncationWarning && (chartTruncationWarning.groups || chartTruncationWarning.facets)\"\n :truncation-warning=\"chartTruncationWarning\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BA,IAAM,IAAkB,EAA4B,GAAA,aAAoB,EAClE,IAAiB,EAA6B,GAAC,YAAY,EAE3D,IAAQ;AAEd,IAAa,EAKX,UACD,CAAC;EAEF,IAAM,IAAY,EAA0B,KAAK;AAEjD,UAAY,EAAM,SAAS,MAAW;AACpC,OAAI,CAAC,EAAO,MAAM,CAAC,EAAO,OAAO;AAC/B,MAAU,QAAQ;AAClB;;GAEF,IAAM,IAAU,eAAe,SAAU,OAAO,WAAW,eAA+B,EAAM;AAChG,OAAI,CAAC,EACH,OAAU,MAAM,2BAA2B;AAE7C,KAAU,QAAQ,IAAI,EACpB,EAAO,OACP,GACA,EAAM,eACP;KACA;GAAE,WAAW;GAAM,MAAM;GAAM,CAAC;EAGnC,IAAM,IAAe,EAA+B,EAAM,gBAAgB,EAAE,CAAC;AAC7E,UAAY,EAAM,eAAe,GAAO,MAAa;AACnD,IACG,KAAS,KAAY,KAAK,UAAU,EAAM,KAAK,KAAK,UAAU,EAAS,IACpE,KAAS,CAAC,KACV,KAAY,CAAC,OAEjB,EAAa,QAAQ;KAEtB,EAAE,MAAM,IAAM,CAAC;EAClB,IAAM,IAAiB,EAAiC,EAAM,eAAe;AAC7E,UAAY,EAAM,iBAAiB,MAAM;AACvC,KAAe,QAAQ;KACtB,EAAE,MAAM,IAAM,CAAC;EAClB,IAAM,IAAQ,GACZ,EAAM,EAAgB,MAAM,EAC5B,GACA,EAAM,WACN,GACA,GACA,EAAM,qBACN,EAAM,qB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AAA,QAAA,MAAEA,EAAAA,MAAK,oBAAA;;;;;;;;;;;GAEmB,EAAA,OAAgB,SAAI,kBAAA,GAAA,EAAvD,EAA0G,GAAA;;IAA7B,WAAW,EAAA;;GAEhF,EAAA,UAA2B,EAAA,MAAuB,UAAU,EAAA,MAAuB,WAAA,GAAA,EAD3F,EAGE,IAAA;;IADC,sBAAoB,EAAA"}
|
|
1
|
+
{"version":3,"file":"ui.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../src/ui.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport './assets/ui.scss';\nimport type {\n ChartInterface,\n DataByColumns,\n ErrorInfo,\n LassoControlsState,\n Settings,\n} from '@milaboratories/miplots4';\nimport { MiPlots } from '@milaboratories/miplots4';\nimport type { ChartType, PlotDataAndSettings } from '@milaboratories/pf-plots';\nimport { DemoDataStore } from '@milaboratories/pf-plots';\nimport type { AxisSpec, PFrameDriver, PlSelectionModel, PTableKey } from '@platforma-sdk/model';\nimport { watchDebounced } from '@vueuse/core';\nimport { computed, onMounted, onUnmounted, ref, shallowRef, toRaw, useSlots, watch } from 'vue';\nimport Chart from './components/Chart.vue';\nimport PanelModal from './components/PanelModal.vue';\nimport VTabs from './components/SettingsTabs/index.vue';\nimport TransitionSlidePanel from './components/TransitionSlidePanel.vue';\nimport ChartErrorNotificationAlert from './components/ChartErrorNotificationAlert.vue';\nimport ChartTruncationWarningAlert from './components/ChartTruncationWarningAlert.vue';\nimport { isOwnGraphMakerTab, useSettingsForm } from './forms';\nimport { createReactiveState, provideStore } from './store';\nimport type { DendroNodeInfo, GraphMakerProps, GraphMakerState, GraphStatus } from './types';\nimport { composeChartSettings, saveToFile } from './utils';\nimport type { ChartTruncationWarning } from './utils/createChartSettingsForRender/composeChartSettings';\nimport { copyJSON } from './utils/copyJSON';\nimport GraphStatusScreen from './components/GraphStatusScreen.vue';\n\nconst _emit = defineEmits(['delete-this-graph', 'tooltip-btn-click']);\n\nconst graphMakerState = defineModel<GraphMakerState>({ required: true });\nconst selectionState = defineModel<PlSelectionModel>('selection');\n\nconst props = defineProps<GraphMakerProps>();\n\ndefineExpose({\n /**\n reset() will update data-mapping, axis-settings, layers-settings with the state that is in v-model at the moment.\n In other cases editing of v-model fields doesn't make any impact to graphs and interface.\n */\n reset,\n});\n\nconst dataStore = ref<DemoDataStore | null>(null);\n\nwatch(() => props.pFrame, (pframe) => {\n if (!pframe.ok || !pframe.value) {\n dataStore.value = null;\n return;\n }\n const driver = ('platforma' in window) ? window.platforma?.pFrameDriver as PFrameDriver : props.driver;\n if (!driver) {\n throw new Error('PFrame driver is missing');\n }\n dataStore.value = new DemoDataStore(\n pframe.value,\n driver,\n props.labelsModifier,\n );\n}, { immediate: true, deep: true });\n\n// fixed options can be updated outside, other settings only inside from chart settings interface, so we don't watching other settings\nconst fixedOptions = ref<typeof props.fixedOptions>(props.fixedOptions ?? []);\nwatch(() => props.fixedOptions, (value, oldValue) => {\n if (\n (value && oldValue && JSON.stringify(value) !== JSON.stringify(oldValue))\n || (value && !oldValue)\n || (oldValue && !value)\n ) {\n fixedOptions.value = value;\n }\n}, { deep: true });\nconst defaultOptions = ref<typeof props.defaultOptions>(props.defaultOptions);\nwatch(() => props.defaultOptions, (v) => {\n defaultOptions.value = v;\n}, { deep: true });\nconst state = provideStore(\n toRaw(graphMakerState.value),\n dataStore,\n props.chartType,\n defaultOptions,\n fixedOptions,\n props.dataColumnPredicate,\n props.metaColumnPredicate,\n props.readonlyInputs,\n props.defaultPalette,\n);\n\nfunction reset() {\n const nextReactiveState = createReactiveState(\n toRaw(graphMakerState.value),\n props.chartType,\n );\n Object.assign(state.value.reactive, nextReactiveState);\n Object.assign(state.value.loading, {\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n });\n defaultOptions.value = props.defaultOptions;\n}\n\nconst currentForm = computed(() => useSettingsForm(state.value.reactive.currentTab));\n\nconst chartRef = shallowRef<ChartInterface | null>(null);\nconst chartCalculatedDataRef = ref<Record<string, unknown> | null>(null);\nconst chartError = ref(false);\nconst chartErrorInfo = ref<ErrorInfo | null>(null);\n\nconst isRunning = computed(\n () => props.pFrame.ok && !props.pFrame.value && !props.pFrame.stable,\n);\nconst isInitialLoading = computed(\n () => state.value.loading.initialInputGuide && graphStatus.value === 'loading',\n);\n\nwatch(() => isRunning.value, (val, prevVal) => {\n if (val && !prevVal) {\n state.value.reactive.currentTab = null;\n }\n});\n\nconst graphStatus = computed<GraphStatus>((previousStatus) => {\n if (isRunning.value) {\n return 'running';\n }\n if (props.pFrame.ok && props.pFrame.stable && !props.pFrame.value) {\n return 'noPframe';\n }\n if (!props.pFrame.ok) {\n return 'noPframeWithError';\n }\n const inputGuide = state.value.inputGuide.value;\n const chartData = state.value.chartData.value;\n if (!inputGuide.consistent) {\n return 'inconsistent';\n }\n if (!inputGuide.ready) {\n return defaultOptions.value === null\n || state.value.loading.defaults\n || state.value.loading.initialInputGuide\n ? 'loading'\n : 'notReady';\n }\n if (chartData && Object.values(chartData.data.byColumns.values)[0]?.length === 0) {\n return 'empty';\n }\n if (chartError.value) {\n return chartErrorInfo.value?.type === 'unknownError' ? 'unknownError' : 'knownError';\n }\n if (\n (state.value.loading.initialCharts || (previousStatus !== 'ready' && state.value.loading.chartData) || state.value.loading.chartRendering)\n || (chartRef.value === null && (state.value.loading.inputGuide || state.value.loading.chartData))\n ) {\n return 'loading';\n }\n return 'ready';\n});\n\nfunction onTreeNodeClick(d: DendroNodeInfo) {\n state.value.reactive.dendroSelectedNodeId = d?.info[0]?.id as number;\n state.value.reactive.dendroInfoByClick = d;\n}\n\nconst tooltipHintHideTimerRef = ref<ReturnType<typeof setTimeout> | null>(null);\n\nfunction onTooltipHintSwitch(v: boolean) {\n const reactive = state.value.reactive;\n if (v) {\n if (reactive.tooltipHintWasShown) return;\n if (tooltipHintHideTimerRef.value) {\n clearTimeout(tooltipHintHideTimerRef.value);\n tooltipHintHideTimerRef.value = null;\n }\n reactive.showTooltipHint = true;\n tooltipHintHideTimerRef.value = setTimeout(() => {\n reactive.showTooltipHint = false;\n reactive.tooltipHintWasShown = true;\n tooltipHintHideTimerRef.value = null;\n }, 3000);\n } else {\n reactive.showTooltipHint = false;\n }\n}\n\nfunction onLassoPolygonUpdate(dotIndexes: number[], polygons: { points: [number, number][]; closed: boolean }[]) {\n graphMakerState.value = {\n ...graphMakerState.value,\n selectedPolygons: polygons,\n };\n\n const axesData = state.value.chartData.value?.data?.axesData;\n if (dotIndexes.length === 0 || !axesData) {\n selectionState.value = { axesSpec: [], selectedKeys: [] };\n return;\n }\n\n const axisKeys = Object.keys(axesData);\n const inputGuide = state.value.inputGuide.value;\n selectionState.value = {\n axesSpec: axisKeys.map((axisKey) => inputGuide.getSourceInfo(axisKey).spec as AxisSpec),\n selectedKeys: dotIndexes.map((idx) => axisKeys.map((axisKey) => axesData[axisKey][idx]) as PTableKey),\n };\n}\n\nfunction onLassoStateChange(v: LassoControlsState) {\n state.value.reactive.lassoControlsState = v;\n}\nlet chartRenderingInProgress: ReturnType<typeof setTimeout> | null = null;\nfunction onLoadingStateChange(v: boolean) {\n if (v) {\n chartRenderingInProgress = setTimeout(() => {\n state.value.loading.chartRendering = true;\n }, 1000);\n } else {\n if (chartRenderingInProgress) {\n clearTimeout(chartRenderingInProgress);\n }\n state.value.loading.chartRendering = false;\n }\n}\nconst isScatterplotZoomChanged = ref(false);\nfunction onZoomChange(isZoomChanged: boolean) {\n isScatterplotZoomChanged.value = isZoomChanged;\n}\nconst graphEventHandlers: Record<ChartType, unknown> = {\n 'dendro': [onTreeNodeClick],\n 'scatterplot-umap': {\n onPolygonUpdate: onLassoPolygonUpdate,\n onTooltipHintSwitch,\n onLassoControlsStateUpdate: onLassoStateChange,\n onZoomChange,\n },\n 'discrete': [onTooltipHintSwitch],\n 'scatterplot': {\n onPolygonUpdate: onLassoPolygonUpdate,\n onTooltipHintSwitch,\n onLassoControlsStateUpdate: onLassoStateChange,\n },\n 'histogram': [onTooltipHintSwitch],\n 'heatmap': { onTooltipHintSwitch, onLoadingChange: onLoadingStateChange },\n 'bubble': [onTooltipHintSwitch],\n};\nfunction updateChart(value: { data: PlotDataAndSettings['data']['byColumns']; settings: PlotDataAndSettings['settings'] } | null) {\n // if dataByColumns exists but columns has no data - show empty chart\n if (value && Object.values(value.data.values)[0]?.length > 0) {\n // console.log('value.dataByColumns', toRaw(value.data));\n // console.log('value.settings', toRaw(value.settings));\n if (chartRef.value) {\n chartRef.value.updateSettingsAndData({ ...toRaw(value.data), id: value.data.id + (props.pFrame.ok ? props.pFrame.value : '') }, toRaw(value.settings) as Settings);\n } else {\n const htmlNode = document.getElementById('chartSvgContainer');\n if (htmlNode) {\n chartRef.value = MiPlots.newPlot(toRaw(value.data), toRaw(value.settings) as Settings, graphEventHandlers[value.settings.type as ChartType]);\n if (value.settings.type === 'scatterplot-umap') {\n // set default polygons (from props)\n chartRef.value.updateChartState('polygon', graphMakerState.value.selectedPolygons ?? []);\n }\n chartRef.value.mount(htmlNode);\n }\n }\n // calculated by chart renderer data, tree hierarchy for example\n chartCalculatedDataRef.value = chartRef.value?.calculatedData ? { ...chartRef.value.calculatedData } : null;\n chartError.value = chartRef.value?.hasError ?? false;\n chartErrorInfo.value = chartRef.value?.errorInfo ?? null;\n } else {\n chartRef.value?.unmount();\n chartRef.value = null;\n chartErrorInfo.value = null;\n }\n}\n\nwatch(() => graphStatus.value, (v) => {\n if (v === 'notReady' || v === 'noPframe' || dataStore.value === null) {\n chartRef.value?.unmount();\n chartRef.value = null;\n }\n});\n\nconst chartDataForRender = shallowRef<{ settings: Settings; data: DataByColumns } | null>(null);\nconst chartTruncationWarning = ref<ChartTruncationWarning | null>(null);\n\nfunction applyComposeResult(result: ReturnType<typeof composeChartSettings>) {\n if (!result) {\n chartDataForRender.value = null;\n chartTruncationWarning.value = null;\n return;\n }\n chartDataForRender.value = { settings: result.settings, data: result.data };\n chartTruncationWarning.value = result.truncationWarning;\n}\n\nwatch([\n () => state.value.chartData.value,\n], ([chartData]) => {\n applyComposeResult(composeChartSettings(\n toRaw(chartData),\n toRaw(state.value.inputGuide.value),\n toRaw(state.value.uniqueValuesData.value),\n toRaw(state.value.filterLabelsInfo.value),\n toRaw(state.value.reactive),\n toRaw(state.value.defaultPalette),\n toRaw(state.value.facetValuesData.value),\n ));\n});\nwatch([\n () => state.value.reactive.template,\n () => state.value.reactive.layersSettings,\n () => state.value.reactive.axesSettings,\n () => state.value.reactive.statisticsSettings,\n () => state.value.reactive.dataBindAes,\n () => state.value.reactive.chartScale,\n], () => {\n applyComposeResult(composeChartSettings(\n toRaw(state.value.chartData.value),\n toRaw(state.value.inputGuide.value),\n toRaw(state.value.uniqueValuesData.value),\n toRaw(state.value.filterLabelsInfo.value),\n toRaw(state.value.reactive),\n toRaw(state.value.defaultPalette),\n toRaw(state.value.facetValuesData.value),\n ));\n}, { deep: true });\n\nwatch(() => chartDataForRender.value, (chartData) => {\n updateChart(chartData);\n});\nonMounted(() => {\n updateChart(null);\n});\nonUnmounted(() => {\n if (tooltipHintHideTimerRef.value) {\n clearTimeout(tooltipHintHideTimerRef.value);\n tooltipHintHideTimerRef.value = null;\n }\n chartRef.value?.unmount();\n});\n\nwatchDebounced(() => state.value.reactive.optionsState, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n optionsState: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.usedDefaultOptions, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n usedDefaultOptions: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.statisticsSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n statisticsSettings: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.axesSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n axesSettings: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.layersSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n layersSettings: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\nwatchDebounced(() => state.value.reactive.dataBindAes, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n dataBindAes: copyJSON(v),\n };\n}, { deep: true, debounce: 1000 });\n\nwatchDebounced([\n () => state.value.reactive.chartScale,\n () => state.value.reactive.template,\n () => state.value.reactive.currentTab,\n], ([zoomState, template, currentTab]) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n zoomState,\n template,\n currentTab,\n };\n}, { debounce: 1000 });\n\nwatch(() => state.value.reactive.tooltipHintWasShown, (v) => {\n if (v) {\n graphMakerState.value = { ...graphMakerState.value, tooltipHintWasShown: true };\n }\n});\n\nwatch(() => graphMakerState.value.currentTab, (v) => {\n state.value.reactive.currentTab = v === undefined ? 'dataMapping' : v;\n});\n\nwatch(() => graphMakerState.value?.layersSettings?.dendro?.showTable, (v) => {\n state.value.reactive.layersSettings.dendro.showTable = v ?? false;\n});\n\nfunction onExport() {\n saveToFile(\n new Blob([\n chartRef.value?.export() ?? '',\n ]),\n 'chart.svg',\n );\n}\n\nfunction updateGraphTitle(nextTitle: string) {\n graphMakerState.value = {\n ...graphMakerState.value,\n title: nextTitle,\n };\n}\n\nfunction selectTreeNode(id: number | null) {\n state.value.reactive.dendroSelectedNodeId = id;\n chartRef.value?.updateChartState('selectedNode', id);\n}\n\nconst slots = useSlots();\n\nconst hasAnnotationsSlot = computed(() => Boolean(slots.annotationsSlot));\nconst hasSettingsSlot = computed(() => Boolean(slots.settingsSlot));\nconst hasLogSlot = computed(() => Boolean(slots.logSlot));\n\n</script>\n\n<template>\n <div class=\"graph-maker\">\n <div class=\"graph-maker__main-pane\">\n <Chart\n :graph-status=\"graphStatus\" :graphTitle=\"graphMakerState.title\" :chartData=\"chartCalculatedDataRef\"\n :chart-ref=\"chartRef\" :error-info=\"chartErrorInfo\" :dendroTooltipButton=\"tooltipButton\"\n :custom-status-text=\"statusText\"\n :allow-title-editing=\"allowTitleEditing\"\n :isScatterplotZoomChanged=\"isScatterplotZoomChanged\"\n @graph-title-update=\"updateGraphTitle\" @dendro-node-select=\"selectTreeNode\"\n @dendro-tooltip-btn-click=\"(id: string) => $emit('tooltip-btn-click', id)\"\n >\n <slot name=\"titleLineSlot\" />\n </Chart>\n <GraphStatusScreen v-if=\"isInitialLoading || isRunning\" :graphStatus=\"isRunning ? 'running' : 'loading'\" :top=\"67\" :left=\"12\" :right=\"12\" :bottom=\"12\" :customStatusText=\"statusText\" />\n <TransitionSlidePanel id=\"graph-settings-modal\">\n <PanelModal\n v-if=\"state.reactive.currentTab && !((isInitialLoading || isRunning) && isOwnGraphMakerTab(state.reactive.currentTab))\"\n @close=\"state.reactive.currentTab = null\"\n >\n <component :is=\"currentForm.value\">\n <slot v-if=\"state.reactive.currentTab === 'annotations'\" name=\"annotationsSlot\" />\n <slot v-if=\"state.reactive.currentTab === 'settings'\" name=\"settingsSlot\" />\n <slot v-if=\"state.reactive.currentTab === 'log'\" name=\"logSlot\" />\n </component>\n </PanelModal>\n </TransitionSlidePanel>\n </div>\n <VTabs\n v-model=\"state.reactive.currentTab\" :chart-type=\"state.reactive.chartType\" :graph-status=\"graphStatus\"\n :allowDeleting=\"allowChartDeleting\" :hasAnnotationsSlot=\"hasAnnotationsSlot\" :hasSettingsSlot=\"hasSettingsSlot\"\n :hasLogSlot=\"hasLogSlot\" :initialLoading=\"isInitialLoading || isRunning\" @export=\"onExport\"\n @delete=\"$emit('delete-this-graph')\"\n />\n <ChartErrorNotificationAlert v-if=\"chartErrorInfo?.type === 'unknownError'\" :errorInfo=\"chartErrorInfo\" />\n <ChartTruncationWarningAlert\n v-if=\"chartTruncationWarning\"\n :truncation-warning=\"chartTruncationWarning\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BA,IAAM,IAAkB,EAA4B,GAAA,aAAoB,EAClE,IAAiB,EAA6B,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