@milaboratories/graph-maker 1.1.195 → 1.1.197
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/AesSettings/AesDataMappingDiscrete.vue2.js +127 -130
- package/dist/components/AesSettings/AesDataMappingDiscrete.vue2.js.map +1 -1
- package/dist/components/AesSettings/DiscreteRow.vue2.js +18 -18
- package/dist/components/AesSettings/DiscreteRow.vue2.js.map +1 -1
- package/dist/components/AesSettings/DiscreteRow.vue3.js +10 -8
- package/dist/components/AesSettings/DiscreteRow.vue3.js.map +1 -1
- package/dist/components/Chart.vue.js +118 -112
- package/dist/components/Chart.vue.js.map +1 -1
- package/dist/components/CollapsableBlock.vue.d.ts +1 -0
- package/dist/components/CollapsableBlock.vue.js +27 -21
- package/dist/components/CollapsableBlock.vue.js.map +1 -1
- package/dist/constantsCommon.d.ts +2 -0
- package/dist/constantsCommon.js +24 -16
- package/dist/constantsCommon.js.map +1 -1
- package/dist/forms/AxesSettingsForm/BubbleAxesSettingsForm.vue.js +156 -117
- package/dist/forms/AxesSettingsForm/BubbleAxesSettingsForm.vue.js.map +1 -1
- package/dist/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js +162 -134
- package/dist/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js.map +1 -1
- package/dist/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.js +175 -153
- package/dist/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.js.map +1 -1
- package/dist/forms/AxesSettingsForm/HistogramAxesSettingsForm.vue.js +177 -136
- package/dist/forms/AxesSettingsForm/HistogramAxesSettingsForm.vue.js.map +1 -1
- package/dist/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.js +243 -203
- package/dist/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.js.map +1 -1
- package/dist/forms/LayersForm/Layer/Bubble.vue.js +39 -43
- package/dist/forms/LayersForm/Layer/Bubble.vue.js.map +1 -1
- package/dist/forms/LayersForm/Layer/discrete/Bar.vue.js +30 -34
- package/dist/forms/LayersForm/Layer/discrete/Bar.vue.js.map +1 -1
- package/dist/forms/LayersForm/Layer/discrete/Errorbar.vue.js +24 -26
- package/dist/forms/LayersForm/Layer/discrete/Errorbar.vue.js.map +1 -1
- package/dist/forms/LayersForm/Layer/discrete/Line.vue.js +27 -29
- package/dist/forms/LayersForm/Layer/discrete/Line.vue.js.map +1 -1
- package/dist/forms/LayersForm/Layer/discrete/StackedArea.vue.js +38 -43
- package/dist/forms/LayersForm/Layer/discrete/StackedArea.vue.js.map +1 -1
- package/dist/forms/LayersForm/Layer/discrete/StackedBar.vue.js +31 -36
- package/dist/forms/LayersForm/Layer/discrete/StackedBar.vue.js.map +1 -1
- package/dist/forms/LayersForm/Layer/heatmap/Heatmap.vue.js +53 -57
- package/dist/forms/LayersForm/Layer/heatmap/Heatmap.vue.js.map +1 -1
- package/dist/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue.js +70 -74
- package/dist/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.vue.js +1 -1
- package/dist/store.d.ts +3 -4
- package/dist/store.js +25 -26
- package/dist/store.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +1 -1
- package/dist/utils/createChartSettingsForRender/composeChartSettings.d.ts +4 -2
- package/dist/utils/createChartSettingsForRender/composeChartSettings.js +22 -22
- package/dist/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
- package/dist/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +7 -5
- package/dist/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +1 -1
- package/dist/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +2 -1
- package/dist/utils/createChartSettingsForRender/composeScatterplotSettings.js +12 -12
- package/dist/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
- package/dist/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +11 -11
- package/dist/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
- package/dist/utils/createChartSettingsForRender/getAxesDataFromForms.js +17 -17
- package/dist/utils/createChartSettingsForRender/getAxesDataFromForms.js.map +1 -1
- package/dist/utils/loadUniqueValuesToSave.d.ts +2 -3
- package/dist/utils/loadUniqueValuesToSave.js +2 -2
- package/dist/utils/loadUniqueValuesToSave.js.map +1 -1
- package/package.json +5 -5
|
@@ -4,7 +4,7 @@ import { getScatterplotAes as K, DEFAULT_LINE_WIDTH as M, DEFAULT_DOT_SIZE as j,
|
|
|
4
4
|
import { getScatterplotLayersSettings as V } from "./getLayersDataFromForms.js";
|
|
5
5
|
import { getAxesDataFromFormsScatterplot as W } from "./getAxesDataFromForms.js";
|
|
6
6
|
import "@milaboratories/pf-plots";
|
|
7
|
-
import { readAnnotation as
|
|
7
|
+
import { readAnnotation as u, Annotation as d } from "@platforma-sdk/model";
|
|
8
8
|
import "vue";
|
|
9
9
|
function B(o, g, e, A, i) {
|
|
10
10
|
var E, y, L, x, N;
|
|
@@ -12,19 +12,19 @@ function B(o, g, e, A, i) {
|
|
|
12
12
|
o.grouping = [...o.grouping ?? []].map((s) => ({ ...s }));
|
|
13
13
|
const n = o.xAxis, h = o.yAxis;
|
|
14
14
|
if (g.selectorStates.length) {
|
|
15
|
-
const s = i.getSourceInfo(c).spec, l =
|
|
15
|
+
const s = i.getSourceInfo(c).spec, l = u(s, d.Graph.Thresholds);
|
|
16
16
|
l && (JSON.parse(l) ?? []).forEach((D) => {
|
|
17
17
|
var b;
|
|
18
|
-
const { columnId:
|
|
19
|
-
|
|
18
|
+
const { columnId: f, value: T } = D;
|
|
19
|
+
f && t.kind === "column" && t.type === f.valueType && t.name === f.name && ((b = o.xAxis) == null ? void 0 : b.scale) === "discrete" && (n.significantLines || (n.significantLines = []), n.significantLines.push(Number(T))), f && r.kind === "column" && r.type === f.valueType && r.name === f.name && (h.significantLines || (h.significantLines = []), h.significantLines.push(Number(T)));
|
|
20
20
|
});
|
|
21
|
-
const m =
|
|
21
|
+
const m = u(s, d.Graph.Palette);
|
|
22
22
|
if (m) {
|
|
23
|
-
const O = JSON.parse(m), { mapping: D = {}, name:
|
|
23
|
+
const O = JSON.parse(m), { mapping: D = {}, name: f = "" } = O;
|
|
24
24
|
o.layers.forEach((S) => {
|
|
25
25
|
S.type === "dots" && (S.aes || (S.aes = {}), S.aes.dotFill = { type: "grouping", value: c });
|
|
26
26
|
});
|
|
27
|
-
const T = [...Object.entries(D), ["null", U]], b = ((x = F[
|
|
27
|
+
const T = [...Object.entries(D), ["null", U]], b = ((x = F[f]) == null ? void 0 : x.colors) ?? [];
|
|
28
28
|
(N = o.grouping) == null || N.forEach((S) => {
|
|
29
29
|
S.columnName.value === c && (S.inheritedAes = T.reduce((_, [R, C]) => {
|
|
30
30
|
const I = b[Number(C)] ?? w;
|
|
@@ -41,17 +41,17 @@ function B(o, g, e, A, i) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
if (t.annotations) {
|
|
44
|
-
const s =
|
|
44
|
+
const s = u(t, d.Graph.Axis.UpperLimit), l = u(t, d.Graph.Axis.LowerLimit), m = u(t, d.Graph.Axis.SymmetricRange);
|
|
45
45
|
s && (n.upperValue = Number(s)), l && (n.lowerValue = Number(l)), m && (n.symmetricRange = Number(m));
|
|
46
46
|
}
|
|
47
47
|
if (r.annotations) {
|
|
48
|
-
const s =
|
|
48
|
+
const s = u(r, d.Graph.Axis.UpperLimit), l = u(r, d.Graph.Axis.LowerLimit), m = u(r, d.Graph.Axis.SymmetricRange);
|
|
49
49
|
s && (h.upperValue = Number(s)), l && (h.lowerValue = Number(l)), m && (h.symmetricRange = Number(m));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
function H(o, g, e, A, i, c) {
|
|
53
53
|
(g.selectorStates.length || e != null && e.selectorStates.length) && (o.grouping = [...o.grouping ?? []].map((a) => ({ ...a })), o.grouping.forEach((a) => {
|
|
54
|
-
const p = a.columnName.value, t = K(p, A, i, c
|
|
54
|
+
const p = a.columnName.value, t = K(p, A, i, c);
|
|
55
55
|
t.order.length ? (a.order = t.order, a.inheritedAes = t.inheritedAes) : o.layers.forEach((r) => {
|
|
56
56
|
const n = r.aes;
|
|
57
57
|
if (!n)
|
|
@@ -60,7 +60,7 @@ function H(o, g, e, A, i, c) {
|
|
|
60
60
|
var L, x;
|
|
61
61
|
const y = n[E];
|
|
62
62
|
if (G(y) && y.value === p) {
|
|
63
|
-
const N = ((x = F[((L = i[p]) == null ? void 0 : L.palette) ?? c
|
|
63
|
+
const N = ((x = F[((L = i[p]) == null ? void 0 : L.palette) ?? c]) == null ? void 0 : x.colors) ?? [];
|
|
64
64
|
y.palette = N;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
@@ -85,7 +85,7 @@ function v(o, g, e, A, i, c) {
|
|
|
85
85
|
e.optionsState.components.shape,
|
|
86
86
|
i,
|
|
87
87
|
e.dataBindAes,
|
|
88
|
-
c
|
|
88
|
+
c.categorical
|
|
89
89
|
);
|
|
90
90
|
const a = e.statisticsSettings, p = o.layers.find((n) => n.type === "dots");
|
|
91
91
|
return a.trend.on && p && (o.trend = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeScatterplotSettings.js","sources":["../../../src/utils/createChartSettingsForRender/composeScatterplotSettings.ts"],"sourcesContent":["import type { ScatterplotSettings, ScatterplotUmapSettings } from '@milaboratories/miplots4';\nimport type {\n ComponentStateFilter,\n ComponentStateSimple,\n InputGuide,\n InputState,\n PlotDataAndSettings,\n ScatterplotUIState,\n} from '@milaboratories/pf-plots';\nimport {\n DEFAULT_BLACK,\n PALETTE_MAP,\n UNKNOWN_COLOR,\n} from '../../constantsAesthetic';\nimport type {\n MappingLink,\n ScatterplotStatisticsState } from '../../constantsCommon';\nimport {\n isMappedAes,\n SCATTERPLOT_TEMPLATES_MAP,\n} from '../../constantsCommon';\nimport type {\n AestheticMappingState } from '../../dataBindAes';\nimport {\n DEFAULT_DOT_SHAPE,\n DEFAULT_DOT_SIZE,\n DEFAULT_LINE_WIDTH,\n getScatterplotAes,\n} from '../../dataBindAes';\nimport type {\n DefaultPalettes,\n ReactiveState,\n ScatterplotLayersTemplate,\n UniqueValuesBySourceMap,\n} from '../../types';\nimport { getAxesDataFromFormsScatterplot, getScatterplotLayersSettings } from '../index';\nimport type { AxisSettingsContinuous } from '@milaboratories/miplots4';\nimport { Annotation, readAnnotation } from '@platforma-sdk/model';\n\nexport function applyChartInfoFromAnnotations(\n settings: ScatterplotSettings | ScatterplotUmapSettings,\n grouping: ComponentStateSimple | ComponentStateFilter,\n x: ComponentStateSimple | ComponentStateFilter,\n y: ComponentStateSimple | ComponentStateFilter,\n inputGuide: InputGuide<InputState>,\n) {\n const groupingSource = grouping.selectorStates[0]?.selectedSource;\n const xSource = x.selectorStates[0]?.selectedSource;\n const ySource = y.selectorStates[0]?.selectedSource;\n const xInfo = inputGuide.getSourceInfo(xSource);\n const yInfo = inputGuide.getSourceInfo(ySource);\n\n settings.grouping = [...(settings.grouping ?? [])].map((v) => ({ ...v }));\n\n const xAxis = settings.xAxis as AxisSettingsContinuous;\n const yAxis = settings.yAxis as AxisSettingsContinuous;\n if (grouping.selectorStates.length) {\n const spec = inputGuide.getSourceInfo(groupingSource).spec;\n const thresholds = readAnnotation(spec, Annotation.Graph.Thresholds);\n if (thresholds) {\n const thresholdsData = JSON.parse(thresholds) ?? [];\n\n thresholdsData.forEach((thresholdData: { columnId: Record<string, string>; value: number }) => {\n const { columnId, value } = thresholdData;\n if (columnId && (xInfo.kind === 'column' && xInfo.type === columnId.valueType && xInfo.name === columnId.name && settings.xAxis?.scale === 'discrete')) {\n if (!xAxis.significantLines) {\n xAxis.significantLines = [];\n }\n xAxis.significantLines.push(Number(value));\n }\n\n if (columnId && (yInfo.kind === 'column' && yInfo.type === columnId.valueType && yInfo.name === columnId.name)) {\n if (!yAxis.significantLines) {\n yAxis.significantLines = [];\n }\n yAxis.significantLines.push(Number(value));\n }\n });\n }\n\n const palette = readAnnotation(spec, Annotation.Graph.Palette);\n if (palette) {\n const paletteData = JSON.parse(palette);\n const { mapping = {}, name = '' } = paletteData;\n settings.layers.forEach((layer) => {\n if (layer.type === 'dots') {\n if (!layer.aes) {\n layer.aes = {};\n }\n layer.aes.dotFill = { type: 'grouping', value: groupingSource };\n }\n });\n const paletteEntries = [...Object.entries(mapping), ['null', UNKNOWN_COLOR]];\n const paletteColors = PALETTE_MAP[name as keyof typeof PALETTE_MAP]?.colors ?? [];\n\n settings.grouping?.forEach((groupingElement) => {\n if (groupingElement.columnName.value === groupingSource) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupingElement.inheritedAes = paletteEntries.reduce((res: Record<string, any>, [key, value]) => { // TODO: remove any\n const color = paletteColors[Number(value)] ?? DEFAULT_BLACK;\n res[key] = {\n fillColor: color,\n lineColor: color,\n dotFill: color,\n dotShape: DEFAULT_DOT_SHAPE,\n dotSize: DEFAULT_DOT_SIZE,\n lineWidth: DEFAULT_LINE_WIDTH,\n };\n return res;\n }, {});\n }\n });\n }\n }\n if (xInfo.annotations) {\n const upperLimit = readAnnotation(xInfo, Annotation.Graph.Axis.UpperLimit);\n const lowerLimit = readAnnotation(xInfo, Annotation.Graph.Axis.LowerLimit);\n const symmetricRange = readAnnotation(xInfo, Annotation.Graph.Axis.SymmetricRange);\n if (upperLimit) {\n xAxis!.upperValue = Number(upperLimit);\n }\n if (lowerLimit) {\n xAxis!.lowerValue = Number(lowerLimit);\n }\n if (symmetricRange) {\n xAxis!.symmetricRange = Number(symmetricRange);\n }\n }\n\n if (yInfo.annotations) {\n const upperLimit = readAnnotation(yInfo, Annotation.Graph.Axis.UpperLimit);\n const lowerLimit = readAnnotation(yInfo, Annotation.Graph.Axis.LowerLimit);\n const symmetricRange = readAnnotation(yInfo, Annotation.Graph.Axis.SymmetricRange);\n if (upperLimit) {\n yAxis!.upperValue = Number(upperLimit);\n }\n if (lowerLimit) {\n yAxis!.lowerValue = Number(lowerLimit);\n }\n if (symmetricRange) {\n yAxis!.symmetricRange = Number(symmetricRange);\n }\n }\n}\n\nexport function applyInheritedAes(\n settings: ScatterplotSettings | ScatterplotUmapSettings,\n grouping: ComponentStateSimple | ComponentStateFilter,\n shape: ComponentStateSimple | ComponentStateFilter | undefined,\n uniqueValuesData: UniqueValuesBySourceMap,\n dataBindAes: AestheticMappingState,\n defaultPalette: DefaultPalettes,\n) {\n if (grouping.selectorStates.length || shape?.selectorStates.length) {\n settings.grouping = [...(settings.grouping ?? [])].map((v) => ({ ...v }));\n settings.grouping.forEach((el) => {\n const selectedSource = el.columnName.value;\n const savedData = getScatterplotAes(selectedSource, uniqueValuesData, dataBindAes, defaultPalette.continuous); // get saved or default color or shape mapping\n // if mapping exists but doesn't have saved order and value-color pairs - add just colors list to chart settings, chart will use it\n if (!savedData.order.length) {\n settings.layers.forEach((layer) => {\n const layerAes = layer.aes;\n if (!layerAes) {\n return;\n }\n const aesKeys = Object.keys(layerAes);\n aesKeys.forEach((aesKey) => {\n const value = layerAes[aesKey as keyof typeof layerAes] as unknown;\n if (isMappedAes(value) && value.value === selectedSource) {\n const colors = PALETTE_MAP[dataBindAes[selectedSource]?.palette ?? defaultPalette.categorical]?.colors ?? [];\n (value as MappingLink & { palette: string[] }).palette = colors;\n }\n });\n });\n } else {\n el.order = savedData.order;\n el.inheritedAes = savedData.inheritedAes;\n }\n });\n }\n}\nexport function composeScatterplotSettings(\n settings: ScatterplotSettings,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n reactiveState: ReactiveState,\n inputGuide: InputGuide<InputState>,\n uniqueValuesData: UniqueValuesBySourceMap,\n defaultPalette: DefaultPalettes,\n) {\n settings.layers = getScatterplotLayersSettings(\n SCATTERPLOT_TEMPLATES_MAP[reactiveState.template as ScatterplotLayersTemplate],\n reactiveState.layersSettings,\n dataByColumns,\n reactiveState.optionsState as ScatterplotUIState,\n reactiveState.dataBindAes,\n inputGuide,\n settings?.grouping?.map((v) => v.columnName),\n undefined,\n defaultPalette.continuous,\n );\n\n applyInheritedAes(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.shape,\n uniqueValuesData,\n reactiveState.dataBindAes,\n defaultPalette,\n );\n\n const statisticsSettings = reactiveState.statisticsSettings as ScatterplotStatisticsState;\n const dotsLayer = settings.layers.find((layer) => layer.type === 'dots');\n if (statisticsSettings.trend.on && dotsLayer) {\n settings.trend = {\n color: dotsLayer.aes?.dotFill,\n bounded: false,\n };\n }\n\n Object.assign(\n settings,\n getAxesDataFromFormsScatterplot(reactiveState.axesSettings, uniqueValuesData, reactiveState.optionsState, inputGuide),\n );\n\n applyChartInfoFromAnnotations(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.x,\n reactiveState.optionsState.components.y,\n inputGuide,\n );\n\n return settings;\n}\n"],"names":["applyChartInfoFromAnnotations","settings","grouping","x","y","inputGuide","groupingSource","_a","xSource","_b","ySource","_c","xInfo","yInfo","v","xAxis","yAxis","spec","thresholds","readAnnotation","Annotation","thresholdData","columnId","value","palette","paletteData","mapping","name","layer","paletteEntries","UNKNOWN_COLOR","paletteColors","_d","PALETTE_MAP","_e","groupingElement","res","key","color","DEFAULT_BLACK","DEFAULT_DOT_SHAPE","DEFAULT_DOT_SIZE","DEFAULT_LINE_WIDTH","upperLimit","lowerLimit","symmetricRange","applyInheritedAes","shape","uniqueValuesData","dataBindAes","defaultPalette","el","selectedSource","savedData","getScatterplotAes","layerAes","aesKey","isMappedAes","colors","composeScatterplotSettings","dataByColumns","reactiveState","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","statisticsSettings","dotsLayer","getAxesDataFromFormsScatterplot"],"mappings":";;;;;;;;AAuCO,SAASA,EACdC,GACAC,GACAC,GACAC,GACAC,GACA;;AACA,QAAMC,KAAiBC,IAAAL,EAAS,eAAe,CAAC,MAAzB,gBAAAK,EAA4B,gBAC7CC,KAAUC,IAAAN,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BF,EAAc,QAAqC;AAAA,IAC7EA,EAAc;AAAA,IACdD;AAAA,IACAC,EAAc;AAAA,IACdA,EAAc;AAAA,IACdxD;AAAA,KACAE,IAAAN,KAAA,gBAAAA,EAAU,aAAV,gBAAAM,EAAoB,IAAI,CAACO,MAAMA,EAAE;AAAA,IACjC;AAAA,IACAoC,EAAe;AAAA,EAAA,GAGjBJ;AAAA,IACE7C;AAAA,IACA4D,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCb;AAAA,IACAa,EAAc;AAAA,IACdX;AAAA,EAAA;AAGF,QAAMc,IAAqBH,EAAc,oBACnCI,IAAYhE,EAAS,OAAO,KAAK,CAAC2B,MAAUA,EAAM,SAAS,MAAM;AACvE,SAAIoC,EAAmB,MAAM,MAAMC,MACjChE,EAAS,QAAQ;AAAA,IACf,QAAOQ,IAAAwD,EAAU,QAAV,gBAAAxD,EAAe;AAAA,IACtB,SAAS;AAAA,EAAA,IAIb,OAAO;AAAA,IACLR;AAAA,IACAiE,EAAgCL,EAAc,cAAcb,GAAkBa,EAAc,cAAcxD,CAAU;AAAA,EAAA,GAGtHL;AAAA,IACEC;AAAA,IACA4D,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCxD;AAAA,EAAA,GAGKJ;AACT;"}
|
|
1
|
+
{"version":3,"file":"composeScatterplotSettings.js","sources":["../../../src/utils/createChartSettingsForRender/composeScatterplotSettings.ts"],"sourcesContent":["import type { ScatterplotSettings, ScatterplotUmapSettings } from '@milaboratories/miplots4';\nimport type {\n ComponentStateFilter,\n ComponentStateSimple,\n InputGuide,\n InputState,\n PlotDataAndSettings,\n ScatterplotUIState,\n} from '@milaboratories/pf-plots';\nimport {\n DEFAULT_BLACK,\n PALETTE_MAP,\n UNKNOWN_COLOR,\n} from '../../constantsAesthetic';\nimport type {\n MappingLink,\n ScatterplotStatisticsState } from '../../constantsCommon';\nimport {\n isMappedAes,\n SCATTERPLOT_TEMPLATES_MAP,\n} from '../../constantsCommon';\nimport type {\n AestheticMappingState } from '../../dataBindAes';\nimport {\n DEFAULT_DOT_SHAPE,\n DEFAULT_DOT_SIZE,\n DEFAULT_LINE_WIDTH,\n getScatterplotAes,\n} from '../../dataBindAes';\nimport type {\n DefaultPalettes,\n ReactiveState,\n ScatterplotLayersTemplate,\n UniqueValuesBySourceMap,\n} from '../../types';\nimport { getAxesDataFromFormsScatterplot, getScatterplotLayersSettings } from '../index';\nimport type { AxisSettingsContinuous } from '@milaboratories/miplots4';\nimport { Annotation, readAnnotation } from '@platforma-sdk/model';\nimport type { Palette } from '../../components/AesSettings/types';\n\nexport function applyChartInfoFromAnnotations(\n settings: ScatterplotSettings | ScatterplotUmapSettings,\n grouping: ComponentStateSimple | ComponentStateFilter,\n x: ComponentStateSimple | ComponentStateFilter,\n y: ComponentStateSimple | ComponentStateFilter,\n inputGuide: InputGuide<InputState>,\n) {\n const groupingSource = grouping.selectorStates[0]?.selectedSource;\n const xSource = x.selectorStates[0]?.selectedSource;\n const ySource = y.selectorStates[0]?.selectedSource;\n const xInfo = inputGuide.getSourceInfo(xSource);\n const yInfo = inputGuide.getSourceInfo(ySource);\n\n settings.grouping = [...(settings.grouping ?? [])].map((v) => ({ ...v }));\n\n const xAxis = settings.xAxis as AxisSettingsContinuous;\n const yAxis = settings.yAxis as AxisSettingsContinuous;\n if (grouping.selectorStates.length) {\n const spec = inputGuide.getSourceInfo(groupingSource).spec;\n const thresholds = readAnnotation(spec, Annotation.Graph.Thresholds);\n if (thresholds) {\n const thresholdsData = JSON.parse(thresholds) ?? [];\n\n thresholdsData.forEach((thresholdData: { columnId: Record<string, string>; value: number }) => {\n const { columnId, value } = thresholdData;\n if (columnId && (xInfo.kind === 'column' && xInfo.type === columnId.valueType && xInfo.name === columnId.name && settings.xAxis?.scale === 'discrete')) {\n if (!xAxis.significantLines) {\n xAxis.significantLines = [];\n }\n xAxis.significantLines.push(Number(value));\n }\n\n if (columnId && (yInfo.kind === 'column' && yInfo.type === columnId.valueType && yInfo.name === columnId.name)) {\n if (!yAxis.significantLines) {\n yAxis.significantLines = [];\n }\n yAxis.significantLines.push(Number(value));\n }\n });\n }\n\n const palette = readAnnotation(spec, Annotation.Graph.Palette);\n if (palette) {\n const paletteData = JSON.parse(palette);\n const { mapping = {}, name = '' } = paletteData;\n settings.layers.forEach((layer) => {\n if (layer.type === 'dots') {\n if (!layer.aes) {\n layer.aes = {};\n }\n layer.aes.dotFill = { type: 'grouping', value: groupingSource };\n }\n });\n const paletteEntries = [...Object.entries(mapping), ['null', UNKNOWN_COLOR]];\n const paletteColors = PALETTE_MAP[name as keyof typeof PALETTE_MAP]?.colors ?? [];\n\n settings.grouping?.forEach((groupingElement) => {\n if (groupingElement.columnName.value === groupingSource) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupingElement.inheritedAes = paletteEntries.reduce((res: Record<string, any>, [key, value]) => { // TODO: remove any\n const color = paletteColors[Number(value)] ?? DEFAULT_BLACK;\n res[key] = {\n fillColor: color,\n lineColor: color,\n dotFill: color,\n dotShape: DEFAULT_DOT_SHAPE,\n dotSize: DEFAULT_DOT_SIZE,\n lineWidth: DEFAULT_LINE_WIDTH,\n };\n return res;\n }, {});\n }\n });\n }\n }\n if (xInfo.annotations) {\n const upperLimit = readAnnotation(xInfo, Annotation.Graph.Axis.UpperLimit);\n const lowerLimit = readAnnotation(xInfo, Annotation.Graph.Axis.LowerLimit);\n const symmetricRange = readAnnotation(xInfo, Annotation.Graph.Axis.SymmetricRange);\n if (upperLimit) {\n xAxis!.upperValue = Number(upperLimit);\n }\n if (lowerLimit) {\n xAxis!.lowerValue = Number(lowerLimit);\n }\n if (symmetricRange) {\n xAxis!.symmetricRange = Number(symmetricRange);\n }\n }\n\n if (yInfo.annotations) {\n const upperLimit = readAnnotation(yInfo, Annotation.Graph.Axis.UpperLimit);\n const lowerLimit = readAnnotation(yInfo, Annotation.Graph.Axis.LowerLimit);\n const symmetricRange = readAnnotation(yInfo, Annotation.Graph.Axis.SymmetricRange);\n if (upperLimit) {\n yAxis!.upperValue = Number(upperLimit);\n }\n if (lowerLimit) {\n yAxis!.lowerValue = Number(lowerLimit);\n }\n if (symmetricRange) {\n yAxis!.symmetricRange = Number(symmetricRange);\n }\n }\n}\n\nexport function applyInheritedAes(\n settings: ScatterplotSettings | ScatterplotUmapSettings,\n grouping: ComponentStateSimple | ComponentStateFilter,\n shape: ComponentStateSimple | ComponentStateFilter | undefined,\n uniqueValuesData: UniqueValuesBySourceMap,\n dataBindAes: AestheticMappingState,\n defaultPalette: Palette,\n) {\n if (grouping.selectorStates.length || shape?.selectorStates.length) {\n settings.grouping = [...(settings.grouping ?? [])].map((v) => ({ ...v }));\n settings.grouping.forEach((el) => {\n const selectedSource = el.columnName.value;\n const savedData = getScatterplotAes(selectedSource, uniqueValuesData, dataBindAes, defaultPalette); // get saved or default color or shape mapping\n // if mapping exists but doesn't have saved order and value-color pairs - add just colors list to chart settings, chart will use it\n if (!savedData.order.length) {\n settings.layers.forEach((layer) => {\n const layerAes = layer.aes;\n if (!layerAes) {\n return;\n }\n const aesKeys = Object.keys(layerAes);\n aesKeys.forEach((aesKey) => {\n const value = layerAes[aesKey as keyof typeof layerAes] as unknown;\n if (isMappedAes(value) && value.value === selectedSource) {\n const colors = PALETTE_MAP[dataBindAes[selectedSource]?.palette ?? defaultPalette]?.colors ?? [];\n (value as MappingLink & { palette: string[] }).palette = colors;\n }\n });\n });\n } else {\n el.order = savedData.order;\n el.inheritedAes = savedData.inheritedAes;\n }\n });\n }\n}\nexport function composeScatterplotSettings(\n settings: ScatterplotSettings,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n reactiveState: ReactiveState,\n inputGuide: InputGuide<InputState>,\n uniqueValuesData: UniqueValuesBySourceMap,\n defaultPalette: DefaultPalettes,\n) {\n settings.layers = getScatterplotLayersSettings(\n SCATTERPLOT_TEMPLATES_MAP[reactiveState.template as ScatterplotLayersTemplate],\n reactiveState.layersSettings,\n dataByColumns,\n reactiveState.optionsState as ScatterplotUIState,\n reactiveState.dataBindAes,\n inputGuide,\n settings?.grouping?.map((v) => v.columnName),\n undefined,\n defaultPalette.continuous,\n );\n\n applyInheritedAes(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.shape,\n uniqueValuesData,\n reactiveState.dataBindAes,\n defaultPalette.categorical,\n );\n\n const statisticsSettings = reactiveState.statisticsSettings as ScatterplotStatisticsState;\n const dotsLayer = settings.layers.find((layer) => layer.type === 'dots');\n if (statisticsSettings.trend.on && dotsLayer) {\n settings.trend = {\n color: dotsLayer.aes?.dotFill,\n bounded: false,\n };\n }\n\n Object.assign(\n settings,\n getAxesDataFromFormsScatterplot(reactiveState.axesSettings, uniqueValuesData, reactiveState.optionsState, inputGuide),\n );\n\n applyChartInfoFromAnnotations(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.x,\n reactiveState.optionsState.components.y,\n inputGuide,\n );\n\n return settings;\n}\n"],"names":["applyChartInfoFromAnnotations","settings","grouping","x","y","inputGuide","groupingSource","_a","xSource","_b","ySource","_c","xInfo","yInfo","v","xAxis","yAxis","spec","thresholds","readAnnotation","Annotation","thresholdData","columnId","value","palette","paletteData","mapping","name","layer","paletteEntries","UNKNOWN_COLOR","paletteColors","_d","PALETTE_MAP","_e","groupingElement","res","key","color","DEFAULT_BLACK","DEFAULT_DOT_SHAPE","DEFAULT_DOT_SIZE","DEFAULT_LINE_WIDTH","upperLimit","lowerLimit","symmetricRange","applyInheritedAes","shape","uniqueValuesData","dataBindAes","defaultPalette","el","selectedSource","savedData","getScatterplotAes","layerAes","aesKey","isMappedAes","colors","composeScatterplotSettings","dataByColumns","reactiveState","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","statisticsSettings","dotsLayer","getAxesDataFromFormsScatterplot"],"mappings":";;;;;;;;AAwCO,SAASA,EACdC,GACAC,GACAC,GACAC,GACAC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1D,GACA2D,GACAC,GACAxD,GACA2C,GACAE,GACA;;AACA,EAAAjD,EAAS,SAAS6D;AAAA,IAChBC,EAA0BF,EAAc,QAAqC;AAAA,IAC7EA,EAAc;AAAA,IACdD;AAAA,IACAC,EAAc;AAAA,IACdA,EAAc;AAAA,IACdxD;AAAA,KACAE,IAAAN,KAAA,gBAAAA,EAAU,aAAV,gBAAAM,EAAoB,IAAI,CAACO,MAAMA,EAAE;AAAA,IACjC;AAAA,IACAoC,EAAe;AAAA,EAAA,GAGjBJ;AAAA,IACE7C;AAAA,IACA4D,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCb;AAAA,IACAa,EAAc;AAAA,IACdX,EAAe;AAAA,EAAA;AAGjB,QAAMc,IAAqBH,EAAc,oBACnCI,IAAYhE,EAAS,OAAO,KAAK,CAAC2B,MAAUA,EAAM,SAAS,MAAM;AACvE,SAAIoC,EAAmB,MAAM,MAAMC,MACjChE,EAAS,QAAQ;AAAA,IACf,QAAOQ,IAAAwD,EAAU,QAAV,gBAAAxD,EAAe;AAAA,IACtB,SAAS;AAAA,EAAA,IAIb,OAAO;AAAA,IACLR;AAAA,IACAiE,EAAgCL,EAAc,cAAcb,GAAkBa,EAAc,cAAcxD,CAAU;AAAA,EAAA,GAGtHL;AAAA,IACEC;AAAA,IACA4D,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCxD;AAAA,EAAA,GAGKJ;AACT;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SCATTERPLOT_TEMPLATES_MAP as
|
|
2
|
-
import { DEFAULT_DOT_SIZE_CANVAS as
|
|
1
|
+
import { SCATTERPLOT_TEMPLATES_MAP as t } from "../../constantsCommon.js";
|
|
2
|
+
import { DEFAULT_DOT_SIZE_CANVAS as _ } from "../../dataBindAes.js";
|
|
3
3
|
import { getScatterplotLayersSettings as E } from "./getLayersDataFromForms.js";
|
|
4
4
|
import { getAxesDataFromFormsScatterplot as s } from "./getAxesDataFromForms.js";
|
|
5
5
|
import "@milaboratories/pf-plots";
|
|
@@ -7,25 +7,25 @@ import "@platforma-sdk/model";
|
|
|
7
7
|
import "vue";
|
|
8
8
|
import { applyInheritedAes as S, applyChartInfoFromAnnotations as L } from "./composeScatterplotSettings.js";
|
|
9
9
|
import "../../constantsAesthetic.js";
|
|
10
|
-
const
|
|
11
|
-
function
|
|
10
|
+
const a = 750, c = 450;
|
|
11
|
+
function C(p, A, o, m, n, T) {
|
|
12
12
|
var r;
|
|
13
13
|
return p.layers = E(
|
|
14
|
-
|
|
14
|
+
t[o.template],
|
|
15
15
|
o.layersSettings,
|
|
16
16
|
A,
|
|
17
17
|
o.optionsState,
|
|
18
18
|
o.dataBindAes,
|
|
19
19
|
m,
|
|
20
|
-
(r = p == null ? void 0 : p.grouping) == null ? void 0 : r.map((
|
|
21
|
-
|
|
20
|
+
(r = p == null ? void 0 : p.grouping) == null ? void 0 : r.map((l) => l.columnName),
|
|
21
|
+
_
|
|
22
22
|
), S(
|
|
23
23
|
p,
|
|
24
24
|
o.optionsState.components.grouping,
|
|
25
25
|
void 0,
|
|
26
26
|
n,
|
|
27
27
|
o.dataBindAes,
|
|
28
|
-
T
|
|
28
|
+
T.categorical
|
|
29
29
|
), Object.assign(
|
|
30
30
|
p,
|
|
31
31
|
s(o.axesSettings, n, o.optionsState, m)
|
|
@@ -36,11 +36,11 @@ function D(p, A, o, m, n, T) {
|
|
|
36
36
|
o.optionsState.components.y,
|
|
37
37
|
m
|
|
38
38
|
), p.size = {
|
|
39
|
-
width:
|
|
40
|
-
height:
|
|
39
|
+
width: a * o.chartScale / 100,
|
|
40
|
+
height: c * o.chartScale / 100
|
|
41
41
|
}, p;
|
|
42
42
|
}
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
C as composeScatterplotUmapSettings
|
|
45
45
|
};
|
|
46
46
|
//# sourceMappingURL=composeScatterplotUmapSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeScatterplotUmapSettings.js","sources":["../../../src/utils/createChartSettingsForRender/composeScatterplotUmapSettings.ts"],"sourcesContent":["import type { ScatterplotUmapSettings } from '@milaboratories/miplots4';\nimport type { InputGuide, InputState, PlotDataAndSettings, ScatterplotUIState } from '@milaboratories/pf-plots';\nimport { SCATTERPLOT_TEMPLATES_MAP } from '../../constantsCommon';\nimport { DEFAULT_DOT_SIZE_CANVAS } from '../../dataBindAes';\nimport type {\n DefaultPalettes,\n ReactiveState,\n ScatterplotLayersTemplate,\n UniqueValuesBySourceMap,\n} from '../../types';\nimport { getAxesDataFromFormsScatterplot, getScatterplotLayersSettings } from '../index';\nimport { applyChartInfoFromAnnotations, applyInheritedAes } from './composeScatterplotSettings';\n\nconst DEFAULT_WIDTH_SCATTERPLOT_UMAP = 750;\nconst DEFAULT_HEIGHT_SCATTERPLOT_UMAP = 450;\n\nexport function composeScatterplotUmapSettings(\n settings: ScatterplotUmapSettings,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n reactiveState: ReactiveState,\n inputGuide: InputGuide<InputState>,\n uniqueValuesData: UniqueValuesBySourceMap,\n defaultPalette: DefaultPalettes,\n) {\n settings.layers = getScatterplotLayersSettings(\n SCATTERPLOT_TEMPLATES_MAP[reactiveState.template as ScatterplotLayersTemplate],\n reactiveState.layersSettings,\n dataByColumns,\n reactiveState.optionsState as ScatterplotUIState,\n reactiveState.dataBindAes,\n inputGuide,\n settings?.grouping?.map((v) => v.columnName),\n DEFAULT_DOT_SIZE_CANVAS,\n ) as ScatterplotUmapSettings['layers'];\n\n applyInheritedAes(\n settings,\n reactiveState.optionsState.components.grouping,\n undefined,\n uniqueValuesData,\n reactiveState.dataBindAes,\n defaultPalette,\n );\n\n Object.assign(\n settings,\n getAxesDataFromFormsScatterplot(reactiveState.axesSettings, uniqueValuesData, reactiveState.optionsState, inputGuide),\n );\n\n applyChartInfoFromAnnotations(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.x,\n reactiveState.optionsState.components.y,\n inputGuide,\n );\n\n settings.size = {\n width: DEFAULT_WIDTH_SCATTERPLOT_UMAP * reactiveState.chartScale / 100,\n height: DEFAULT_HEIGHT_SCATTERPLOT_UMAP * reactiveState.chartScale / 100,\n };\n\n return settings;\n}\n"],"names":["DEFAULT_WIDTH_SCATTERPLOT_UMAP","DEFAULT_HEIGHT_SCATTERPLOT_UMAP","composeScatterplotUmapSettings","settings","dataByColumns","reactiveState","inputGuide","uniqueValuesData","defaultPalette","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","_a","v","DEFAULT_DOT_SIZE_CANVAS","applyInheritedAes","getAxesDataFromFormsScatterplot","applyChartInfoFromAnnotations"],"mappings":";;;;;;;;;AAaA,MAAMA,IAAiC,KACjCC,IAAkC;AAEjC,SAASC,EACdC,GACAC,GACAC,GACAC,GACAC,GACAC,GACA;;AACA,SAAAL,EAAS,SAASM;AAAA,IAChBC,EAA0BL,EAAc,QAAqC;AAAA,IAC7EA,EAAc;AAAA,IACdD;AAAA,IACAC,EAAc;AAAA,IACdA,EAAc;AAAA,IACdC;AAAA,KACAK,IAAAR,KAAA,gBAAAA,EAAU,aAAV,gBAAAQ,EAAoB,IAAI,CAACC,MAAMA,EAAE;AAAA,IACjCC;AAAA,EAAA,GAGFC;AAAA,IACEX;AAAA,IACAE,EAAc,aAAa,WAAW;AAAA,IACtC;AAAA,IACAE;AAAA,IACAF,EAAc;AAAA,IACdG;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"composeScatterplotUmapSettings.js","sources":["../../../src/utils/createChartSettingsForRender/composeScatterplotUmapSettings.ts"],"sourcesContent":["import type { ScatterplotUmapSettings } from '@milaboratories/miplots4';\nimport type { InputGuide, InputState, PlotDataAndSettings, ScatterplotUIState } from '@milaboratories/pf-plots';\nimport { SCATTERPLOT_TEMPLATES_MAP } from '../../constantsCommon';\nimport { DEFAULT_DOT_SIZE_CANVAS } from '../../dataBindAes';\nimport type {\n DefaultPalettes,\n ReactiveState,\n ScatterplotLayersTemplate,\n UniqueValuesBySourceMap,\n} from '../../types';\nimport { getAxesDataFromFormsScatterplot, getScatterplotLayersSettings } from '../index';\nimport { applyChartInfoFromAnnotations, applyInheritedAes } from './composeScatterplotSettings';\n\nconst DEFAULT_WIDTH_SCATTERPLOT_UMAP = 750;\nconst DEFAULT_HEIGHT_SCATTERPLOT_UMAP = 450;\n\nexport function composeScatterplotUmapSettings(\n settings: ScatterplotUmapSettings,\n dataByColumns: PlotDataAndSettings['data']['byColumns'],\n reactiveState: ReactiveState,\n inputGuide: InputGuide<InputState>,\n uniqueValuesData: UniqueValuesBySourceMap,\n defaultPalette: DefaultPalettes,\n) {\n settings.layers = getScatterplotLayersSettings(\n SCATTERPLOT_TEMPLATES_MAP[reactiveState.template as ScatterplotLayersTemplate],\n reactiveState.layersSettings,\n dataByColumns,\n reactiveState.optionsState as ScatterplotUIState,\n reactiveState.dataBindAes,\n inputGuide,\n settings?.grouping?.map((v) => v.columnName),\n DEFAULT_DOT_SIZE_CANVAS,\n ) as ScatterplotUmapSettings['layers'];\n\n applyInheritedAes(\n settings,\n reactiveState.optionsState.components.grouping,\n undefined,\n uniqueValuesData,\n reactiveState.dataBindAes,\n defaultPalette.categorical,\n );\n\n Object.assign(\n settings,\n getAxesDataFromFormsScatterplot(reactiveState.axesSettings, uniqueValuesData, reactiveState.optionsState, inputGuide),\n );\n\n applyChartInfoFromAnnotations(\n settings,\n reactiveState.optionsState.components.grouping,\n reactiveState.optionsState.components.x,\n reactiveState.optionsState.components.y,\n inputGuide,\n );\n\n settings.size = {\n width: DEFAULT_WIDTH_SCATTERPLOT_UMAP * reactiveState.chartScale / 100,\n height: DEFAULT_HEIGHT_SCATTERPLOT_UMAP * reactiveState.chartScale / 100,\n };\n\n return settings;\n}\n"],"names":["DEFAULT_WIDTH_SCATTERPLOT_UMAP","DEFAULT_HEIGHT_SCATTERPLOT_UMAP","composeScatterplotUmapSettings","settings","dataByColumns","reactiveState","inputGuide","uniqueValuesData","defaultPalette","getScatterplotLayersSettings","SCATTERPLOT_TEMPLATES_MAP","_a","v","DEFAULT_DOT_SIZE_CANVAS","applyInheritedAes","getAxesDataFromFormsScatterplot","applyChartInfoFromAnnotations"],"mappings":";;;;;;;;;AAaA,MAAMA,IAAiC,KACjCC,IAAkC;AAEjC,SAASC,EACdC,GACAC,GACAC,GACAC,GACAC,GACAC,GACA;;AACA,SAAAL,EAAS,SAASM;AAAA,IAChBC,EAA0BL,EAAc,QAAqC;AAAA,IAC7EA,EAAc;AAAA,IACdD;AAAA,IACAC,EAAc;AAAA,IACdA,EAAc;AAAA,IACdC;AAAA,KACAK,IAAAR,KAAA,gBAAAA,EAAU,aAAV,gBAAAQ,EAAoB,IAAI,CAACC,MAAMA,EAAE;AAAA,IACjCC;AAAA,EAAA,GAGFC;AAAA,IACEX;AAAA,IACAE,EAAc,aAAa,WAAW;AAAA,IACtC;AAAA,IACAE;AAAA,IACAF,EAAc;AAAA,IACdG,EAAe;AAAA,EAAA,GAGjB,OAAO;AAAA,IACLL;AAAA,IACAY,EAAgCV,EAAc,cAAcE,GAAkBF,EAAc,cAAcC,CAAU;AAAA,EAAA,GAGtHU;AAAA,IACEb;AAAA,IACAE,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCA,EAAc,aAAa,WAAW;AAAA,IACtCC;AAAA,EAAA,GAGFH,EAAS,OAAO;AAAA,IACd,OAAOH,IAAiCK,EAAc,aAAa;AAAA,IACnE,QAAQJ,IAAkCI,EAAc,aAAa;AAAA,EAAA,GAGhEF;AACT;"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
function O(i,
|
|
2
|
-
return i !== null ? i :
|
|
1
|
+
function O(i, t = []) {
|
|
2
|
+
return i !== null ? i : t.length > 6 && t.some(({ label: c }) => c.length > 5) ? "45deg" : "center";
|
|
3
3
|
}
|
|
4
|
-
function E(i,
|
|
5
|
-
var
|
|
4
|
+
function E(i, t, c, s) {
|
|
5
|
+
var Y, S, x, k, w, p, y, T, M, _, C, G;
|
|
6
6
|
let e = {}, l = {};
|
|
7
7
|
e.showGrid = i.axisX.gridlines, e.showTicks = i.axisX.ticks, l.showGrid = i.axisY.gridlines, l.showTicks = i.axisY.ticks;
|
|
8
|
-
const o = ((
|
|
9
|
-
if (
|
|
8
|
+
const o = ((Y = c.components.x.selectorStates) == null ? void 0 : Y[0].selectedSource) ?? null, d = ((S = c.components.y.selectorStates) == null ? void 0 : S[0].selectedSource) ?? null, f = o ? s.getSourceInfo(o) : null, A = d ? s.getSourceInfo(d) : null, R = (f == null ? void 0 : f.type) === "String", B = (A == null ? void 0 : A.type) === "String";
|
|
9
|
+
if (R) {
|
|
10
10
|
e = e, e.scale = "discrete", e.labelsPosition = i.axisX.labelsRotation ?? "center";
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const u = ((x = i.axisX.order) == null ? void 0 : x.source) === o, g = (k = t[o]) == null ? void 0 : k.list, h = (w = t[o]) == null ? void 0 : w.labels, b = u ? ((p = i.axisX.order) == null ? void 0 : p.options.map((n) => n.value)) ?? g : g, L = u ? ((y = i.axisX.order) == null ? void 0 : y.options.reduce((n, r) => (n[r.value] = r.label, n), {})) ?? h : h;
|
|
12
|
+
b && L && (e.keys = b, e.labels = L);
|
|
13
13
|
} else
|
|
14
14
|
e = e, e.scale = i.axisX.scale, e.significantLinesStyle = i.axisX.significantLinesStyle;
|
|
15
|
-
if (
|
|
15
|
+
if (B) {
|
|
16
16
|
l = l, l.scale = "discrete", l.labelsPosition = i.axisY.labelsRotation ?? "center";
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const u = (T = t[d]) == null ? void 0 : T.list, g = (M = t[d]) == null ? void 0 : M.labels, h = ((_ = i.axisY.order) == null ? void 0 : _.source) === d, b = h ? ((C = i.axisY.order) == null ? void 0 : C.options.map((n) => n.value)) ?? u : u, L = h ? ((G = i.axisY.order) == null ? void 0 : G.options.reduce((n, r) => (n[r.value] = r.label, n), {})) ?? g : g;
|
|
18
|
+
b && L && (l.keys = b, l.labels = L);
|
|
19
19
|
} else
|
|
20
20
|
l = l, l.scale = i.axisY.scale, l.significantLinesStyle = i.axisY.significantLinesStyle;
|
|
21
|
-
i.axisY.titleMode !== "auto" && (l.title = i.axisY.titleMode === "custom" ? i.axisY.customTitle : ""), i.axisX.titleMode !== "auto" && (e.title = i.axisX.titleMode === "custom" ? i.axisX.customTitle : "");
|
|
21
|
+
i.axisY.titleMode !== "auto" && (l.title = i.axisY.titleMode === "custom" ? i.axisY.customTitle : ""), i.axisX.titleMode !== "auto" && (e.title = i.axisX.titleMode === "custom" ? i.axisX.customTitle : ""), e.hiddenLabels = i.axisX.hideAxisLabels, l.hiddenLabels = i.axisY.hideAxisLabels;
|
|
22
22
|
const X = {
|
|
23
23
|
xAxis: e,
|
|
24
24
|
yAxis: l,
|
|
@@ -29,18 +29,18 @@ function E(i, s, c, t) {
|
|
|
29
29
|
};
|
|
30
30
|
return X.facetSettings.sharedX = ["x", "xy"].includes(i.other.facetSharedBy), X.facetSettings.sharedY = ["y", "xy"].includes(i.other.facetSharedBy), X;
|
|
31
31
|
}
|
|
32
|
-
function H(i,
|
|
33
|
-
const
|
|
34
|
-
|
|
32
|
+
function H(i, t, c = []) {
|
|
33
|
+
const s = {}, e = {};
|
|
34
|
+
t === "discrete" && (s.labelsPosition = O(i.axisX.labelsRotation, c), s.linesBetweenCategories = i.axisX.linesBetweenCategories, e.scale = i.axisY.scale, s.showGrid = i.axisX.gridlines, s.showTicks = i.axisX.ticks, s.hiddenLabels = i.axisX.hideAxisLabels, e.hiddenLabels = i.axisY.hideAxisLabels, e.showGrid = i.axisY.gridlines, e.showTicks = i.axisY.ticks), t === "histogram" && (s.scale = i.axisX.scale, e.scale = i.axisY.scale, s.hiddenLabels = i.axisX.hideAxisLabels, e.hiddenLabels = i.axisY.hideAxisLabels, s.showTicks = i.axisX.ticks, e.showTicks = i.axisY.ticks, s.showGrid = i.axisX.gridlines, e.showGrid = i.axisY.gridlines), (t === "heatmap" || t === "bubble") && (s.axisLabelsAngle = i.axisX.axisLabelsAngle, s.groupLabelsAngle = i.axisX.groupLabelsAngle, e.axisLabelsAngle = i.axisY.axisLabelsAngle, e.groupLabelsAngle = i.axisY.groupLabelsAngle, s.sorting = i.axisX.sorting, e.sorting = i.axisY.sorting, s.showAxisLabels = !i.axisX.hideAxisLabels, e.showAxisLabels = !i.axisY.hideAxisLabels, s.showGroupLabels = !i.axisX.hideAxisGroupLabels, e.showGroupLabels = !i.axisY.hideAxisGroupLabels, s.showTicks = i.axisX.ticks, e.showTicks = i.axisY.ticks), i.axisY.titleMode !== "auto" && (e.title = i.axisY.titleMode === "custom" ? i.axisY.customTitle : ""), i.axisX.titleMode !== "auto" && (s.title = i.axisX.titleMode === "custom" ? i.axisX.customTitle : "");
|
|
35
35
|
const l = {
|
|
36
|
-
xAxis:
|
|
36
|
+
xAxis: s,
|
|
37
37
|
yAxis: e,
|
|
38
38
|
frame: { type: i.other.frame },
|
|
39
39
|
facetSettings: {
|
|
40
40
|
nCols: i.other.facetColumns
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
return (
|
|
43
|
+
return (t === "discrete" || t === "scatterplot" || t === "heatmap") && (l.orientation = i.other.reverse ? "horizontal" : "vertical", l.facetSettings.sharedX = ["x", "xy"].includes(i.other.facetSharedBy), l.facetSettings.sharedY = ["y", "xy"].includes(i.other.facetSharedBy)), t === "histogram" && (l.groupingDirection = i.other.groupingDirection, l.groupingStack = i.other.groupingStack), l;
|
|
44
44
|
}
|
|
45
45
|
export {
|
|
46
46
|
H as getAxesDataFromForms,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAxesDataFromForms.js","sources":["../../../src/utils/createChartSettingsForRender/getAxesDataFromForms.ts"],"sourcesContent":["import type { AxesState } from '../../constantsCommon';\nimport type { ChartType, InputGuide, InputState } from '@milaboratories/pf-plots';\nimport type { LabelsRotation, ReactiveState, UniqueValuesBySourceMap, UniqueValuesData } from '../../types';\nimport type { AxisSettingsContinuous } from '@milaboratories/miplots4';\nimport type { AxisSettingsDiscrete } from '@milaboratories/miplots4';\nimport type { HeatmapSettings } from '@milaboratories/miplots4';\n\ntype AxesSettings = {\n xAxis: AxisSettingsDiscrete | AxisSettingsContinuous | HeatmapSettings['xAxis'];\n yAxis: AxisSettingsDiscrete | AxisSettingsContinuous | HeatmapSettings['yAxis'];\n frame: { type: string };\n orientation?: string;\n title?: Record<string, string>;\n facetSettings: {\n nCols: number;\n sharedX?: boolean;\n sharedY?: boolean;\n };\n groupingDirection?: AxesState['other']['groupingDirection'];\n groupingStack?: AxesState['other']['groupingStack'];\n};\n\nconst HORIZONTAL_CAPTURES_MAX_COUNT = 6;\nconst SHORT_LABEL_MAX_LENGTH = 5;\n\nexport function getDiscreteLabelsRotation(value: LabelsRotation | null, discreteGroups: UniqueValuesData['options'] = []) {\n if (value !== null) {\n return value;\n }\n if (\n discreteGroups.length > HORIZONTAL_CAPTURES_MAX_COUNT\n && discreteGroups.some(({ label }) => label.length > SHORT_LABEL_MAX_LENGTH)\n ) {\n return '45deg';\n }\n return 'center';\n}\n\nexport function getAxesDataFromFormsScatterplot(\n axesFormsData: AxesState,\n uniqueValues: UniqueValuesBySourceMap,\n optionsState: ReactiveState['optionsState'],\n inputGuide: InputGuide<InputState>,\n): AxesSettings {\n let xAxis: AxisSettingsContinuous | AxisSettingsDiscrete = {};\n let yAxis: AxisSettingsContinuous | AxisSettingsDiscrete = {};\n xAxis.showGrid = axesFormsData.axisX.gridlines;\n xAxis.showTicks = axesFormsData.axisX.ticks;\n yAxis.showGrid = axesFormsData.axisY.gridlines;\n yAxis.showTicks = axesFormsData.axisY.ticks;\n\n const xSource = optionsState.components.x.selectorStates?.[0].selectedSource ?? null;\n const ySource = optionsState.components.y.selectorStates?.[0].selectedSource ?? null;\n const infoX = xSource ? inputGuide.getSourceInfo(xSource) : null;\n const infoY = ySource ? inputGuide.getSourceInfo(ySource) : null;\n\n const isDiscreteX = infoX?.type === 'String';\n const isDiscreteY = infoY?.type === 'String';\n\n if (isDiscreteX) {\n xAxis = xAxis as AxisSettingsDiscrete;\n xAxis.scale = 'discrete';\n xAxis.labelsPosition = axesFormsData.axisX.labelsRotation ?? 'center';\n\n const saved = axesFormsData.axisX.order?.source === xSource;\n const uniqueList = uniqueValues[xSource]?.list;\n const uniqueLabels = uniqueValues[xSource]?.labels;\n const keys = saved ? axesFormsData.axisX.order?.options.map((v) => v.value) ?? uniqueList : uniqueList;\n const labels = saved\n ? axesFormsData.axisX.order?.options.reduce((res, v) => {\n res[v.value] = v.label;\n return res;\n }, {} as Record<string, string>) ?? uniqueLabels\n : uniqueLabels;\n if (keys && labels) {\n xAxis.keys = keys;\n xAxis.labels = labels;\n };\n } else {\n xAxis = xAxis as AxisSettingsContinuous;\n xAxis.scale = axesFormsData.axisX.scale;\n xAxis.significantLinesStyle = axesFormsData.axisX.significantLinesStyle;\n }\n\n if (isDiscreteY) {\n yAxis = yAxis as AxisSettingsDiscrete;\n yAxis.scale = 'discrete';\n yAxis.labelsPosition = axesFormsData.axisY.labelsRotation ?? 'center';\n\n const uniqueList = uniqueValues[ySource]?.list;\n const uniqueLabels = uniqueValues[ySource]?.labels;\n const saved = axesFormsData.axisY.order?.source === ySource;\n const keys = saved ? axesFormsData.axisY.order?.options.map((v) => v.value) ?? uniqueList : uniqueList;\n const labels = saved\n ? axesFormsData.axisY.order?.options.reduce((res, v) => {\n res[v.value] = v.label;\n return res;\n }, {} as Record<string, string>) ?? uniqueLabels\n : uniqueLabels;\n if (keys && labels) {\n yAxis.keys = keys;\n yAxis.labels = labels;\n };\n } else {\n yAxis = yAxis as AxisSettingsContinuous;\n yAxis.scale = axesFormsData.axisY.scale;\n yAxis.significantLinesStyle = axesFormsData.axisY.significantLinesStyle;\n }\n\n if (axesFormsData.axisY.titleMode !== 'auto') {\n yAxis.title = axesFormsData.axisY.titleMode === 'custom' ? axesFormsData.axisY.customTitle : '';\n }\n if (axesFormsData.axisX.titleMode !== 'auto') {\n xAxis.title = axesFormsData.axisX.titleMode === 'custom' ? axesFormsData.axisX.customTitle : '';\n }\n\n const result: AxesSettings = {\n xAxis,\n yAxis,\n frame: { type: axesFormsData.other.frame },\n facetSettings: {\n nCols: axesFormsData.other.facetColumns,\n },\n };\n result.facetSettings.sharedX = (['x', 'xy']).includes(axesFormsData.other.facetSharedBy);\n result.facetSettings.sharedY = (['y', 'xy']).includes(axesFormsData.other.facetSharedBy);\n\n return result;\n}\n\nexport function getAxesDataFromForms(axesFormsData: AxesState, chartType: ChartType, discreteGroups: UniqueValuesData['options'] = []): AxesSettings {\n const xAxis: AxesSettings['xAxis'] = {};\n const yAxis: AxesSettings['yAxis'] = {};\n if (chartType === 'discrete') {\n (xAxis as AxisSettingsDiscrete)!.labelsPosition = getDiscreteLabelsRotation(axesFormsData.axisX.labelsRotation, discreteGroups);\n (xAxis as AxisSettingsDiscrete)!.linesBetweenCategories = axesFormsData.axisX.linesBetweenCategories;\n (yAxis as AxisSettingsContinuous)!.scale = axesFormsData.axisY.scale;\n (xAxis as AxisSettingsDiscrete)!.showGrid = axesFormsData.axisX.gridlines;\n (xAxis as AxisSettingsDiscrete)!.showTicks = axesFormsData.axisX.ticks;\n (xAxis as AxisSettingsDiscrete)!.hiddenLabels = axesFormsData.axisX.hideAxisLabels;\n (yAxis as AxisSettingsDiscrete)!.hiddenLabels = axesFormsData.axisY.hideAxisLabels;\n (yAxis as AxisSettingsContinuous)!.showGrid = axesFormsData.axisY.gridlines;\n (yAxis as AxisSettingsContinuous).showTicks = axesFormsData.axisY.ticks;\n }\n if (chartType === 'histogram') {\n (xAxis as AxisSettingsContinuous).scale = axesFormsData.axisX.scale;\n (yAxis as AxisSettingsContinuous).scale = axesFormsData.axisY.scale;\n }\n if (chartType === 'heatmap' || chartType === 'bubble') {\n (xAxis as HeatmapSettings['xAxis'])!.axisLabelsAngle = axesFormsData.axisX.axisLabelsAngle;\n (xAxis as HeatmapSettings['xAxis'])!.groupLabelsAngle = axesFormsData.axisX.groupLabelsAngle;\n (yAxis as HeatmapSettings['yAxis'])!.axisLabelsAngle = axesFormsData.axisY.axisLabelsAngle;\n (yAxis as HeatmapSettings['yAxis'])!.groupLabelsAngle = axesFormsData.axisY.groupLabelsAngle;\n (xAxis as HeatmapSettings['xAxis'])!.sorting = axesFormsData.axisX.sorting;\n (yAxis as HeatmapSettings['yAxis'])!.sorting = axesFormsData.axisY.sorting;\n (xAxis as HeatmapSettings['xAxis'])!.showAxisLabels = !axesFormsData.axisX.hideAxisLabels;\n (yAxis as HeatmapSettings['yAxis'])!.showAxisLabels = !axesFormsData.axisY.hideAxisLabels;\n (xAxis as HeatmapSettings['xAxis'])!.showGroupLabels = !axesFormsData.axisX.hideAxisGroupLabels;\n (yAxis as HeatmapSettings['yAxis'])!.showGroupLabels = !axesFormsData.axisY.hideAxisGroupLabels;\n (xAxis as HeatmapSettings['xAxis'])!.showTicks = axesFormsData.axisX.ticks;\n (yAxis as HeatmapSettings['yAxis'])!.showTicks = axesFormsData.axisY.ticks;\n }\n if (axesFormsData.axisY.titleMode !== 'auto') {\n yAxis!.title = axesFormsData.axisY.titleMode === 'custom' ? axesFormsData.axisY.customTitle : '';\n }\n if (axesFormsData.axisX.titleMode !== 'auto') {\n xAxis!.title = axesFormsData.axisX.titleMode === 'custom' ? axesFormsData.axisX.customTitle : '';\n }\n\n const result: AxesSettings = {\n xAxis,\n yAxis,\n frame: { type: axesFormsData.other.frame },\n facetSettings: {\n nCols: axesFormsData.other.facetColumns,\n },\n };\n\n if (chartType === 'discrete' || chartType === 'scatterplot' || chartType === 'heatmap') {\n result.orientation = axesFormsData.other.reverse ? 'horizontal' : 'vertical';\n result.facetSettings.sharedX = (['x', 'xy']).includes(axesFormsData.other.facetSharedBy);\n result.facetSettings.sharedY = (['y', 'xy']).includes(axesFormsData.other.facetSharedBy);\n }\n if (chartType === 'histogram') {\n result.groupingDirection = axesFormsData.other.groupingDirection;\n result.groupingStack = axesFormsData.other.groupingStack;\n }\n return result;\n}\n"],"names":["getDiscreteLabelsRotation","value","discreteGroups","label","getAxesDataFromFormsScatterplot","axesFormsData","uniqueValues","optionsState","inputGuide","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","xAxis","yAxis","xSource","ySource","infoX","infoY","isDiscreteX","isDiscreteY","saved","uniqueList","uniqueLabels","keys","v","labels","res","result","getAxesDataFromForms","chartType"],"mappings":"AAyBO,SAASA,EAA0BC,GAA8BC,IAA8C,IAAI;AACxH,SAAID,MAAU,OACLA,IAGPC,EAAe,SAAS,KACrBA,EAAe,KAAK,CAAC,EAAE,OAAAC,QAAYA,EAAM,SAAS,CAAsB,IAEpE,UAEF;AACT;AAEO,SAASC,EACdC,GACAC,GACAC,GACAC,GACc;AArBhB,MAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC;AAsBE,MAAIC,IAAuD,CAAA,GACvDC,IAAuD,CAAA;AAC3D,EAAAD,EAAM,WAAWhB,EAAc,MAAM,WACrCgB,EAAM,YAAYhB,EAAc,MAAM,OACtCiB,EAAM,WAAWjB,EAAc,MAAM,WACrCiB,EAAM,YAAYjB,EAAc,MAAM;AAEtC,QAAMkB,MAAUd,IAAAF,EAAa,WAAW,EAAE,mBAA1B,gBAAAE,EAA2C,GAAG,mBAAkB,MAC1Ee,MAAUd,IAAAH,EAAa,WAAW,EAAE,mBAA1B,gBAAAG,EAA2C,GAAG,mBAAkB,MAC1Ee,IAAQF,IAAUf,EAAW,cAAce,CAAO,IAAI,MACtDG,IAAQF,IAAUhB,EAAW,cAAcgB,CAAO,IAAI,MAEtDG,KAAcF,KAAA,gBAAAA,EAAO,UAAS,UAC9BG,KAAcF,KAAA,gBAAAA,EAAO,UAAS;AAEpC,MAAIC,GAAa;AACf,IAAAN,IAAQA,GACRA,EAAM,QAAQ,YACdA,EA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AM,mBAC/C+B,EAAO,gBAAgB/B,EAAc,MAAM,gBAEtC+B;AACT;"}
|
|
1
|
+
{"version":3,"file":"getAxesDataFromForms.js","sources":["../../../src/utils/createChartSettingsForRender/getAxesDataFromForms.ts"],"sourcesContent":["import type { AxesState } from '../../constantsCommon';\nimport type { ChartType, InputGuide, InputState } from '@milaboratories/pf-plots';\nimport type { LabelsRotation, ReactiveState, UniqueValuesBySourceMap, UniqueValuesData } from '../../types';\nimport type { AxisSettingsContinuous } from '@milaboratories/miplots4';\nimport type { AxisSettingsDiscrete } from '@milaboratories/miplots4';\nimport type { HeatmapSettings } from '@milaboratories/miplots4';\n\ntype AxesSettings = {\n xAxis: AxisSettingsDiscrete | AxisSettingsContinuous | HeatmapSettings['xAxis'];\n yAxis: AxisSettingsDiscrete | AxisSettingsContinuous | HeatmapSettings['yAxis'];\n frame: { type: string };\n orientation?: string;\n title?: Record<string, string>;\n facetSettings: {\n nCols: number;\n sharedX?: boolean;\n sharedY?: boolean;\n };\n groupingDirection?: AxesState['other']['groupingDirection'];\n groupingStack?: AxesState['other']['groupingStack'];\n};\n\nconst HORIZONTAL_CAPTURES_MAX_COUNT = 6;\nconst SHORT_LABEL_MAX_LENGTH = 5;\n\nexport function getDiscreteLabelsRotation(value: LabelsRotation | null, discreteGroups: UniqueValuesData['options'] = []) {\n if (value !== null) {\n return value;\n }\n if (\n discreteGroups.length > HORIZONTAL_CAPTURES_MAX_COUNT\n && discreteGroups.some(({ label }) => label.length > SHORT_LABEL_MAX_LENGTH)\n ) {\n return '45deg';\n }\n return 'center';\n}\n\nexport function getAxesDataFromFormsScatterplot(\n axesFormsData: AxesState,\n uniqueValues: UniqueValuesBySourceMap,\n optionsState: ReactiveState['optionsState'],\n inputGuide: InputGuide<InputState>,\n): AxesSettings {\n let xAxis: AxisSettingsContinuous | AxisSettingsDiscrete = {};\n let yAxis: AxisSettingsContinuous | AxisSettingsDiscrete = {};\n xAxis.showGrid = axesFormsData.axisX.gridlines;\n xAxis.showTicks = axesFormsData.axisX.ticks;\n yAxis.showGrid = axesFormsData.axisY.gridlines;\n yAxis.showTicks = axesFormsData.axisY.ticks;\n\n const xSource = optionsState.components.x.selectorStates?.[0].selectedSource ?? null;\n const ySource = optionsState.components.y.selectorStates?.[0].selectedSource ?? null;\n const infoX = xSource ? inputGuide.getSourceInfo(xSource) : null;\n const infoY = ySource ? inputGuide.getSourceInfo(ySource) : null;\n\n const isDiscreteX = infoX?.type === 'String';\n const isDiscreteY = infoY?.type === 'String';\n\n if (isDiscreteX) {\n xAxis = xAxis as AxisSettingsDiscrete;\n xAxis.scale = 'discrete';\n xAxis.labelsPosition = axesFormsData.axisX.labelsRotation ?? 'center';\n\n const saved = axesFormsData.axisX.order?.source === xSource;\n const uniqueList = uniqueValues[xSource]?.list;\n const uniqueLabels = uniqueValues[xSource]?.labels;\n const keys = saved ? axesFormsData.axisX.order?.options.map((v) => v.value) ?? uniqueList : uniqueList;\n const labels = saved\n ? axesFormsData.axisX.order?.options.reduce((res, v) => {\n res[v.value] = v.label;\n return res;\n }, {} as Record<string, string>) ?? uniqueLabels\n : uniqueLabels;\n if (keys && labels) {\n xAxis.keys = keys;\n xAxis.labels = labels;\n };\n } else {\n xAxis = xAxis as AxisSettingsContinuous;\n xAxis.scale = axesFormsData.axisX.scale;\n xAxis.significantLinesStyle = axesFormsData.axisX.significantLinesStyle;\n }\n\n if (isDiscreteY) {\n yAxis = yAxis as AxisSettingsDiscrete;\n yAxis.scale = 'discrete';\n yAxis.labelsPosition = axesFormsData.axisY.labelsRotation ?? 'center';\n\n const uniqueList = uniqueValues[ySource]?.list;\n const uniqueLabels = uniqueValues[ySource]?.labels;\n const saved = axesFormsData.axisY.order?.source === ySource;\n const keys = saved ? axesFormsData.axisY.order?.options.map((v) => v.value) ?? uniqueList : uniqueList;\n const labels = saved\n ? axesFormsData.axisY.order?.options.reduce((res, v) => {\n res[v.value] = v.label;\n return res;\n }, {} as Record<string, string>) ?? uniqueLabels\n : uniqueLabels;\n if (keys && labels) {\n yAxis.keys = keys;\n yAxis.labels = labels;\n };\n } else {\n yAxis = yAxis as AxisSettingsContinuous;\n yAxis.scale = axesFormsData.axisY.scale;\n yAxis.significantLinesStyle = axesFormsData.axisY.significantLinesStyle;\n }\n\n if (axesFormsData.axisY.titleMode !== 'auto') {\n yAxis.title = axesFormsData.axisY.titleMode === 'custom' ? axesFormsData.axisY.customTitle : '';\n }\n if (axesFormsData.axisX.titleMode !== 'auto') {\n xAxis.title = axesFormsData.axisX.titleMode === 'custom' ? axesFormsData.axisX.customTitle : '';\n }\n\n (xAxis as AxisSettingsContinuous).hiddenLabels = axesFormsData.axisX.hideAxisLabels;\n (yAxis as AxisSettingsContinuous).hiddenLabels = axesFormsData.axisY.hideAxisLabels;\n\n const result: AxesSettings = {\n xAxis,\n yAxis,\n frame: { type: axesFormsData.other.frame },\n facetSettings: {\n nCols: axesFormsData.other.facetColumns,\n },\n };\n result.facetSettings.sharedX = (['x', 'xy']).includes(axesFormsData.other.facetSharedBy);\n result.facetSettings.sharedY = (['y', 'xy']).includes(axesFormsData.other.facetSharedBy);\n\n return result;\n}\n\nexport function getAxesDataFromForms(axesFormsData: AxesState, chartType: ChartType, discreteGroups: UniqueValuesData['options'] = []): AxesSettings {\n const xAxis: AxesSettings['xAxis'] = {};\n const yAxis: AxesSettings['yAxis'] = {};\n if (chartType === 'discrete') {\n (xAxis as AxisSettingsDiscrete).labelsPosition = getDiscreteLabelsRotation(axesFormsData.axisX.labelsRotation, discreteGroups);\n (xAxis as AxisSettingsDiscrete).linesBetweenCategories = axesFormsData.axisX.linesBetweenCategories;\n (yAxis as AxisSettingsContinuous).scale = axesFormsData.axisY.scale;\n (xAxis as AxisSettingsDiscrete).showGrid = axesFormsData.axisX.gridlines;\n (xAxis as AxisSettingsDiscrete).showTicks = axesFormsData.axisX.ticks;\n (xAxis as AxisSettingsDiscrete).hiddenLabels = axesFormsData.axisX.hideAxisLabels;\n (yAxis as AxisSettingsDiscrete).hiddenLabels = axesFormsData.axisY.hideAxisLabels;\n (yAxis as AxisSettingsContinuous).showGrid = axesFormsData.axisY.gridlines;\n (yAxis as AxisSettingsContinuous).showTicks = axesFormsData.axisY.ticks;\n }\n if (chartType === 'histogram') {\n (xAxis as AxisSettingsContinuous).scale = axesFormsData.axisX.scale;\n (yAxis as AxisSettingsContinuous).scale = axesFormsData.axisY.scale;\n (xAxis as AxisSettingsContinuous).hiddenLabels = axesFormsData.axisX.hideAxisLabels;\n (yAxis as AxisSettingsContinuous).hiddenLabels = axesFormsData.axisY.hideAxisLabels;\n (xAxis as AxisSettingsContinuous).showTicks = axesFormsData.axisX.ticks;\n (yAxis as AxisSettingsContinuous).showTicks = axesFormsData.axisY.ticks;\n (xAxis as AxisSettingsContinuous).showGrid = axesFormsData.axisX.gridlines;\n (yAxis as AxisSettingsContinuous).showGrid = axesFormsData.axisY.gridlines;\n }\n if (chartType === 'heatmap' || chartType === 'bubble') {\n (xAxis as HeatmapSettings['xAxis'])!.axisLabelsAngle = axesFormsData.axisX.axisLabelsAngle;\n (xAxis as HeatmapSettings['xAxis'])!.groupLabelsAngle = axesFormsData.axisX.groupLabelsAngle;\n (yAxis as HeatmapSettings['yAxis'])!.axisLabelsAngle = axesFormsData.axisY.axisLabelsAngle;\n (yAxis as HeatmapSettings['yAxis'])!.groupLabelsAngle = axesFormsData.axisY.groupLabelsAngle;\n (xAxis as HeatmapSettings['xAxis'])!.sorting = axesFormsData.axisX.sorting;\n (yAxis as HeatmapSettings['yAxis'])!.sorting = axesFormsData.axisY.sorting;\n (xAxis as HeatmapSettings['xAxis'])!.showAxisLabels = !axesFormsData.axisX.hideAxisLabels;\n (yAxis as HeatmapSettings['yAxis'])!.showAxisLabels = !axesFormsData.axisY.hideAxisLabels;\n (xAxis as HeatmapSettings['xAxis'])!.showGroupLabels = !axesFormsData.axisX.hideAxisGroupLabels;\n (yAxis as HeatmapSettings['yAxis'])!.showGroupLabels = !axesFormsData.axisY.hideAxisGroupLabels;\n (xAxis as HeatmapSettings['xAxis'])!.showTicks = axesFormsData.axisX.ticks;\n (yAxis as HeatmapSettings['yAxis'])!.showTicks = axesFormsData.axisY.ticks;\n }\n if (axesFormsData.axisY.titleMode !== 'auto') {\n yAxis!.title = axesFormsData.axisY.titleMode === 'custom' ? axesFormsData.axisY.customTitle : '';\n }\n if (axesFormsData.axisX.titleMode !== 'auto') {\n xAxis!.title = axesFormsData.axisX.titleMode === 'custom' ? axesFormsData.axisX.customTitle : '';\n }\n\n const result: AxesSettings = {\n xAxis,\n yAxis,\n frame: { type: axesFormsData.other.frame },\n facetSettings: {\n nCols: axesFormsData.other.facetColumns,\n },\n };\n\n if (chartType === 'discrete' || chartType === 'scatterplot' || chartType === 'heatmap') {\n result.orientation = axesFormsData.other.reverse ? 'horizontal' : 'vertical';\n result.facetSettings.sharedX = (['x', 'xy']).includes(axesFormsData.other.facetSharedBy);\n result.facetSettings.sharedY = (['y', 'xy']).includes(axesFormsData.other.facetSharedBy);\n }\n if (chartType === 'histogram') {\n result.groupingDirection = axesFormsData.other.groupingDirection;\n result.groupingStack = axesFormsData.other.groupingStack;\n }\n return result;\n}\n"],"names":["getDiscreteLabelsRotation","value","discreteGroups","label","getAxesDataFromFormsScatterplot","axesFormsData","uniqueValues","optionsState","inputGuide","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","xAxis","yAxis","xSource","ySource","infoX","infoY","isDiscreteX","isDiscreteY","saved","uniqueList","uniqueLabels","keys","v","labels","res","result","getAxesDataFromForms","chartType"],"mappings":"AAyBO,SAASA,EAA0BC,GAA8BC,IAA8C,IAAI;AACxH,SAAID,MAAU,OACLA,IAGPC,EAAe,SAAS,KACrBA,EAAe,KAAK,CAAC,EAAE,OAAAC,QAAYA,EAAM,SAAS,CAAsB,IAEpE,UAEF;AACT;AAEO,SAASC,EACdC,GACAC,GACAC,GACAC,GACc;AArBhB,MAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAA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B,EAAoC,iBAAiB,CAAChB,EAAc,MAAM,gBAC1EiB,EAAoC,iBAAiB,CAACjB,EAAc,MAAM,gBAC1EgB,EAAoC,kBAAkB,CAAChB,EAAc,MAAM,qBAC3EiB,EAAoC,kBAAkB,CAACjB,EAAc,MAAM,qBAC3EgB,EAAoC,YAAYhB,EAAc,MAAM,OACpEiB,EAAoC,YAAYjB,EAAc,MAAM,QAEnEA,EAAc,MAAM,cAAc,WACpCiB,EAAO,QAAQjB,EAAc,MAAM,cAAc,WAAWA,EAAc,MAAM,cAAc,KAE5FA,EAAc,MAAM,cAAc,WACpCgB,EAAO,QAAQhB,EAAc,MAAM,cAAc,WAAWA,EAAc,MAAM,cAAc;AAGhG,QAAM+B,IAAuB;AAAA,IAC3B,OAAAf;AAAA,IACA,OAAAC;AAAA,IACA,OAAO,EAAE,MAAMjB,EAAc,MAAM,MAAA;AAAA,IACnC,eAAe;AAAA,MACb,OAAOA,EAAc,MAAM;AAAA,IAAA;AAAA,EAC7B;AAGF,UAAIiC,MAAc,cAAcA,MAAc,iBAAiBA,MAAc,eAC3EF,EAAO,cAAc/B,EAAc,MAAM,UAAU,eAAe,YAClE+B,EAAO,cAAc,UAAW,CAAC,KAAK,IAAI,EAAG,SAAS/B,EAAc,MAAM,aAAa,GACvF+B,EAAO,cAAc,UAAW,CAAC,KAAK,IAAI,EAAG,SAAS/B,EAAc,MAAM,aAAa,IAErFiC,MAAc,gBAChBF,EAAO,oBAAoB/B,EAAc,MAAM,mBAC/C+B,EAAO,gBAAgB/B,EAAc,MAAM,gBAEtC+B;AACT;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { FilterSuggestionsBySourceMap, UniqueValuesBySourceMap } from '../types';
|
|
1
|
+
import { FilterLabelsInfoBySourceMap, FilterSuggestionsBySourceMap, UniqueValuesBySourceMap } from '../types';
|
|
2
2
|
import { Controller, DemoDataStore, InputGuide, InputState, PlotDataAndSettings } from '@milaboratories/pf-plots';
|
|
3
|
-
import { ListOption } from '@platforma-sdk/ui-vue';
|
|
4
3
|
export declare function getUniqueValuesFromReadyChartData(chartData: PlotDataAndSettings, inputGuide: InputGuide<InputState>, optionsState: InputState['components'], controller: Controller<InputState>, dataStore: DemoDataStore, previousFilterSuggestions: FilterSuggestionsBySourceMap): Promise<{
|
|
5
4
|
uniqueValues: UniqueValuesBySourceMap;
|
|
6
5
|
filterSuggestions: FilterSuggestionsBySourceMap;
|
|
7
6
|
}>;
|
|
8
|
-
export declare function loadFilterLabelsForTitle(optionsState: InputState['components'], inputGuide: InputGuide<InputState>, controller: Controller<InputState>, dataStore: DemoDataStore): Promise<
|
|
7
|
+
export declare function loadFilterLabelsForTitle(optionsState: InputState['components'], inputGuide: InputGuide<InputState>, controller: Controller<InputState>, dataStore: DemoDataStore): Promise<FilterLabelsInfoBySourceMap>;
|
|
@@ -73,8 +73,8 @@ async function L(t, u, c, r) {
|
|
|
73
73
|
});
|
|
74
74
|
const l = {};
|
|
75
75
|
for (const [n, o] of a)
|
|
76
|
-
(await Promise.all(o.map((e) => c.getUniqueSourceValuesWithLabels(r, u, n, 1, void 0, e)))).forEach((e) => {
|
|
77
|
-
e.values.length
|
|
76
|
+
(await Promise.all(o.map((e) => c.getUniqueSourceValuesWithLabels(r, u, n, 1, void 0, e)))).forEach((e, i) => {
|
|
77
|
+
e.values.length > 0 && (l[n] || (l[n] = {}), l[n][o[i]] = e.values[0]);
|
|
78
78
|
});
|
|
79
79
|
return l;
|
|
80
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadUniqueValuesToSave.js","sources":["../../src/utils/loadUniqueValuesToSave.ts"],"sourcesContent":["import type { FilterSuggestionsBySourceMap, UniqueValuesBySourceMap } from '../types';\nimport type {\n ComponentStateFilter,\n Controller,\n DemoDataStore,\n InputGuide,\n InputState,\n PlotDataAndSettings,\n SelectorStateFilter,\n} from '@milaboratories/pf-plots';\nimport type { ListOption } from '@platforma-sdk/ui-vue';\nimport type { DendroSettings, DiscreteSettings, HistogramSettings, ScatterplotSettings } from '@milaboratories/miplots4';\n\nconst SAVED_UNIQUE_VALUES_LIMIT = 100;\n\nconst SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS = ['primaryGrouping', 'secondaryGrouping'];\nconst SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS = ['grouping'];\nconst SAVED_IN_CHART_DATA_SCATTERPLOT_XY = ['x', 'y'];\nconst SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING = ['grouping'];\nconst SAVED_IN_CHART_DATA_DENDRO_GROUPING = [\n 'nodeColor', 'nodeShape', 'lineColor', 'heatmapAnnotation', // dendro\n];\n\nconst FILTER_INPUTS = ['filters', 'highlight', 'tabBy'] as ((keyof InputState['components'])[]);\n\nconst sortValues = (values: { value: string; label: string }[]) => values.sort((a, b) => a.label.localeCompare(b.label, 'en', { numeric: true }));\n\nfunction addUniqueData(chartData: PlotDataAndSettings, resultMap: UniqueValuesBySourceMap, sourceId: string, labelId?: string) {\n const data = chartData!.data.byColumns.values[sourceId];\n const dataLabels = labelId ? chartData!.data.byColumns.values[labelId] : null;\n\n const resultSet = new Set();\n const result: { value: string; label: string }[] = [];\n for (let i = 0; i < data.length; i++) {\n const v = String(data[i]);\n if (resultSet.has(v)) {\n continue;\n }\n if (resultSet.size === SAVED_UNIQUE_VALUES_LIMIT) {\n resultMap[sourceId] = null;\n return;\n }\n resultSet.add(v);\n const label = dataLabels ? String(dataLabels[i]) : v;\n result.push({ value: v, label });\n }\n sortValues(result);\n resultMap[sourceId] = {\n list: result.map((el) => el.value),\n labels: result.reduce((res, el) => {\n res[el.value] = el.label;\n return res;\n }, {} as Record<string, string>),\n options: result,\n };\n}\n\nexport async function getUniqueValuesFromReadyChartData(\n chartData: PlotDataAndSettings,\n inputGuide: InputGuide<InputState>,\n optionsState: InputState['components'],\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n previousFilterSuggestions: FilterSuggestionsBySourceMap,\n): Promise<{ uniqueValues: UniqueValuesBySourceMap; filterSuggestions: FilterSuggestionsBySourceMap }> {\n const resultMap: UniqueValuesBySourceMap = {};\n\n if (chartData.settings.type === 'discrete') {\n SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS.forEach((inputName: string) => {\n const savedData = chartData.settings[inputName] as unknown as DiscreteSettings['primaryGrouping'];\n if (savedData) {\n const { columnName } = savedData;\n addUniqueData(chartData, resultMap, columnName.value, columnName.valueLabels);\n }\n });\n }\n if (chartData.settings.type === 'scatterplot' || chartData.settings.type === 'scatterplot-umap') {\n SAVED_IN_CHART_DATA_SCATTERPLOT_XY.forEach((inputName: string) => {\n const columnName = chartData.settings[inputName] as unknown as ScatterplotSettings['x'];\n if (columnName) {\n const valueType = inputGuide.getSourceInfo(columnName.value).type;\n if (valueType === 'String') {\n addUniqueData(chartData, resultMap, columnName.value, columnName.valueLabels);\n }\n }\n });\n SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS.forEach((inputName: string) => {\n const savedInGrouping = chartData.settings[inputName] as unknown as ScatterplotSettings['grouping'];\n savedInGrouping?.forEach(({ columnName }) => {\n const valueType = inputGuide.getSourceInfo(columnName.value).type;\n if (valueType === 'String' || valueType === 'Int' || valueType === 'Long') {\n addUniqueData(chartData, resultMap, columnName.value, columnName.valueLabels);\n }\n });\n });\n }\n\n if (chartData.settings.type === 'histogram') {\n SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING.forEach((inputName: string) => {\n const savedByInputName = chartData.settings[inputName] as unknown as HistogramSettings['grouping'];\n if (savedByInputName) {\n addUniqueData(chartData, resultMap, savedByInputName.value, savedByInputName.valueLabels);\n }\n });\n }\n\n if (chartData.settings.type === 'dendro') {\n SAVED_IN_CHART_DATA_DENDRO_GROUPING.forEach((inputName: string) => {\n const savedByInputName = chartData.settings[inputName] as unknown as DendroSettings['heatmapAnnotation'];\n if (savedByInputName) {\n addUniqueData(chartData, resultMap, savedByInputName.value, savedByInputName.valueLabels);\n }\n });\n }\n\n const filterSuggestionsMap: FilterSuggestionsBySourceMap = { ...previousFilterSuggestions };\n\n // sources for loading\n const selectedSources: string[] = [];\n ([...inputGuide.fullOptionsSet]).forEach((id) => {\n const info = inputGuide.getSourceInfo(id);\n if (info.kind === 'axis' && info.isNonHomogenous) {\n selectedSources.push(id);\n }\n });\n FILTER_INPUTS.forEach((inputName) => {\n const componentState = optionsState[inputName] as ComponentStateFilter;\n if (!componentState) {\n return;\n }\n for (const { selectedSource, type } of componentState.selectorStates as SelectorStateFilter[]) {\n if (((inputName === 'filters' || inputName === 'highlight') && type === 'equals') || inputName === 'tabBy') {\n selectedSources.push(selectedSource);\n }\n }\n });\n for (const source of selectedSources) {\n if (filterSuggestionsMap[source]) {\n continue;\n } else if (dataStore) {\n filterSuggestionsMap[source] = await controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, SAVED_UNIQUE_VALUES_LIMIT);\n }\n }\n return { uniqueValues: resultMap, filterSuggestions: filterSuggestionsMap };\n}\n\nexport async function loadFilterLabelsForTitle(\n optionsState: InputState['components'],\n inputGuide: InputGuide<InputState>,\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n): Promise<Record<string, ListOption>> {\n const selected: [string, string[]][] = [];\n const INPUTS_REQUESTING_LABELS = ['filters', 'tabBy'] as ((keyof InputState['components'])[]);\n INPUTS_REQUESTING_LABELS.forEach((inputName) => {\n const componentState = optionsState[inputName];\n if (componentState) {\n for (const { selectedSource, selectedFilterValues, type } of componentState.selectorStates as SelectorStateFilter[]) {\n if (inputName === 'filters' && type === 'equals' && selectedFilterValues) {\n selected.push([selectedSource, selectedFilterValues]);\n } else if (selectedFilterValues) {\n selected.push([selectedSource, selectedFilterValues]);\n }\n }\n }\n });\n const result: Record<string, ListOption> = {};\n for (const [source, selectedValues] of selected) {\n const uniqueValuesResponses = await Promise.all(selectedValues.map((v) => controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, 1, undefined, v)));\n uniqueValuesResponses.forEach((response) => {\n if (response.values.length === 1) {\n result[source] = response.values[0];\n }\n });\n }\n return result;\n}\n"],"names":["SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS","SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS","SAVED_IN_CHART_DATA_SCATTERPLOT_XY","SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING","SAVED_IN_CHART_DATA_DENDRO_GROUPING","FILTER_INPUTS","sortValues","values","a","b","addUniqueData","chartData","resultMap","sourceId","labelId","data","dataLabels","resultSet","result","i","v","label","el","res","getUniqueValuesFromReadyChartData","inputGuide","optionsState","controller","dataStore","previousFilterSuggestions","inputName","savedData","columnName","savedInGrouping","valueType","savedByInputName","filterSuggestionsMap","selectedSources","id","info","componentState","selectedSource","type","source","loadFilterLabelsForTitle","selected","selectedFilterValues","selectedValues","response"],"mappings":"AAeA,MAAMA,IAAyC,CAAC,mBAAmB,mBAAmB,GAChFC,IAA4C,CAAC,UAAU,GACvDC,IAAqC,CAAC,KAAK,GAAG,GAC9CC,IAAyC,CAAC,UAAU,GACpDC,IAAsC;AAAA,EAC1C;AAAA,EAAa;AAAA,EAAa;AAAA,EAAa;AAAA;AACzC,GAEMC,IAAgB,CAAC,WAAW,aAAa,OAAO,GAEhDC,IAAa,CAACC,MAA+CA,EAAO,KAAK,CAACC,GAAGC,MAAMD,EAAE,MAAM,cAAcC,EAAE,OAAO,MAAM,EAAE,SAAS,GAAA,CAAM,CAAC;AAEhJ,SAASC,EAAcC,GAAgCC,GAAoCC,GAAkBC,GAAkB;AAC7H,QAAMC,IAAOJ,EAAW,KAAK,UAAU,OAAOE,CAAQ,GAChDG,IAAaF,IAAUH,EAAW,KAAK,UAAU,OAAOG,CAAO,IAAI,MAEnEG,wBAAgB,IAAA,GAChBC,IAA6C,CAAA;AACnD,WAASC,IAAI,GAAGA,IAAIJ,EAAK,QAAQI,KAAK;AACpC,UAAMC,IAAI,OAAOL,EAAKI,CAAC,CAAC;AACxB,QAAIF,EAAU,IAAIG,CAAC;AACjB;AAEF,QAAIH,EAA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EAAE,cAAc/B,GAAW,mBAAmBwB,EAAA;AACvD;AAEA,eAAsBQ,EACpBlB,GACAD,GACAE,GACAC,GACqC;AACrC,QAAMiB,IAAiC,CAAA;AAEvC,EADiC,CAAC,WAAW,OAAO,EAC3B,QAAQ,CAACf,MAAc;AAC9C,UAAMU,IAAiBd,EAAaI,CAAS;AAC7C,QAAIU;AACF,iBAAW,EAAE,gBAAAC,GAAgB,sBAAAK,GAAsB,MAAAJ,EAAA,KAAUF,EAAe;AAC1E,QAAIV,MAAc,aAAaY,MAAS,YAAYI,IAClDD,EAAS,KAAK,CAACJ,GAAgBK,CAAoB,CAAC,IAC3CA,KACTD,EAAS,KAAK,CAACJ,GAAgBK,CAAoB,CAAC;AAAA,EAI5D,CAAC;AACD,QAAM5B,IAAqC,CAAA;AAC3C,aAAW,CAACyB,GAAQI,CAAc,KAAKF;AAErC,KAD8B,MAAM,QAAQ,IAAIE,EAAe,IAAI,CAAC3B,MAAMO,EAAW,gCAAgCC,GAAWH,GAAYkB,GAAQ,GAAG,QAAWvB,CAAC,CAAC,CAAC,GAC/I,QAAQ,CAAC4B,MAAa;AAC1C,MAAIA,EAAS,OAAO,WAAW,MAC7B9B,EAAOyB,CAAM,IAAIK,EAAS,OAAO,CAAC;AAAA,IAEtC,CAAC;AAEH,SAAO9B;AACT;"}
|
|
1
|
+
{"version":3,"file":"loadUniqueValuesToSave.js","sources":["../../src/utils/loadUniqueValuesToSave.ts"],"sourcesContent":["import type { FilterLabelsInfoBySourceMap, FilterSuggestionsBySourceMap, UniqueValuesBySourceMap } from '../types';\nimport type {\n ComponentStateFilter,\n Controller,\n DemoDataStore,\n InputGuide,\n InputState,\n PlotDataAndSettings,\n SelectorStateFilter,\n} from '@milaboratories/pf-plots';\nimport type { DendroSettings, DiscreteSettings, HistogramSettings, ScatterplotSettings } from '@milaboratories/miplots4';\n\nconst SAVED_UNIQUE_VALUES_LIMIT = 100;\n\nconst SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS = ['primaryGrouping', 'secondaryGrouping'];\nconst SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS = ['grouping'];\nconst SAVED_IN_CHART_DATA_SCATTERPLOT_XY = ['x', 'y'];\nconst SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING = ['grouping'];\nconst SAVED_IN_CHART_DATA_DENDRO_GROUPING = [\n 'nodeColor', 'nodeShape', 'lineColor', 'heatmapAnnotation', // dendro\n];\n\nconst FILTER_INPUTS = ['filters', 'highlight', 'tabBy'] as ((keyof InputState['components'])[]);\n\nconst sortValues = (values: { value: string; label: string }[]) => values.sort((a, b) => a.label.localeCompare(b.label, 'en', { numeric: true }));\n\nfunction addUniqueData(chartData: PlotDataAndSettings, resultMap: UniqueValuesBySourceMap, sourceId: string, labelId?: string) {\n const data = chartData!.data.byColumns.values[sourceId];\n const dataLabels = labelId ? chartData!.data.byColumns.values[labelId] : null;\n\n const resultSet = new Set();\n const result: { value: string; label: string }[] = [];\n for (let i = 0; i < data.length; i++) {\n const v = String(data[i]);\n if (resultSet.has(v)) {\n continue;\n }\n if (resultSet.size === SAVED_UNIQUE_VALUES_LIMIT) {\n resultMap[sourceId] = null;\n return;\n }\n resultSet.add(v);\n const label = dataLabels ? String(dataLabels[i]) : v;\n result.push({ value: v, label });\n }\n sortValues(result);\n resultMap[sourceId] = {\n list: result.map((el) => el.value),\n labels: result.reduce((res, el) => {\n res[el.value] = el.label;\n return res;\n }, {} as Record<string, string>),\n options: result,\n };\n}\n\nexport async function getUniqueValuesFromReadyChartData(\n chartData: PlotDataAndSettings,\n inputGuide: InputGuide<InputState>,\n optionsState: InputState['components'],\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n previousFilterSuggestions: FilterSuggestionsBySourceMap,\n): Promise<{ uniqueValues: UniqueValuesBySourceMap; filterSuggestions: FilterSuggestionsBySourceMap }> {\n const resultMap: UniqueValuesBySourceMap = {};\n\n if (chartData.settings.type === 'discrete') {\n SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS.forEach((inputName: string) => {\n const savedData = chartData.settings[inputName] as unknown as DiscreteSettings['primaryGrouping'];\n if (savedData) {\n const { columnName } = savedData;\n addUniqueData(chartData, resultMap, columnName.value, columnName.valueLabels);\n }\n });\n }\n if (chartData.settings.type === 'scatterplot' || chartData.settings.type === 'scatterplot-umap') {\n SAVED_IN_CHART_DATA_SCATTERPLOT_XY.forEach((inputName: string) => {\n const columnName = chartData.settings[inputName] as unknown as ScatterplotSettings['x'];\n if (columnName) {\n const valueType = inputGuide.getSourceInfo(columnName.value).type;\n if (valueType === 'String') {\n addUniqueData(chartData, resultMap, columnName.value, columnName.valueLabels);\n }\n }\n });\n SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS.forEach((inputName: string) => {\n const savedInGrouping = chartData.settings[inputName] as unknown as ScatterplotSettings['grouping'];\n savedInGrouping?.forEach(({ columnName }) => {\n const valueType = inputGuide.getSourceInfo(columnName.value).type;\n if (valueType === 'String' || valueType === 'Int' || valueType === 'Long') {\n addUniqueData(chartData, resultMap, columnName.value, columnName.valueLabels);\n }\n });\n });\n }\n\n if (chartData.settings.type === 'histogram') {\n SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING.forEach((inputName: string) => {\n const savedByInputName = chartData.settings[inputName] as unknown as HistogramSettings['grouping'];\n if (savedByInputName) {\n addUniqueData(chartData, resultMap, savedByInputName.value, savedByInputName.valueLabels);\n }\n });\n }\n\n if (chartData.settings.type === 'dendro') {\n SAVED_IN_CHART_DATA_DENDRO_GROUPING.forEach((inputName: string) => {\n const savedByInputName = chartData.settings[inputName] as unknown as DendroSettings['heatmapAnnotation'];\n if (savedByInputName) {\n addUniqueData(chartData, resultMap, savedByInputName.value, savedByInputName.valueLabels);\n }\n });\n }\n\n const filterSuggestionsMap: FilterSuggestionsBySourceMap = { ...previousFilterSuggestions };\n\n // sources for loading\n const selectedSources: string[] = [];\n ([...inputGuide.fullOptionsSet]).forEach((id) => {\n const info = inputGuide.getSourceInfo(id);\n if (info.kind === 'axis' && info.isNonHomogenous) {\n selectedSources.push(id);\n }\n });\n FILTER_INPUTS.forEach((inputName) => {\n const componentState = optionsState[inputName] as ComponentStateFilter;\n if (!componentState) {\n return;\n }\n for (const { selectedSource, type } of componentState.selectorStates as SelectorStateFilter[]) {\n if (((inputName === 'filters' || inputName === 'highlight') && type === 'equals') || inputName === 'tabBy') {\n selectedSources.push(selectedSource);\n }\n }\n });\n for (const source of selectedSources) {\n if (filterSuggestionsMap[source]) {\n continue;\n } else if (dataStore) {\n filterSuggestionsMap[source] = await controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, SAVED_UNIQUE_VALUES_LIMIT);\n }\n }\n return { uniqueValues: resultMap, filterSuggestions: filterSuggestionsMap };\n}\n\nexport async function loadFilterLabelsForTitle(\n optionsState: InputState['components'],\n inputGuide: InputGuide<InputState>,\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n): Promise<FilterLabelsInfoBySourceMap> {\n const selected: [string, string[]][] = [];\n const INPUTS_REQUESTING_LABELS = ['filters', 'tabBy'] as ((keyof InputState['components'])[]);\n INPUTS_REQUESTING_LABELS.forEach((inputName) => {\n const componentState = optionsState[inputName];\n if (componentState) {\n for (const { selectedSource, selectedFilterValues, type } of componentState.selectorStates as SelectorStateFilter[]) {\n if (inputName === 'filters' && type === 'equals' && selectedFilterValues) {\n selected.push([selectedSource, selectedFilterValues]);\n } else if (selectedFilterValues) {\n selected.push([selectedSource, selectedFilterValues]);\n }\n }\n }\n });\n const result: FilterLabelsInfoBySourceMap = {};\n for (const [source, selectedValues] of selected) {\n const uniqueValuesResponses = await Promise.all(selectedValues.map((v) => controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, 1, undefined, v)));\n uniqueValuesResponses.forEach((response, idx) => {\n if (response.values.length > 0) {\n if (!result[source]) {\n result[source] = {};\n }\n result[source][selectedValues[idx] as string] = response.values[0];\n }\n });\n }\n return result;\n}\n"],"names":["SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS","SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS","SAVED_IN_CHART_DATA_SCATTERPLOT_XY","SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING","SAVED_IN_CHART_DATA_DENDRO_GROUPING","FILTER_INPUTS","sortValues","values","a","b","addUniqueData","chartData","resultMap","sourceId","labelId","data","dataLabels","resultSet","result","i","v","label","el","res","getUniqueValuesFromReadyChartData","inputGuide","optionsState","controller","dataStore","previousFilterSuggestions","inputName","savedData","columnName","savedInGrouping","valueType","savedByInputName","filterSuggestionsMap","selectedSources","id","info","componentState","selectedSource","type","source","loadFilterLabelsForTitle","selected","selectedFilterValues","selectedValues","response","idx"],"mappings":"AAcA,MAAMA,IAAyC,CAAC,mBAAmB,mBAAmB,GAChFC,IAA4C,CAAC,UAAU,GACvDC,IAAqC,CAAC,KAAK,GAAG,GAC9CC,IAAyC,CAAC,UAAU,GACpDC,IAAsC;AAAA,EAC1C;AAAA,EAAa;AAAA,EAAa;AAAA,EAAa;AAAA;AACzC,GAEMC,IAAgB,CAAC,WAAW,aAAa,OAAO,GAEhDC,IAAa,CAACC,MAA+CA,EAAO,KAAK,CAACC,GAAGC,MAAMD,EAAE,MAAM,cAAcC,EAAE,OAAO,MAAM,EAAE,SAAS,GAAA,CAAM,CAAC;AAEhJ,SAASC,EAAcC,GAAgCC,GAAoCC,GAAkBC,GAAkB;AAC7H,QAAMC,IAAOJ,EAAW,KAAK,UAAU,OAAOE,CAAQ,GAChDG,IAAaF,IAAUH,EAAW,KAAK,UAAU,OAAOG,CAAO,IAAI,MAEnEG,wBAAgB,IAAA,GAChBC,IAA6C,CAAA;AACnD,WAASC,IAAI,GAAGA,IAAIJ,EAAK,QAAQI,KAAK;AACpC,UAAMC,IAAI,OAAOL,EAAKI,CAAC,CAAC;AACxB,QAAIF,EAAU,IAAIG,CAAC;AACjB;AAEF,QAAIH,EAAU,SAAS,KAA2B;AAChD,MAAAL,EAAUC,CAAQ,IAAI;AACtB;AAAA,IACF;A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GACAD,GACAE,GACAC,GACsC;AACtC,QAAMiB,IAAiC,CAAA;AAEvC,EADiC,CAAC,WAAW,OAAO,EAC3B,QAAQ,CAACf,MAAc;AAC9C,UAAMU,IAAiBd,EAAaI,CAAS;AAC7C,QAAIU;AACF,iBAAW,EAAE,gBAAAC,GAAgB,sBAAAK,GAAsB,MAAAJ,EAAA,KAAUF,EAAe;AAC1E,QAAIV,MAAc,aAAaY,MAAS,YAAYI,IAClDD,EAAS,KAAK,CAACJ,GAAgBK,CAAoB,CAAC,IAC3CA,KACTD,EAAS,KAAK,CAACJ,GAAgBK,CAAoB,CAAC;AAAA,EAI5D,CAAC;AACD,QAAM5B,IAAsC,CAAA;AAC5C,aAAW,CAACyB,GAAQI,CAAc,KAAKF;AAErC,KAD8B,MAAM,QAAQ,IAAIE,EAAe,IAAI,CAAC3B,MAAMO,EAAW,gCAAgCC,GAAWH,GAAYkB,GAAQ,GAAG,QAAWvB,CAAC,CAAC,CAAC,GAC/I,QAAQ,CAAC4B,GAAUC,MAAQ;AAC/C,MAAID,EAAS,OAAO,SAAS,MACtB9B,EAAOyB,CAAM,MAChBzB,EAAOyB,CAAM,IAAI,CAAA,IAEnBzB,EAAOyB,CAAM,EAAEI,EAAeE,CAAG,CAAW,IAAID,EAAS,OAAO,CAAC;AAAA,IAErE,CAAC;AAEH,SAAO9B;AACT;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/graph-maker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.197",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@ag-grid-community/core": "^32.3.3",
|
|
30
30
|
"@milaboratories/helpers": "^1.6.15",
|
|
31
|
-
"@platforma-sdk/model": "^1.
|
|
32
|
-
"@platforma-sdk/ui-vue": "^1.
|
|
31
|
+
"@platforma-sdk/model": "^1.48.14",
|
|
32
|
+
"@platforma-sdk/ui-vue": "^1.48.14",
|
|
33
33
|
"@types/d3-hierarchy": "^3.1.7",
|
|
34
34
|
"@types/d3-scale": "^4.0.8",
|
|
35
35
|
"@vueuse/core": "^13.1.0",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"d3-hierarchy": "^3.1.2",
|
|
39
39
|
"d3-scale": "^4.0.2",
|
|
40
40
|
"vue": "^3.5.24",
|
|
41
|
-
"@milaboratories/miplots4": "1.0.
|
|
42
|
-
"@milaboratories/pf-plots": "1.1.
|
|
41
|
+
"@milaboratories/miplots4": "1.0.163",
|
|
42
|
+
"@milaboratories/pf-plots": "1.1.53"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@milaboratories/build-configs": "^1.0.8",
|