@milaboratories/graph-maker 1.1.168 → 1.1.169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GraphMaker/constantsCommon.d.ts +3 -0
- package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
- package/dist/GraphMaker/constantsCommon.js +9 -6
- package/dist/GraphMaker/constantsCommon.js.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/BubbleForm.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/DataMappingForm/BubbleForm.vue.js +60 -56
- package/dist/GraphMaker/forms/DataMappingForm/BubbleForm.vue.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/Bubble.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/Bubble.vue.js +86 -58
- package/dist/GraphMaker/forms/LayersForm/Layer/Bubble.vue.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/heatmap/Heatmap.vue.js +109 -112
- package/dist/GraphMaker/forms/LayersForm/Layer/heatmap/Heatmap.vue.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +20 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.js +19 -15
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +3 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +8 -8
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js +23 -23
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/BubbleSettingsImpl.js +19 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/BubbleSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js +132 -132
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js +53 -53
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js +7 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js +49 -83
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +51 -34
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/utils/calculateCaptionTails.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +2 -2
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/AnnotationCellsCanvas.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/AnnotationCellsSvg.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/CanvasCells.js +31 -31
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/CanvasCells.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +20 -20
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +12 -12
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/SvgCells.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/SvgCells.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/tooltipUtils.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/tooltipUtils.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/fillCellsData.js +244 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/fillCellsData.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +28 -214
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getDendrograms.js +26 -26
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getDendrograms.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +8 -8
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/bubble.js +23 -12
- package/dist/node_modules/@milaboratories/miplots4/dist/types/bubble.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/getFacetOrGroupKey.js +7 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/getFacetOrGroupKey.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +165 -95
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -1
- package/package.json +3 -3
package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateCaptionTails.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/heatmap/utils/calculateCaptionTails.ts"],"sourcesContent":["import type { TextMeasurer } from '../../utils/TextMeasurer/TextMeasurer';\nimport type { ChartsScales, LabelAngles } from '../components/types';\nimport { MIN_STEP_FOR_VISIBLE_LABELS } from '../constants';\nimport type {
|
|
1
|
+
{"version":3,"file":"calculateCaptionTails.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/heatmap/utils/calculateCaptionTails.ts"],"sourcesContent":["import type { TextMeasurer } from '../../utils/TextMeasurer/TextMeasurer';\nimport type { ChartsScales, LabelAngles } from '../components/types';\nimport { MIN_STEP_FOR_VISIBLE_LABELS } from '../constants';\nimport type { GroupedCellsHeatmap } from '../getCells';\nimport type { HeatmapSettingsImpl } from '../HeatmapSettingsImpl';\n\nconst COS_PI_4 = Math.cos(Math.PI / 4);\nfunction getTailByFacetKey (\n facetKey: string,\n groupKeys: string[],\n groupLabels: Record<string, string>,\n valueLabels: Record<string, string>,\n getKeysInGroup: (facetKey:string, groupKey:string) => string[],\n steps: Record<string, number>,\n scale: (v:string) => number,\n groupTitleInclined: boolean,\n labelTitleInclined: boolean,\n textMeasurer: TextMeasurer\n): number {\n const step = steps[facetKey];\n const labelsVisible = step > MIN_STEP_FOR_VISIBLE_LABELS;\n\n let maxTail = 0;\n groupKeys.forEach((groupKey) => {\n const keysInGroup = getKeysInGroup(facetKey, groupKey);\n if (keysInGroup.length === 0) {\n return 0;\n }\n const groupHalfWidth = (keysInGroup.length * step) / 2;\n const groupTail = groupTitleInclined\n ? textMeasurer.getTextWidth(groupLabels[groupKey] ?? groupKey) * COS_PI_4 - groupHalfWidth - scale(keysInGroup[0])\n : 0;\n const labelTail = labelTitleInclined && labelsVisible\n ? keysInGroup.reduce((res, key) => {\n const label = valueLabels[key];\n return Math.max(res, textMeasurer.getTextWidth(label) * COS_PI_4 - step / 2 - scale(key));\n }, 0)\n : 0;\n maxTail = Math.max(maxTail, groupTail, labelTail);\n });\n return maxTail;\n}\n\nexport function calculateCaptionTails(\n labelAngles: LabelAngles,\n facetSettings: HeatmapSettingsImpl['facetSettings'],\n scales: ChartsScales,\n steps: {\n x: Record<string, number>;\n y: Record<string, number>;\n },\n groupedCells: GroupedCellsHeatmap,\n textMeasurer: TextMeasurer\n): {xCaptionTail: number; yCaptionTail: number} {\n const {facetKeys, xGroupKeys, yGroupKeys, xKeysByGroups, yKeysByGroups, xLabels, yLabels, xGroupLabels, yGroupLabels} = groupedCells.meta;\n let xCaptionTail = 0;\n let yCaptionTail = 0;\n // tails from 45deg inclined captions of groups titles/cells labels, that take place on adjacent padding\n const xGroupTitleInclined = labelAngles.xGroupLabels === 45;\n const xLabelsInclined = labelAngles.xAxisLabels === 45;\n if (xGroupTitleInclined || xLabelsInclined) {\n if (!facetSettings.sharedX) {\n facetKeys.forEach(facetKey => {\n xCaptionTail = Math.max(\n getTailByFacetKey(\n facetKey,\n xGroupKeys,\n xGroupLabels,\n xLabels,\n (facetKey:string, groupKey:string) => groupedCells.facets[facetKey].xKeysByGroups[groupKey],\n steps.x,\n scales.x[facetKey],\n xGroupTitleInclined,\n xLabelsInclined,\n textMeasurer\n ),\n xCaptionTail\n );\n });\n } else {\n const facetKey = facetKeys[0]; // there is no difference between facets in this case\n xCaptionTail = Math.max(\n getTailByFacetKey(\n facetKey,\n xGroupKeys,\n xGroupLabels,\n xLabels,\n (facetKey:string, groupKey:string) => xKeysByGroups[groupKey],\n steps.x,\n scales.x[facetKey],\n xGroupTitleInclined,\n xLabelsInclined,\n textMeasurer\n ),\n xCaptionTail\n );\n }\n }\n const yGroupTitleInclined = labelAngles.yGroupLabels === 45;\n const yLabelsInclined = labelAngles.yAxisLabels === 45;\n if (yGroupTitleInclined || yLabelsInclined) {\n if (!facetSettings.sharedY) {\n facetKeys.forEach(facetKey => {\n yCaptionTail = Math.max(\n getTailByFacetKey(\n facetKey,\n yGroupKeys,\n yGroupLabels,\n yLabels,\n (facetKey:string, groupKey:string) => groupedCells.facets[facetKey].yKeysByGroups[groupKey],\n steps.y,\n scales.y[facetKey],\n yGroupTitleInclined,\n yLabelsInclined,\n textMeasurer\n ),\n yCaptionTail\n );\n });\n } else {\n const facetKey = facetKeys[0]; // there is no difference between facets in this case\n yCaptionTail = Math.max(\n getTailByFacetKey(\n facetKey,\n yGroupKeys,\n yGroupLabels,\n yLabels,\n (facetKey:string, groupKey:string) => yKeysByGroups[groupKey],\n steps.y,\n scales.y[facetKey],\n yGroupTitleInclined,\n yLabelsInclined,\n textMeasurer\n ),\n yCaptionTail\n );\n }\n }\n return {xCaptionTail, yCaptionTail};\n}\n"],"names":["COS_PI_4","getTailByFacetKey","facetKey","groupKeys","groupLabels","valueLabels","getKeysInGroup","steps","scale","groupTitleInclined","labelTitleInclined","textMeasurer","step","labelsVisible","MIN_STEP_FOR_VISIBLE_LABELS","maxTail","groupKey","keysInGroup","groupHalfWidth","groupTail","labelTail","res","key","label","calculateCaptionTails","labelAngles","facetSettings","scales","groupedCells","facetKeys","xGroupKeys","yGroupKeys","xKeysByGroups","yKeysByGroups","xLabels","yLabels","xGroupLabels","yGroupLabels","xCaptionTail","yCaptionTail","xGroupTitleInclined","xLabelsInclined","yGroupTitleInclined","yLabelsInclined"],"mappings":";AAMA,MAAMA,IAAW,KAAK,IAAI,KAAK,KAAK,CAAC;AACrC,SAASC,EACLC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACM;AACN,QAAMC,IAAOL,EAAML,CAAQ,GACrBW,IAAgBD,IAAOE;AAE7B,MAAIC,IAAU;AACd,SAAAZ,EAAU,QAAQ,CAACa,MAAa;AAC5B,UAAMC,IAAcX,EAAeJ,GAAUc,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AAA;AAC1B;","x_google_ignoreList":[0]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ColumnNameSchema as
|
|
1
|
+
import { ColumnNameSchema as n, FrameTypeSchema as a, LegendPositionSchema as i, TitlePositionSchema as e } from "./common.js";
|
|
2
2
|
import o from "../node_modules/zod/lib/index.js";
|
|
3
|
-
const
|
|
3
|
+
const t = {
|
|
4
4
|
title: o.optional(o.string()),
|
|
5
5
|
showTicks: o.optional(o.boolean()),
|
|
6
6
|
showTitle: o.optional(o.boolean()),
|
|
7
7
|
showAxisLabels: o.optional(o.boolean()),
|
|
8
8
|
axisLabelsAngle: o.optional(o.union([o.literal(0), o.literal(45), o.literal(90)]))
|
|
9
|
-
},
|
|
9
|
+
}, p = o.object({
|
|
10
10
|
type: o.literal("bubble"),
|
|
11
11
|
title: o.object({
|
|
12
12
|
name: o.string(),
|
|
@@ -33,27 +33,38 @@ const n = {
|
|
|
33
33
|
nCols: o.optional(o.number())
|
|
34
34
|
})
|
|
35
35
|
),
|
|
36
|
-
valueSize:
|
|
37
|
-
valueColor:
|
|
38
|
-
xColumn:
|
|
39
|
-
yColumn:
|
|
36
|
+
valueSize: n,
|
|
37
|
+
valueColor: n,
|
|
38
|
+
xColumn: n,
|
|
39
|
+
yColumn: n,
|
|
40
|
+
xGroupBy: o.optional(o.array(n)),
|
|
41
|
+
yGroupBy: o.optional(o.array(n)),
|
|
42
|
+
keysOrder: o.optional(
|
|
43
|
+
// x, y, grouping, facet keys in user's order
|
|
44
|
+
o.record(o.string(), o.array(o.string()))
|
|
45
|
+
),
|
|
40
46
|
normalization: o.optional(o.object({
|
|
41
47
|
direction: o.enum(["row", "column"]),
|
|
42
48
|
method: o.enum(["standardScaling", "meanNormalization"]),
|
|
43
49
|
colorRange: o.optional(o.array(o.number())),
|
|
44
50
|
sizeRange: o.optional(o.array(o.number()))
|
|
45
51
|
})),
|
|
52
|
+
aggregation: o.optional(o.object({
|
|
53
|
+
x: o.optional(o.boolean()),
|
|
54
|
+
y: o.optional(o.boolean()),
|
|
55
|
+
method: o.optional(o.enum(["min", "max", "mean", "median"]))
|
|
56
|
+
})),
|
|
46
57
|
xAxis: o.optional(o.object({
|
|
47
|
-
...
|
|
58
|
+
...t,
|
|
48
59
|
sorting: o.optional(o.enum(["asc", "desc"])),
|
|
49
60
|
position: o.optional(o.enum(["top", "bottom"]))
|
|
50
61
|
})),
|
|
51
62
|
yAxis: o.optional(o.object({
|
|
52
|
-
...
|
|
63
|
+
...t,
|
|
53
64
|
sorting: o.optional(o.enum(["asc", "desc"])),
|
|
54
65
|
position: o.optional(o.enum(["left", "right"]))
|
|
55
66
|
})),
|
|
56
|
-
facetBy: o.optional(o.array(
|
|
67
|
+
facetBy: o.optional(o.array(n)),
|
|
57
68
|
aes: o.optional(o.object({
|
|
58
69
|
colorsList: o.optional(o.array(o.string())),
|
|
59
70
|
minRadius: o.optional(o.number()),
|
|
@@ -64,12 +75,12 @@ const n = {
|
|
|
64
75
|
tooltips: o.optional(
|
|
65
76
|
o.object({
|
|
66
77
|
show: o.optional(o.boolean()),
|
|
67
|
-
content: o.optional(o.array(
|
|
78
|
+
content: o.optional(o.array(n))
|
|
68
79
|
})
|
|
69
80
|
),
|
|
70
81
|
NAValueAs: o.optional(o.union([o.number(), o.null()]))
|
|
71
82
|
});
|
|
72
83
|
export {
|
|
73
|
-
|
|
84
|
+
p as BubblesSettingsSchema
|
|
74
85
|
};
|
|
75
86
|
//# sourceMappingURL=bubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubble.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/types/bubble.ts"],"sourcesContent":["import {\n ColumnNameSchema,\n FrameTypeSchema,\n LegendPositionSchema,\n TitlePositionSchema,\n} from './common';\nimport {z} from 'zod';\n\nconst axisCommonSchema = {\n title: z.optional(z.string()),\n showTicks: z.optional(z.boolean()),\n showTitle: z.optional(z.boolean()),\n showAxisLabels: z.optional(z.boolean()),\n axisLabelsAngle: z.optional(z.union([z.literal(0), z.literal(45), z.literal(90)])),\n};\n\n//const InheritAesSchema = z.object({type: z.literal('grouping'), value: z.string()}); // link to aes mapped to column\n\nexport const BubblesSettingsSchema = z.object({\n type: z.literal('bubble'),\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n size: z.optional(\n z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n cellSize: z.optional(z.number())\n })\n ),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n frame: z.optional(z.object({type: z.optional(FrameTypeSchema)})),\n facetSettings: z.optional(\n z.object({\n nRows: z.optional(z.number()),\n nCols: z.optional(z.number()),\n })\n ),\n valueSize: ColumnNameSchema,\n valueColor: ColumnNameSchema,\n xColumn: ColumnNameSchema,\n yColumn: ColumnNameSchema,\n normalization: z.optional(z.object({\n direction: z.enum(['row', 'column']),\n method: z.enum(['standardScaling', 'meanNormalization']),\n colorRange: z.optional(z.array(z.number())),\n sizeRange: z.optional(z.array(z.number())),\n })),\n xAxis: z.optional(z.object({\n ...axisCommonSchema,\n sorting: z.optional(z.enum(['asc', 'desc'])),\n position: z.optional(z.enum(['top', 'bottom'])),\n })),\n yAxis: z.optional(z.object({\n ...axisCommonSchema,\n sorting: z.optional(z.enum(['asc', 'desc'])),\n position: z.optional(z.enum(['left', 'right'])),\n })),\n facetBy: z.optional(z.array(ColumnNameSchema)),\n aes: z.optional(z.object({\n colorsList: z.optional(z.array(z.string())),\n minRadius: z.optional(z.number()),\n maxRadius: z.optional(z.number()),\n cellStrokeColor: z.optional(z.string()),\n emptyCellColor: z.optional(z.string()),\n })),\n tooltips: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n content: z.optional(z.array(ColumnNameSchema)),\n })\n ),\n NAValueAs: z.optional(z.union([z.number(), z.null()])),\n});\n\nexport type BubbleSettings = z.infer<typeof BubblesSettingsSchema>;\n"],"names":["axisCommonSchema","z","BubblesSettingsSchema","TitlePositionSchema","LegendPositionSchema","FrameTypeSchema","ColumnNameSchema"],"mappings":";;AAQA,MAAMA,IAAmB;AAAA,EACrB,OAAOC,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,EAC5B,WAAWA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EACjC,WAAWA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EACjC,gBAAgBA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EACtC,iBAAiBA,EAAE,SAASA,EAAE,MAAM,CAACA,EAAE,QAAQ,CAAC,GAAGA,EAAE,QAAQ,EAAE,GAAGA,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AACrF,GAIaC,IAAwBD,EAAE,OAAO;AAAA,EAC1C,MAAMA,EAAE,QAAQ,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO;AAAA,IACZ,MAAMA,EAAE,OAAA;AAAA,IACR,MAAMA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,IAC5B,UAAUA,EAAE,SAASE,CAAmB;AAAA,EAAA,CAC3C;AAAA,EACD,MAAMF,EAAE;AAAA,IACJA,EAAE,OAAO;AAAA,MACL,OAAOA,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,MAC5B,QAAQA,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,MAC7B,UAAUA,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,IAAA,CAClC;AAAA,EAAA;AAAA,EAEL,QAAQA,EAAE;AAAA,IACNA,EAAE,OAAO;AAAA,MACL,MAAMA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,MAC5B,UAAUA,EAAE,SAASG,CAAoB;AAAA,IAAA,CAC5C;AAAA,EAAA;AAAA,EAEL,OAAOH,EAAE,SAASA,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"bubble.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/types/bubble.ts"],"sourcesContent":["import {\n ColumnNameSchema,\n FrameTypeSchema,\n LegendPositionSchema,\n TitlePositionSchema,\n} from './common';\nimport { z } from 'zod';\n\nconst axisCommonSchema = {\n title: z.optional(z.string()),\n showTicks: z.optional(z.boolean()),\n showTitle: z.optional(z.boolean()),\n showAxisLabels: z.optional(z.boolean()),\n axisLabelsAngle: z.optional(z.union([z.literal(0), z.literal(45), z.literal(90)])),\n};\n\n//const InheritAesSchema = z.object({type: z.literal('grouping'), value: z.string()}); // link to aes mapped to column\n\nexport const BubblesSettingsSchema = z.object({\n type: z.literal('bubble'),\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n size: z.optional(\n z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n cellSize: z.optional(z.number())\n })\n ),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n frame: z.optional(z.object({ type: z.optional(FrameTypeSchema) })),\n facetSettings: z.optional(\n z.object({\n nRows: z.optional(z.number()),\n nCols: z.optional(z.number()),\n })\n ),\n valueSize: ColumnNameSchema,\n valueColor: ColumnNameSchema,\n xColumn: ColumnNameSchema,\n yColumn: ColumnNameSchema,\n xGroupBy: z.optional(z.array(ColumnNameSchema)),\n yGroupBy: z.optional(z.array(ColumnNameSchema)),\n keysOrder: z.optional( // x, y, grouping, facet keys in user's order\n z.record(z.string(), z.array(z.string()))\n ),\n normalization: z.optional(z.object({\n direction: z.enum(['row', 'column']),\n method: z.enum(['standardScaling', 'meanNormalization']),\n colorRange: z.optional(z.array(z.number())),\n sizeRange: z.optional(z.array(z.number())),\n })),\n aggregation: z.optional(z.object({\n x: z.optional(z.boolean()),\n y: z.optional(z.boolean()),\n method: z.optional(z.enum(['min', 'max', 'mean', 'median'])),\n })),\n xAxis: z.optional(z.object({\n ...axisCommonSchema,\n sorting: z.optional(z.enum(['asc', 'desc'])),\n position: z.optional(z.enum(['top', 'bottom'])),\n })),\n yAxis: z.optional(z.object({\n ...axisCommonSchema,\n sorting: z.optional(z.enum(['asc', 'desc'])),\n position: z.optional(z.enum(['left', 'right'])),\n })),\n facetBy: z.optional(z.array(ColumnNameSchema)),\n aes: z.optional(z.object({\n colorsList: z.optional(z.array(z.string())),\n minRadius: z.optional(z.number()),\n maxRadius: z.optional(z.number()),\n cellStrokeColor: z.optional(z.string()),\n emptyCellColor: z.optional(z.string()),\n })),\n tooltips: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n content: z.optional(z.array(ColumnNameSchema)),\n })\n ),\n NAValueAs: z.optional(z.union([z.number(), z.null()])),\n});\n\nexport type BubbleSettings = z.infer<typeof BubblesSettingsSchema>;\n"],"names":["axisCommonSchema","z","BubblesSettingsSchema","TitlePositionSchema","LegendPositionSchema","FrameTypeSchema","ColumnNameSchema"],"mappings":";;AAQA,MAAMA,IAAmB;AAAA,EACrB,OAAOC,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,EAC5B,WAAWA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EACjC,WAAWA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EACjC,gBAAgBA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EACtC,iBAAiBA,EAAE,SAASA,EAAE,MAAM,CAACA,EAAE,QAAQ,CAAC,GAAGA,EAAE,QAAQ,EAAE,GAAGA,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AACrF,GAIaC,IAAwBD,EAAE,OAAO;AAAA,EAC1C,MAAMA,EAAE,QAAQ,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO;AAAA,IACZ,MAAMA,EAAE,OAAA;AAAA,IACR,MAAMA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,IAC5B,UAAUA,EAAE,SAASE,CAAmB;AAAA,EAAA,CAC3C;AAAA,EACD,MAAMF,EAAE;AAAA,IACJA,EAAE,OAAO;AAAA,MACL,OAAOA,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,MAC5B,Q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CAAgB,CAAC;AAAA,IAAA,CAChD;AAAA,EAAA;AAAA,EAEL,WAAWL,EAAE,SAASA,EAAE,MAAM,CAACA,EAAE,OAAA,GAAUA,EAAE,KAAA,CAAM,CAAC,CAAC;AACzD,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFacetOrGroupKey.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/utils/getFacetOrGroupKey.ts"],"sourcesContent":["export function getFacetOrGroupKey(values: unknown[]): string {\n if (!values.length) {\n return 'null';\n }\n return values.join('_');\n}"],"names":["getFacetOrGroupKey","values"],"mappings":"AAAO,SAASA,EAAmBC,GAA2B;AAC1D,SAAKA,EAAO,SAGLA,EAAO,KAAK,GAAG,IAFX;AAGf;","x_google_ignoreList":[0]}
|
package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ControllerBase as
|
|
3
|
-
import { ComponentController as
|
|
4
|
-
import { AxisId as
|
|
5
|
-
import { createLinkerMap as
|
|
6
|
-
var Y = Object.defineProperty,
|
|
1
|
+
import M from "../../_virtual/canonicalize.js";
|
|
2
|
+
import { ControllerBase as V } from "../ControllerBase.js";
|
|
3
|
+
import { ComponentController as v } from "../ComponentController.js";
|
|
4
|
+
import { AxisId as T, columnOrAxisIdFromString as w, isColumnId as p } from "../../spec.js";
|
|
5
|
+
import { createLinkerMap as J, createMultipliesByMap as U, getFiltersFromStates as Z, getAxesSpecsFromSources as H, getLinkerColumnsForSource as N, getColumnOrAxisValueLabelsId as C, getColumnOrAxisLabel as g, getColumnOrAxisSpec as K, getFormat as X } from "../../utils.js";
|
|
6
|
+
var Y = Object.defineProperty, Q = (m, e, t) => e in m ? Y(m, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[e] = t, j = (m, e, t) => Q(m, typeof e != "symbol" ? e + "" : e, t);
|
|
7
7
|
const te = {
|
|
8
8
|
type: "bubble",
|
|
9
9
|
components: {
|
|
10
10
|
valueSize: { type: "simple", selectorStates: [] },
|
|
11
11
|
valueColor: { type: "simple", selectorStates: [] },
|
|
12
12
|
x: { type: "simple", selectorStates: [] },
|
|
13
|
+
xGroupBy: { type: "simple", selectorStates: [] },
|
|
13
14
|
y: { type: "simple", selectorStates: [] },
|
|
15
|
+
yGroupBy: { type: "simple", selectorStates: [] },
|
|
14
16
|
filters: { type: "filter", selectorStates: [] },
|
|
15
17
|
tabBy: { type: "filter", selectorStates: [] },
|
|
16
18
|
facetBy: { type: "simple", selectorStates: [] },
|
|
@@ -18,23 +20,23 @@ const te = {
|
|
|
18
20
|
},
|
|
19
21
|
dividedAxes: {}
|
|
20
22
|
};
|
|
21
|
-
function
|
|
23
|
+
function P(m, e) {
|
|
22
24
|
if (!e.length)
|
|
23
25
|
return [];
|
|
24
|
-
const t = e.map((
|
|
25
|
-
for (let
|
|
26
|
-
const
|
|
27
|
-
const d =
|
|
28
|
-
return
|
|
26
|
+
const t = e.map((s) => w(s)), c = Object.values(m.columnsData)[0].length, n = [];
|
|
27
|
+
for (let s = 0; s < c; s++) {
|
|
28
|
+
const i = t.map((S) => {
|
|
29
|
+
const d = S.toCanonicalString();
|
|
30
|
+
return p(S) ? m.columnsData[d][s] : m.axesData[d][s];
|
|
29
31
|
}).join(", ");
|
|
30
|
-
|
|
32
|
+
n.push(i);
|
|
31
33
|
}
|
|
32
|
-
return
|
|
34
|
+
return n;
|
|
33
35
|
}
|
|
34
|
-
class oe extends
|
|
36
|
+
class oe extends V {
|
|
35
37
|
constructor() {
|
|
36
38
|
super({
|
|
37
|
-
valueSize: new
|
|
39
|
+
valueSize: new v({
|
|
38
40
|
componentName: "valueSize",
|
|
39
41
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
40
42
|
strictlyDependsOnParents: !0,
|
|
@@ -46,7 +48,7 @@ class oe extends M {
|
|
|
46
48
|
required: !0
|
|
47
49
|
}
|
|
48
50
|
}),
|
|
49
|
-
valueColor: new
|
|
51
|
+
valueColor: new v({
|
|
50
52
|
componentName: "valueColor",
|
|
51
53
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
52
54
|
strictlyDependsOnParents: !0,
|
|
@@ -58,7 +60,7 @@ class oe extends M {
|
|
|
58
60
|
required: !0
|
|
59
61
|
}
|
|
60
62
|
}),
|
|
61
|
-
x: new
|
|
63
|
+
x: new v({
|
|
62
64
|
componentName: "x",
|
|
63
65
|
allowedTypes: ["Int", "String", "Long"],
|
|
64
66
|
strictlyDependsOnParents: !0,
|
|
@@ -71,7 +73,29 @@ class oe extends M {
|
|
|
71
73
|
columnsAllowed: !1
|
|
72
74
|
}
|
|
73
75
|
}),
|
|
74
|
-
|
|
76
|
+
xGroupBy: new v({
|
|
77
|
+
componentName: "xGroupBy",
|
|
78
|
+
allowedTypes: ["Int", "String", "Long"],
|
|
79
|
+
strictlyDependsOnParents: !0,
|
|
80
|
+
parentComponents: ["valueSize", "valueColor"],
|
|
81
|
+
settings: {
|
|
82
|
+
dimensionConsumer: !0,
|
|
83
|
+
multipleSelectors: !0,
|
|
84
|
+
axesAllowed: !0,
|
|
85
|
+
columnsAllowed: !0
|
|
86
|
+
},
|
|
87
|
+
dependsOn: ["x"],
|
|
88
|
+
checkSourceBySpec: (e, t) => {
|
|
89
|
+
const c = /* @__PURE__ */ new Set([
|
|
90
|
+
...t.components.x.selectorStates.map((n) => n.selectedSource),
|
|
91
|
+
...t.components.xGroupBy.selectorStates.map((n) => n.selectedSource)
|
|
92
|
+
]);
|
|
93
|
+
return "kind" in e && e.kind === "PColumn" ? T.fromAxesSpec(e.axesSpec).every(
|
|
94
|
+
(n) => c.has(n.toCanonicalString())
|
|
95
|
+
) : !0;
|
|
96
|
+
}
|
|
97
|
+
}),
|
|
98
|
+
y: new v({
|
|
75
99
|
componentName: "y",
|
|
76
100
|
allowedTypes: ["Int", "String", "Long"],
|
|
77
101
|
strictlyDependsOnParents: !0,
|
|
@@ -84,7 +108,29 @@ class oe extends M {
|
|
|
84
108
|
columnsAllowed: !1
|
|
85
109
|
}
|
|
86
110
|
}),
|
|
87
|
-
|
|
111
|
+
yGroupBy: new v({
|
|
112
|
+
componentName: "yGroupBy",
|
|
113
|
+
allowedTypes: ["Int", "String", "Long"],
|
|
114
|
+
strictlyDependsOnParents: !0,
|
|
115
|
+
parentComponents: ["valueSize", "valueColor"],
|
|
116
|
+
settings: {
|
|
117
|
+
dimensionConsumer: !0,
|
|
118
|
+
multipleSelectors: !0,
|
|
119
|
+
axesAllowed: !0,
|
|
120
|
+
columnsAllowed: !0
|
|
121
|
+
},
|
|
122
|
+
dependsOn: ["y"],
|
|
123
|
+
checkSourceBySpec: (e, t) => {
|
|
124
|
+
const c = /* @__PURE__ */ new Set([
|
|
125
|
+
...t.components.x.selectorStates.map((n) => n.selectedSource),
|
|
126
|
+
...t.components.xGroupBy.selectorStates.map((n) => n.selectedSource)
|
|
127
|
+
]);
|
|
128
|
+
return "kind" in e && e.kind === "PColumn" ? T.fromAxesSpec(e.axesSpec).every(
|
|
129
|
+
(n) => c.has(n.toCanonicalString())
|
|
130
|
+
) : !0;
|
|
131
|
+
}
|
|
132
|
+
}),
|
|
133
|
+
tooltipContent: new v({
|
|
88
134
|
componentName: "tooltipContent",
|
|
89
135
|
allowedTypes: ["String", "Int", "Long", "Float", "Double"],
|
|
90
136
|
strictlyDependsOnParents: !0,
|
|
@@ -95,7 +141,7 @@ class oe extends M {
|
|
|
95
141
|
multipleSelectors: !0
|
|
96
142
|
}
|
|
97
143
|
}),
|
|
98
|
-
facetBy: new
|
|
144
|
+
facetBy: new v({
|
|
99
145
|
componentName: "facetBy",
|
|
100
146
|
allowedTypes: ["String", "Int", "Long"],
|
|
101
147
|
strictlyDependsOnParents: !0,
|
|
@@ -107,7 +153,7 @@ class oe extends M {
|
|
|
107
153
|
}
|
|
108
154
|
})
|
|
109
155
|
}, {
|
|
110
|
-
filters: new
|
|
156
|
+
filters: new v({
|
|
111
157
|
componentName: "filters",
|
|
112
158
|
allowedTypes: ["String", "Int", "Long", "Double", "Long"],
|
|
113
159
|
strictlyDependsOnParents: !0,
|
|
@@ -119,7 +165,7 @@ class oe extends M {
|
|
|
119
165
|
multipleSelectors: !0
|
|
120
166
|
}
|
|
121
167
|
}),
|
|
122
|
-
tabBy: new
|
|
168
|
+
tabBy: new v({
|
|
123
169
|
componentName: "tabBy",
|
|
124
170
|
allowedTypes: ["String", "Int"],
|
|
125
171
|
strictlyDependsOnParents: !0,
|
|
@@ -135,130 +181,154 @@ class oe extends M {
|
|
|
135
181
|
getMustBeConsumedAxes(e, t) {
|
|
136
182
|
if (!e.components.valueColor.selectorStates.length)
|
|
137
183
|
return /* @__PURE__ */ new Set();
|
|
138
|
-
const
|
|
139
|
-
return !
|
|
184
|
+
const c = e.components.valueColor.selectorStates[0].selectedSource, n = t.get(c);
|
|
185
|
+
return !n || n.kind !== "column" ? /* @__PURE__ */ new Set() : new Set(n.spec.axesSpec.map((s) => T.fromAxisSpec(s).toCanonicalString()));
|
|
140
186
|
}
|
|
141
187
|
async createDataByColumns(e, t) {
|
|
142
|
-
var
|
|
143
|
-
const
|
|
144
|
-
if (!
|
|
188
|
+
var c, n;
|
|
189
|
+
const s = (c = t.components.valueColor.selectorStates[0]) == null ? void 0 : c.selectedSource, i = (n = t.components.valueSize.selectorStates[0]) == null ? void 0 : n.selectedSource;
|
|
190
|
+
if (!s || !i)
|
|
145
191
|
throw Error("Value column is not valid");
|
|
146
|
-
const
|
|
147
|
-
if (!
|
|
192
|
+
const S = w(s), d = w(i);
|
|
193
|
+
if (!S || !d || !p(S) && !p(d))
|
|
148
194
|
throw Error("Value column is not valid");
|
|
149
|
-
const
|
|
195
|
+
const r = {
|
|
150
196
|
type: "columns",
|
|
151
|
-
id:
|
|
197
|
+
id: M(t.components) ?? "",
|
|
152
198
|
values: {}
|
|
153
|
-
},
|
|
199
|
+
}, B = await J(e), A = await U(e), b = [
|
|
154
200
|
...t.components.filters.selectorStates,
|
|
155
201
|
...t.components.tabBy.selectorStates
|
|
156
|
-
],
|
|
202
|
+
], h = Z(b), O = b.map((a) => w(a.selectedSource)).filter(p), D = [S, d].filter(p), x = D.map((a) => a.toCanonicalString()), L = await H(e, x), G = [
|
|
157
203
|
t.components.facetBy,
|
|
158
204
|
t.components.x,
|
|
159
205
|
t.components.y,
|
|
206
|
+
t.components.xGroupBy,
|
|
207
|
+
t.components.yGroupBy,
|
|
160
208
|
t.components.tooltipContent
|
|
161
|
-
],
|
|
162
|
-
for (const { selectedSource:
|
|
163
|
-
|
|
209
|
+
], f = [], o = [];
|
|
210
|
+
for (const { selectedSource: a } of b)
|
|
211
|
+
o.push(...await N(
|
|
164
212
|
e,
|
|
213
|
+
B,
|
|
165
214
|
A,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
o
|
|
215
|
+
L,
|
|
216
|
+
a
|
|
169
217
|
));
|
|
170
|
-
for (const
|
|
171
|
-
for (const { selectedSource:
|
|
172
|
-
|
|
218
|
+
for (const a of G)
|
|
219
|
+
for (const { selectedSource: u } of a.selectorStates) {
|
|
220
|
+
f.push(w(u)), o.push(...await N(
|
|
173
221
|
e,
|
|
222
|
+
B,
|
|
174
223
|
A,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
s
|
|
224
|
+
L,
|
|
225
|
+
u
|
|
178
226
|
));
|
|
179
|
-
const
|
|
180
|
-
|
|
227
|
+
const k = await C(e, u, x);
|
|
228
|
+
k && f.push(k);
|
|
181
229
|
}
|
|
182
|
-
const
|
|
183
|
-
[...
|
|
184
|
-
|
|
185
|
-
|
|
230
|
+
const l = await e.pFrameProvider.getTableOuterJoin(
|
|
231
|
+
[...D, ...o, ...O],
|
|
232
|
+
f,
|
|
233
|
+
h,
|
|
186
234
|
!0
|
|
187
235
|
);
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
}),
|
|
192
|
-
const
|
|
193
|
-
async (
|
|
194
|
-
var
|
|
195
|
-
return ((
|
|
236
|
+
f.forEach((a) => {
|
|
237
|
+
const u = a.toCanonicalString();
|
|
238
|
+
r.values[u] = p(a) ? l.columnsData[u] : l.axesData[u];
|
|
239
|
+
}), r.values[s] = p(S) ? l.columnsData[s] : l.axesData[s], r.values[i] = p(d) ? l.columnsData[i] : l.axesData[i];
|
|
240
|
+
const y = t.components.x.selectorStates.concat(t.components.xGroupBy.selectorStates).map((a) => a.selectedSource), z = y.join(", "), F = await Promise.all(y.map(
|
|
241
|
+
async (a) => {
|
|
242
|
+
var u;
|
|
243
|
+
return ((u = await C(e, a, x)) == null ? void 0 : u.toCanonicalString()) ?? a;
|
|
196
244
|
}
|
|
197
245
|
));
|
|
198
|
-
|
|
199
|
-
const I = t.components.y.selectorStates.map((
|
|
200
|
-
async (
|
|
201
|
-
var
|
|
202
|
-
return ((
|
|
246
|
+
r.values[z] = P(l, y), r.values.xLabels = P(l, F);
|
|
247
|
+
const I = t.components.y.selectorStates.concat(t.components.yGroupBy.selectorStates).map((a) => a.selectedSource), E = I.join(", "), q = await Promise.all(I.map(
|
|
248
|
+
async (a) => {
|
|
249
|
+
var u;
|
|
250
|
+
return ((u = await C(e, a, x)) == null ? void 0 : u.toCanonicalString()) ?? a;
|
|
203
251
|
}
|
|
204
252
|
));
|
|
205
|
-
return
|
|
253
|
+
return r.values[E] = P(l, I), r.values.yLabels = P(l, q), { byColumns: r };
|
|
206
254
|
}
|
|
207
255
|
async createChartSettings(e, t) {
|
|
208
|
-
var
|
|
209
|
-
const
|
|
210
|
-
if (!
|
|
256
|
+
var c, n;
|
|
257
|
+
const s = (c = t.components.valueColor.selectorStates[0]) == null ? void 0 : c.selectedSource, i = (n = t.components.valueSize.selectorStates[0]) == null ? void 0 : n.selectedSource;
|
|
258
|
+
if (!s || !i)
|
|
211
259
|
throw Error("Value column is not valid");
|
|
212
|
-
const
|
|
213
|
-
if (!
|
|
260
|
+
const S = w(s), d = w(i);
|
|
261
|
+
if (!p(S) && !p(d))
|
|
214
262
|
throw Error("Value column is not valid");
|
|
215
|
-
const
|
|
263
|
+
const r = [S, d].filter(p).map((o) => o.toCanonicalString()), B = {
|
|
216
264
|
type: "column",
|
|
217
|
-
value:
|
|
218
|
-
label: await
|
|
219
|
-
},
|
|
265
|
+
value: s,
|
|
266
|
+
label: await g(e, s, [])
|
|
267
|
+
}, A = {
|
|
220
268
|
type: "column",
|
|
221
|
-
value:
|
|
222
|
-
label: await
|
|
223
|
-
},
|
|
224
|
-
|
|
269
|
+
value: i,
|
|
270
|
+
label: await g(e, i, [])
|
|
271
|
+
}, b = t.components.x.selectorStates.concat(t.components.xGroupBy.selectorStates).map(({ selectedSource: o }) => w(o)).map((o) => o.toCanonicalString()).join(", "), h = t.components.y.selectorStates.concat(t.components.yGroupBy.selectorStates).map(({ selectedSource: o }) => w(o)).map((o) => o.toCanonicalString()).join(", "), O = await Promise.all(
|
|
272
|
+
t.components.xGroupBy.selectorStates.map(async (o) => {
|
|
273
|
+
var l;
|
|
274
|
+
return {
|
|
275
|
+
type: "column",
|
|
276
|
+
label: await g(e, o.selectedSource, r),
|
|
277
|
+
value: o.selectedSource,
|
|
278
|
+
valueLabels: ((l = await C(e, o.selectedSource, r)) == null ? void 0 : l.toCanonicalString()) ?? o.selectedSource
|
|
279
|
+
};
|
|
280
|
+
})
|
|
281
|
+
), D = await Promise.all(
|
|
282
|
+
t.components.yGroupBy.selectorStates.map(async (o) => {
|
|
283
|
+
var l;
|
|
284
|
+
return {
|
|
285
|
+
type: "column",
|
|
286
|
+
label: await g(e, o.selectedSource, r),
|
|
287
|
+
value: o.selectedSource,
|
|
288
|
+
valueLabels: ((l = await C(e, o.selectedSource, r)) == null ? void 0 : l.toCanonicalString()) ?? o.selectedSource
|
|
289
|
+
};
|
|
290
|
+
})
|
|
291
|
+
), x = await Promise.all(t.components.facetBy.selectorStates.map(async (o) => {
|
|
292
|
+
var l;
|
|
225
293
|
return {
|
|
226
294
|
type: "column",
|
|
227
|
-
value: ((
|
|
295
|
+
value: ((l = await C(e, o.selectedSource, r)) == null ? void 0 : l.toCanonicalString()) ?? o.selectedSource
|
|
228
296
|
};
|
|
229
|
-
})), L = (await Promise.all(t.components.x.selectorStates.map((
|
|
230
|
-
t.components.tooltipContent.selectorStates.map(async (
|
|
231
|
-
var
|
|
232
|
-
const
|
|
297
|
+
})), L = (await Promise.all(t.components.x.selectorStates.map((o) => g(e, o.selectedSource, r)))).join(", "), G = (await Promise.all(t.components.y.selectorStates.map((o) => g(e, o.selectedSource, r)))).join(", "), f = await Promise.all(
|
|
298
|
+
t.components.tooltipContent.selectorStates.map(async (o) => {
|
|
299
|
+
var l;
|
|
300
|
+
const y = o.selectedSource, z = await K(e, y, r);
|
|
233
301
|
return {
|
|
234
302
|
type: "column",
|
|
235
|
-
label: await
|
|
236
|
-
value:
|
|
237
|
-
valueLabels: ((
|
|
238
|
-
format: X(
|
|
303
|
+
label: await g(e, y, r) || y,
|
|
304
|
+
value: y,
|
|
305
|
+
valueLabels: ((l = await C(e, y, r)) == null ? void 0 : l.toCanonicalString()) ?? y,
|
|
306
|
+
format: X(z)
|
|
239
307
|
};
|
|
240
308
|
})
|
|
241
309
|
);
|
|
242
310
|
return {
|
|
243
311
|
type: "bubble",
|
|
244
|
-
valueColor:
|
|
245
|
-
valueSize:
|
|
312
|
+
valueColor: B,
|
|
313
|
+
valueSize: A,
|
|
246
314
|
xColumn: {
|
|
247
315
|
type: "column",
|
|
248
|
-
value:
|
|
316
|
+
value: b,
|
|
249
317
|
label: L,
|
|
250
318
|
valueLabels: "xLabels"
|
|
251
319
|
},
|
|
252
320
|
yColumn: {
|
|
253
321
|
type: "column",
|
|
254
|
-
value:
|
|
255
|
-
label:
|
|
322
|
+
value: h,
|
|
323
|
+
label: G,
|
|
256
324
|
valueLabels: "yLabels"
|
|
257
325
|
},
|
|
258
|
-
facetBy:
|
|
326
|
+
facetBy: x,
|
|
327
|
+
xGroupBy: O,
|
|
328
|
+
yGroupBy: D,
|
|
259
329
|
tooltips: {
|
|
260
330
|
show: !0,
|
|
261
|
-
content:
|
|
331
|
+
content: f
|
|
262
332
|
}
|
|
263
333
|
};
|
|
264
334
|
}
|