@milaboratories/graph-maker 1.1.142 → 1.1.144
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/components/ReorderForm.vue.d.ts +15 -0
- package/dist/GraphMaker/components/ReorderForm.vue.d.ts.map +1 -0
- package/dist/GraphMaker/components/ReorderForm.vue.js +43 -0
- package/dist/GraphMaker/components/ReorderForm.vue.js.map +1 -0
- package/dist/GraphMaker/components/ReorderForm.vue2.js +5 -0
- package/dist/GraphMaker/components/ReorderForm.vue2.js.map +1 -0
- package/dist/GraphMaker/constantsCommon.d.ts +15 -0
- package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
- package/dist/GraphMaker/constantsCommon.js +11 -8
- package/dist/GraphMaker/constantsCommon.js.map +1 -1
- package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js.map +1 -1
- package/dist/GraphMaker/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.js +305 -172
- package/dist/GraphMaker/forms/AxesSettingsForm/ScatterplotAxesSettingsForm.vue.js.map +1 -1
- package/dist/GraphMaker/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/index.vue.js +33 -33
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +3 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +9 -9
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +5 -11
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +3 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +31 -5
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +56 -53
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +1 -7
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +13 -13
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.d.ts +6 -4
- package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.js +42 -13
- package/dist/GraphMaker/utils/createChartSettingsForRender/getAxesDataFromForms.js.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +48 -44
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/{discrete/components → common}/BandAxis.js +3 -3
- package/dist/node_modules/@milaboratories/miplots4/dist/common/BandAxis.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/common/ContinuousGrid.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +197 -270
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +9 -9
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/Chart.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/Grid.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +11 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-scale/src/band.js +44 -34
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-scale/src/band.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js +272 -195
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +23 -23
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js +54 -50
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxis.js +32 -28
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxis.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js +29 -26
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js +44 -41
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Grid.js +31 -27
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Grid.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +29 -18
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +71 -57
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/isNumericScale.js +11 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/isNumericScale.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js +10 -10
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js +6 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js +35 -25
- package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js +3 -3
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +37 -37
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +6 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +7 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/createMultilineDiscreteLabels.js +32 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/createMultilineDiscreteLabels.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/getFacetRowsColumns.js +18 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/getFacetRowsColumns.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/measureMultilineDiscreteLabels.js +63 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/measureMultilineDiscreteLabels.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/{discrete/utils → utils}/splitTextByWidth.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/splitTextByWidth.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +39 -32
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +68 -62
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +5 -5
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +8 -8
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +3 -3
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +8 -8
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +12 -9
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/{index.js → error_like_shape.js} +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js +8 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_types.js +63 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_types.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js +152 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +189 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/errors.js +18 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/errors.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/json.js +12 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/json.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/plid.js +7 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/plid.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/ref.js +8 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/ref.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/components/PlDataTable.js +13 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/components/PlDataTable.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js +89 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +50 -45
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +54 -50
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
- package/package.json +4 -4
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/BandAxis.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Axis.js +0 -59
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Axis.js.map +0 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/index.js.map +0 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +0 -979
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +0 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js +0 -1599
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js.map +0 -1
|
@@ -9,13 +9,13 @@ const i = o.enum(["discrete", "continuous"]), a = o.object({
|
|
|
9
9
|
axis: o.literal("x"),
|
|
10
10
|
position: o.optional(o.enum(["top", "bottom"])),
|
|
11
11
|
titlePosition: o.optional(o.enum(["left", "right"]))
|
|
12
|
-
}),
|
|
12
|
+
}), c = a.extend({
|
|
13
13
|
axis: o.literal("y"),
|
|
14
14
|
position: o.optional(o.enum(["left", "right"])),
|
|
15
15
|
titlePosition: o.optional(o.enum(["top", "bottom"]))
|
|
16
|
-
}),
|
|
16
|
+
}), b = o.enum(["euclidean", "squaredEuclidean"]), g = o.enum(["average", "complete", "single"]), e = o.object({
|
|
17
17
|
size: o.optional(o.number()),
|
|
18
|
-
distance: o.optional(
|
|
18
|
+
distance: o.optional(b),
|
|
19
19
|
linkage: o.optional(g),
|
|
20
20
|
showNodes: o.optional(o.boolean()),
|
|
21
21
|
edgeInheritance: o.optional(o.enum(["up", "down"])),
|
|
@@ -41,7 +41,7 @@ const i = o.enum(["discrete", "continuous"]), a = o.object({
|
|
|
41
41
|
showGroupLabels: o.optional(o.boolean()),
|
|
42
42
|
axisLabelsAngle: o.optional(o.union([o.literal(0), o.literal(45), o.literal(90)])),
|
|
43
43
|
groupLabelsAngle: o.optional(o.union([o.literal(0), o.literal(45), o.literal(90)]))
|
|
44
|
-
},
|
|
44
|
+
}, x = o.object({
|
|
45
45
|
type: o.literal("heatmap"),
|
|
46
46
|
title: o.object({
|
|
47
47
|
name: o.string(),
|
|
@@ -97,7 +97,7 @@ const i = o.enum(["discrete", "continuous"]), a = o.object({
|
|
|
97
97
|
method: o.enum(["standardScaling", "meanNormalization"]),
|
|
98
98
|
colorRange: o.optional(o.array(o.number()))
|
|
99
99
|
})),
|
|
100
|
-
annotations: o.optional(o.array(o.union([m,
|
|
100
|
+
annotations: o.optional(o.array(o.union([m, c]))),
|
|
101
101
|
dendrogramX: o.optional(d),
|
|
102
102
|
dendrogramY: o.optional(h),
|
|
103
103
|
inheritedDendrogramAes: o.optional(o.record(o.string(), r)),
|
|
@@ -114,6 +114,6 @@ const i = o.enum(["discrete", "continuous"]), a = o.object({
|
|
|
114
114
|
}))
|
|
115
115
|
});
|
|
116
116
|
export {
|
|
117
|
-
|
|
117
|
+
x as HeatmapSettingsSchema
|
|
118
118
|
};
|
|
119
119
|
//# sourceMappingURL=heatmap.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import o from "../node_modules/zod/lib/index.js";
|
|
2
|
-
import { continuousAesMappingFromValueSchema as a, PointShapeSchema as
|
|
2
|
+
import { continuousAesMappingFromValueSchema as a, PointShapeSchema as i, LineShapeSchema as l, ColumnNameSchema as t, AesRecordSchema as p, DataValueSchema as r, AxisSettingsContinuousSchema as n, FrameTypeSchema as s, LegendPositionSchema as m, TitlePositionSchema as c } from "./common.js";
|
|
3
3
|
const e = o.object({
|
|
4
4
|
type: o.literal("grouping"),
|
|
5
5
|
value: o.string(),
|
|
@@ -13,11 +13,11 @@ const e = o.object({
|
|
|
13
13
|
dotFill: o.optional(
|
|
14
14
|
o.union([o.string(), e, a(o.string())])
|
|
15
15
|
),
|
|
16
|
-
dotShape: o.optional(o.union([
|
|
16
|
+
dotShape: o.optional(o.union([i, e])),
|
|
17
17
|
dotSize: o.optional(o.union([o.number(), a(o.number())]))
|
|
18
18
|
})
|
|
19
19
|
)
|
|
20
|
-
}),
|
|
20
|
+
}), u = o.object({
|
|
21
21
|
type: o.literal("curve"),
|
|
22
22
|
smoothing: o.optional(o.boolean()),
|
|
23
23
|
aes: o.optional(
|
|
@@ -28,7 +28,7 @@ const e = o.object({
|
|
|
28
28
|
opacity: o.optional(o.number())
|
|
29
29
|
})
|
|
30
30
|
)
|
|
31
|
-
}),
|
|
31
|
+
}), b = o.union([h, u]), y = o.object({
|
|
32
32
|
type: o.literal("scatterplot-umap"),
|
|
33
33
|
title: o.object({
|
|
34
34
|
name: o.string(),
|
|
@@ -57,8 +57,8 @@ const e = o.object({
|
|
|
57
57
|
keyColumn: o.optional(t),
|
|
58
58
|
x: t,
|
|
59
59
|
y: t,
|
|
60
|
-
xAxis: o.optional(
|
|
61
|
-
yAxis: o.optional(
|
|
60
|
+
xAxis: o.optional(n),
|
|
61
|
+
yAxis: o.optional(n),
|
|
62
62
|
grouping: o.optional(o.array(
|
|
63
63
|
o.object({
|
|
64
64
|
columnName: t,
|
|
@@ -69,7 +69,7 @@ const e = o.object({
|
|
|
69
69
|
)),
|
|
70
70
|
label: o.optional(t),
|
|
71
71
|
highlight: o.optional(t),
|
|
72
|
-
layers: o.array(
|
|
72
|
+
layers: o.array(b)
|
|
73
73
|
});
|
|
74
74
|
export {
|
|
75
75
|
y as ScatterplotUmapSettingsSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scatterplot-umap.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/types/scatterplot-umap.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { categoricalAesMappingFromValueSchema } from './common';\nimport {\n AesRecordSchema, AxisSettingsSchema,\n ColumnNameSchema, continuousAesMappingFromValueSchema, DataValueSchema, FrameTypeSchema,\n LegendPositionSchema, LineShapeSchema, PointShapeSchema,\n TitlePositionSchema,\n} from './common';\nimport type { ScatterplotLegendInfo } from './scatterplot';\n\ntype catAesFromColumn<ValueType extends z.ZodType> = ReturnType<typeof categoricalAesMappingFromValueSchema<ValueType>>;\ntype contAesFromColumn<ValueType extends z.ZodType> = ReturnType<typeof continuousAesMappingFromValueSchema<ValueType>>;\n\nexport type CategoricalAesFromColumn<ValueType> = z.infer<catAesFromColumn<z.ZodType<ValueType>>>;\nexport type ContinuousAesFromColumn<ValueType> = z.infer<contAesFromColumn<z.ZodType<ValueType>>>;\n\nconst InheritAesSchema = z.object({\n type: z.literal('grouping'),\n value: z.string(), // link to aes mapped to column\n palette: z.optional(z.array(z.string())) // if defined we use palette to create mapping without inheritedAes field\n});\nexport type InheritAesScatterplot = z.infer<typeof InheritAesSchema>;\n\nconst DotsUmapLayerSchema = z.object({\n type: z.literal('dots'),\n aes: z.optional(\n z.object({\n dotFill: z.optional(\n z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])\n ),\n dotShape: z.optional(z.union([PointShapeSchema, InheritAesSchema])),\n dotSize: z.optional(z.union([z.number(), continuousAesMappingFromValueSchema(z.number())])),\n })\n ),\n});\n\nconst CurveUmapLayerSchema = z.object({\n type: z.literal('curve'),\n smoothing: z.optional(z.boolean()),\n aes: z.optional(\n z.object({\n lineWidth: z.optional(z.number()),\n lineShape: z.optional(LineShapeSchema),\n lineColor: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n opacity: z.optional(z.number()),\n })\n ),\n});\n\nconst ScatterplotUmapLayerSchema = z.union([DotsUmapLayerSchema, CurveUmapLayerSchema]);\n\nexport type DotsUmapLayer = z.infer<typeof DotsUmapLayerSchema>;\nexport type CurveUmapLayer = z.infer<typeof CurveUmapLayerSchema>;\nexport type ScatterplotUmapLayer = z.infer<typeof ScatterplotUmapLayerSchema>;\n\nexport const ScatterplotUmapSettingsSchema = z.object({\n type: z.literal('scatterplot-umap'),\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 })\n ),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n tooltips: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n content: z.optional(z.array(ColumnNameSchema)),\n })\n ),\n frame: z.optional(z.object({type: z.optional(FrameTypeSchema)})),\n keyColumn: z.optional(ColumnNameSchema),\n x: ColumnNameSchema,\n y: ColumnNameSchema,\n xAxis: z.optional(
|
|
1
|
+
{"version":3,"file":"scatterplot-umap.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/types/scatterplot-umap.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { categoricalAesMappingFromValueSchema } from './common';\nimport {\n AesRecordSchema, AxisSettingsContinuousSchema, AxisSettingsSchema,\n ColumnNameSchema, continuousAesMappingFromValueSchema, DataValueSchema, FrameTypeSchema,\n LegendPositionSchema, LineShapeSchema, PointShapeSchema,\n TitlePositionSchema,\n} from './common';\nimport type { ScatterplotLegendInfo } from './scatterplot';\n\ntype catAesFromColumn<ValueType extends z.ZodType> = ReturnType<typeof categoricalAesMappingFromValueSchema<ValueType>>;\ntype contAesFromColumn<ValueType extends z.ZodType> = ReturnType<typeof continuousAesMappingFromValueSchema<ValueType>>;\n\nexport type CategoricalAesFromColumn<ValueType> = z.infer<catAesFromColumn<z.ZodType<ValueType>>>;\nexport type ContinuousAesFromColumn<ValueType> = z.infer<contAesFromColumn<z.ZodType<ValueType>>>;\n\nconst InheritAesSchema = z.object({\n type: z.literal('grouping'),\n value: z.string(), // link to aes mapped to column\n palette: z.optional(z.array(z.string())) // if defined we use palette to create mapping without inheritedAes field\n});\nexport type InheritAesScatterplot = z.infer<typeof InheritAesSchema>;\n\nconst DotsUmapLayerSchema = z.object({\n type: z.literal('dots'),\n aes: z.optional(\n z.object({\n dotFill: z.optional(\n z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])\n ),\n dotShape: z.optional(z.union([PointShapeSchema, InheritAesSchema])),\n dotSize: z.optional(z.union([z.number(), continuousAesMappingFromValueSchema(z.number())])),\n })\n ),\n});\n\nconst CurveUmapLayerSchema = z.object({\n type: z.literal('curve'),\n smoothing: z.optional(z.boolean()),\n aes: z.optional(\n z.object({\n lineWidth: z.optional(z.number()),\n lineShape: z.optional(LineShapeSchema),\n lineColor: z.optional(z.union([z.string(), InheritAesSchema, continuousAesMappingFromValueSchema(z.string())])),\n opacity: z.optional(z.number()),\n })\n ),\n});\n\nconst ScatterplotUmapLayerSchema = z.union([DotsUmapLayerSchema, CurveUmapLayerSchema]);\n\nexport type DotsUmapLayer = z.infer<typeof DotsUmapLayerSchema>;\nexport type CurveUmapLayer = z.infer<typeof CurveUmapLayerSchema>;\nexport type ScatterplotUmapLayer = z.infer<typeof ScatterplotUmapLayerSchema>;\n\nexport const ScatterplotUmapSettingsSchema = z.object({\n type: z.literal('scatterplot-umap'),\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 })\n ),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n tooltips: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n content: z.optional(z.array(ColumnNameSchema)),\n })\n ),\n frame: z.optional(z.object({type: z.optional(FrameTypeSchema)})),\n keyColumn: z.optional(ColumnNameSchema),\n x: ColumnNameSchema,\n y: ColumnNameSchema,\n xAxis: z.optional(AxisSettingsContinuousSchema),\n yAxis: z.optional(AxisSettingsContinuousSchema),\n grouping: z.optional(z.array(\n z.object({\n columnName: ColumnNameSchema,\n order: z.optional(z.array(DataValueSchema)),\n inheritedAes: z.optional(AesRecordSchema),\n allowNullGroup: z.optional(z.boolean())\n })\n )),\n label: z.optional(ColumnNameSchema),\n highlight: z.optional(ColumnNameSchema),\n layers: z.array(ScatterplotUmapLayerSchema)\n});\n\nexport type ScatterplotUmapSettings = z.infer<typeof ScatterplotUmapSettingsSchema>;\n\nexport type ScatterplotUmapLegendInfo = ScatterplotLegendInfo;\n"],"names":["InheritAesSchema","z","DotsUmapLayerSchema","continuousAesMappingFromValueSchema","PointShapeSchema","CurveUmapLayerSchema","LineShapeSchema","ScatterplotUmapLayerSchema","ScatterplotUmapSettingsSchema","TitlePositionSchema","LegendPositionSchema","ColumnNameSchema","FrameTypeSchema","AxisSettingsContinuousSchema","DataValueSchema","AesRecordSchema"],"mappings":";;AAgBA,MAAMA,IAAmBC,EAAE,OAAO;AAAA,EAC9B,MAAMA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,CAAgB;AAAA,EAClC,WAAWV,EAAE,SAASU,CAAgB;AAAA,EACtC,QAAQV,EAAE,MAAMM,CAA0B;AAC9C,CAAC;","x_google_ignoreList":[0]}
|
package/dist/node_modules/@milaboratories/miplots4/dist/utils/createMultilineDiscreteLabels.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CAPTION_LINE_HEIGHT as d } from "../discrete/constants.js";
|
|
2
|
+
import { splitTextByWidth as N } from "./splitTextByWidth.js";
|
|
3
|
+
const P = Math.sin(Math.PI / 4);
|
|
4
|
+
function x(f, i, l, h, m, p) {
|
|
5
|
+
const g = {
|
|
6
|
+
center: 120,
|
|
7
|
+
"45deg": 256,
|
|
8
|
+
"90deg": 320
|
|
9
|
+
}, M = m === "vertical";
|
|
10
|
+
function I(t, e) {
|
|
11
|
+
return t === "center" ? 1 / 0 : Math.floor(t === "45deg" ? e * P / d : e / d);
|
|
12
|
+
}
|
|
13
|
+
return f.reduce((t, e) => {
|
|
14
|
+
const s = p[e], c = s.step(), a = g[i], E = i === "center" ? Math.min(a, c) : a;
|
|
15
|
+
return t[e] = s.domain().reduce((r, n) => {
|
|
16
|
+
if (h)
|
|
17
|
+
return r[n] = [], r;
|
|
18
|
+
const o = l[n];
|
|
19
|
+
if (!M)
|
|
20
|
+
r[n] = [o];
|
|
21
|
+
else {
|
|
22
|
+
const L = I(i, c), u = N(o, E, 14);
|
|
23
|
+
r[n] = u.length > L ? [o] : u;
|
|
24
|
+
}
|
|
25
|
+
return r;
|
|
26
|
+
}, {}), t;
|
|
27
|
+
}, {});
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
x as createMultilineDiscreteLabels
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=createMultilineDiscreteLabels.js.map
|
package/dist/node_modules/@milaboratories/miplots4/dist/utils/createMultilineDiscreteLabels.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createMultilineDiscreteLabels.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/utils/createMultilineDiscreteLabels.ts"],"sourcesContent":["import type { ScaleBand, ScalePoint } from 'd3-scale';\nimport type { DiscreteLabelsPosition, Orientation } from '../types';\nimport { CAPTION_LINE_HEIGHT } from '../discrete/constants';\nimport { splitTextByWidth } from './splitTextByWidth';\n\nconst SIN_PI_4 = Math.sin(Math.PI / 4);\n\nexport function createMultilineDiscreteLabels(\n facetKeys: string[],\n labelsPosition: DiscreteLabelsPosition,\n labelsMap: Record<string, string>,\n hiddenLabels: boolean,\n orientation: Orientation,\n scalesByFacet: Record<string, ScaleBand<string> | ScalePoint<string | number>>\n) {\n const DEFAULT_MAX_WIDTH = {\n 'center': 120,\n '45deg': 256,\n '90deg': 320,\n };\n const isVertical = orientation === 'vertical';\n\n function getMaxLinesCount(labelsPosition: 'center' | '45deg' | '90deg', bandwidth: number) {\n if (labelsPosition === 'center') {\n return Infinity;\n }\n if (labelsPosition === '45deg') {\n return Math.floor((bandwidth * SIN_PI_4) / CAPTION_LINE_HEIGHT);\n }\n return Math.floor(bandwidth / CAPTION_LINE_HEIGHT);\n }\n\n return facetKeys.reduce((res: Record<string, Record<string, string[]>>, facetKey) => {\n const scale = scalesByFacet[facetKey];\n const bandwidth = scale.step();\n const defaultWidth = DEFAULT_MAX_WIDTH[labelsPosition];\n const width = labelsPosition === 'center' ? Math.min(defaultWidth, bandwidth) : defaultWidth;\n res[facetKey] = scale.domain().reduce((res2: Record<string, string[]>, axisKey) => {\n if (hiddenLabels) {\n res2[axisKey] = [];\n return res2;\n }\n const label = labelsMap[axisKey];\n if (!isVertical) {\n res2[axisKey] = [label];\n } else {\n const maxLinesCount = getMaxLinesCount(labelsPosition, bandwidth);\n const multilineKey = splitTextByWidth(label, width, 14);\n res2[axisKey] = multilineKey.length > maxLinesCount ? [label] : multilineKey;\n }\n return res2;\n }, {});\n return res;\n }, {});\n}"],"names":["SIN_PI_4","createMultilineDiscreteLabels","facetKeys","labelsPosition","labelsMap","hiddenLabels","orientation","scalesByFacet","DEFAULT_MAX_WIDTH","isVertical","getMaxLinesCount","bandwidth","CAPTION_LINE_HEIGHT","res","facetKey","scale","defaultWidth","width","res2","axisKey","label","maxLinesCount","multilineKey","splitTextByWidth"],"mappings":";;AAKA,MAAMA,IAAW,KAAK,IAAI,KAAK,KAAK,CAAC;AAE9B,SAASC,EACZC,GACAC,GACAC,GACAC,GACAC,GACAC,GACF;AACG,QAAMC,IAAoB;AAAA,IACvB,QAAU;AAAA,IACV,SAAS;AAAA,IACT,SAAS;AAAA,EAAA,GAEPC,IAAaH,MAAgB;AAEnC,WAASI,EAAiBP,GAA8CQ,GAAmB;AACvF,WAAIR,MAAmB,WACZ,QAGA,KAAK,MADZA,MAAmB,UACAQ,IAAYX,IAAYY,IAE7BD,IAAYC,CAFoC;AAAA,EAGtE;AAEA,SAAOV,EAAU,OAAO,CAACW,GAA+CC,MAAa;AACjF,UAAMC,IAAQR,EAAcO,CAAQ,GAC9BH,IAAYI,EAAM,QAClBC,IAAeR,EAAkBL,CAAc,GAC/Cc,IAAQd,MAAmB,WAAW,KAAK,IAAIa,GAAcL,CAAS,IAAIK;AAChF,WAAAH,EAAIC,CAAQ,IAAIC,EAAM,SAAS,OAAO,CAACG,GAAgCC,MAAY;AAC/E,UAAId;AACA,eAAAa,EAAKC,CAAO,IAAI,CAAA,GACTD;AAEX,YAAME,IAAQhB,EAAUe,CAAO;AAC/B,UAAI,CAACV;AACDS,QAAAA,EAAKC,CAAO,IAAI,CAACC,CAAK;AAAA,WACnB;AACH,cAAMC,IAAgBX,EAAiBP,GAAgBQ,CAAS,GAC1DW,IAAeC,EAAiBH,GAAOH,GAAO,EAAE;AACtDC,QAAAA,EAAKC,CAAO,IAAIG,EAAa,SAASD,IAAgB,CAACD,CAAK,IAAIE;AAAAA,MACpE;AACA,aAAOJ;AAAAA,IACX,GAAG,CAAA,CAAE,GACEL;AAAAA,EACX,GAAG,CAAA,CAAE;AACT;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function e(o, s, n) {
|
|
2
|
+
const r = new Array(n).fill(null).map(() => []);
|
|
3
|
+
for (let t = 0; t < n; t++)
|
|
4
|
+
for (let l = 0; l < s; l++)
|
|
5
|
+
l * n + t < o.length && r[t].push(o[l * n + t]);
|
|
6
|
+
return r;
|
|
7
|
+
}
|
|
8
|
+
function u(o, s, n) {
|
|
9
|
+
const r = [];
|
|
10
|
+
for (let t = 0; t < s; t++)
|
|
11
|
+
r.push(o.slice(t * n, t * n + n));
|
|
12
|
+
return r;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
e as getFacetColumns,
|
|
16
|
+
u as getFacetRows
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=getFacetRowsColumns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFacetRowsColumns.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/utils/getFacetRowsColumns.ts"],"sourcesContent":["\n// facet keys grouped by columns\nexport function getFacetColumns(facetKeys: string[], nRows: number, nColumns: number): string[][] {\n const result: string[][] = new Array(nColumns).fill(null).map(() => []);\n for (let i = 0; i < nColumns; i++) {\n for (let j = 0; j < nRows; j++) {\n const facetIdx = j * nColumns + i;\n if (facetIdx < facetKeys.length) {\n result[i].push(facetKeys[j * nColumns + i]);\n }\n }\n }\n return result;\n}\n\n// facet keys grouped by rows\nexport function getFacetRows(facetKeys: string[], nRows: number, nColumns: number): string[][] {\n const result: string[][] = [];\n for (let i = 0; i < nRows; i++) {\n result.push(facetKeys.slice(i * nColumns, i * nColumns + nColumns));\n }\n return result;\n}"],"names":["getFacetColumns","facetKeys","nRows","nColumns","result","i","j","getFacetRows"],"mappings":"AAEO,SAASA,EAAgBC,GAAqBC,GAAeC,GAA8B;AAC9F,QAAMC,IAAqB,IAAI,MAAMD,CAAQ,EAAE,KAAK,IAAI,EAAE,IAAI,MAAM,EAAE;AACtE,WAASE,IAAI,GAAGA,IAAIF,GAAUE;AAC1B,aAASC,IAAI,GAAGA,IAAIJ,GAAOI;AACNA,MAAAA,IAAIH,IAAWE,IACjBJ,EAAU,UACrBG,EAAOC,CAAC,EAAE,KAAKJ,EAAUK,IAAIH,IAAWE,CAAC,CAAC;AAItD,SAAOD;AACX;AAGO,SAASG,EAAaN,GAAqBC,GAAeC,GAA8B;AAC3F,QAAMC,IAAqB,CAAA;AAC3B,WAASC,IAAI,GAAGA,IAAIH,GAAOG;AACvBD,MAAO,KAAKH,EAAU,MAAMI,IAAIF,GAAUE,IAAIF,IAAWA,CAAQ,CAAC;AAEtE,SAAOC;AACX;","x_google_ignoreList":[0]}
|
package/dist/node_modules/@milaboratories/miplots4/dist/utils/measureMultilineDiscreteLabels.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { CAPTION_LINE_HEIGHT as D } from "../discrete/constants.js";
|
|
2
|
+
import { TextMeasurer as F } from "./TextMeasurer/TextMeasurer.js";
|
|
3
|
+
import { getFacetRows as H, getFacetColumns as L } from "./getFacetRowsColumns.js";
|
|
4
|
+
const W = Math.sin(Math.PI / 4);
|
|
5
|
+
function G(l, M, d, o, i, y, s) {
|
|
6
|
+
const E = new F("600 14px Manrope"), _ = y === "vertical";
|
|
7
|
+
function f(a) {
|
|
8
|
+
return a.length ? Math.max(...a.map((t) => E.getTextWidth(t))) : 0;
|
|
9
|
+
}
|
|
10
|
+
function g(a) {
|
|
11
|
+
return a.length ? Math.max(...a.map(f)) : 0;
|
|
12
|
+
}
|
|
13
|
+
let u = [], h = [], T = 0, C = 0;
|
|
14
|
+
const p = H(l, M, d), x = L(l, M, d);
|
|
15
|
+
function b(a) {
|
|
16
|
+
return a.map(
|
|
17
|
+
(t) => Math.max(
|
|
18
|
+
...t.map(
|
|
19
|
+
(n) => Math.max(
|
|
20
|
+
...s[n].domain().map(
|
|
21
|
+
(e) => e ? i[n][e].length * D : 0
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function I(a) {
|
|
29
|
+
return a.map((t) => Math.max(
|
|
30
|
+
...t.map((n) => {
|
|
31
|
+
const e = s[n].domain().map((m) => i[n][m]), r = g(e);
|
|
32
|
+
return r > 0 ? r * W + 14 : 0;
|
|
33
|
+
})
|
|
34
|
+
));
|
|
35
|
+
}
|
|
36
|
+
function w(a) {
|
|
37
|
+
return a.map(
|
|
38
|
+
(t) => Math.max(
|
|
39
|
+
...t.map(
|
|
40
|
+
(n) => g(
|
|
41
|
+
s[n].domain().map((e) => i[n][e])
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function N(a, t = !0) {
|
|
48
|
+
const n = t ? a[0] : a[a.length - 1];
|
|
49
|
+
return Math.max(
|
|
50
|
+
...n.map((e) => {
|
|
51
|
+
const r = s[e], m = r.domain(), A = (c) => r(m[t ? c : m.length - c - 1]) + r.bandwidth() / 2;
|
|
52
|
+
return Math.max(
|
|
53
|
+
...m.map((c, B) => f(i[e][c]) * W - A(B) + 14)
|
|
54
|
+
);
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return _ ? (o === "center" && (u = b(p)), o === "45deg" && (u = I(p), T = N(p, !0)), o === "90deg" && (u = w(p))) : o === "45deg" ? (h = I(x), C = N(x, !1)) : h = w(x), { axisCaptionsWidthByRows: u, axisCaptionsWidthByColumns: h, xTail: T, yTail: C };
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
G as measureMultilineDiscreteLabels
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=measureMultilineDiscreteLabels.js.map
|
package/dist/node_modules/@milaboratories/miplots4/dist/utils/measureMultilineDiscreteLabels.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measureMultilineDiscreteLabels.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/utils/measureMultilineDiscreteLabels.ts"],"sourcesContent":["import type { ScaleBand, ScalePoint } from 'd3-scale';\nimport { CAPTION_LINE_HEIGHT } from '../discrete/constants';\nimport type { DiscreteLabelsPosition, Orientation } from '../types';\nimport { TextMeasurer } from './TextMeasurer/TextMeasurer';\nimport { getFacetColumns, getFacetRows } from './getFacetRowsColumns';\nimport { ZodNumber } from 'zod';\n\nconst SIN_45 = Math.sin(Math.PI / 4);\n\nexport function measureMultilineDiscreteLabels (\n facetKeys: string[],\n rowsCount: number,\n columnsCount: number,\n labelsPosition: DiscreteLabelsPosition,\n axisLabels: Record<string, Record<string, string[]>>,\n orientation: Orientation,\n scalesByFacet: Record<string, ScaleBand<string> | ScalePoint<string | number>>\n ) {\n const LABEL_FONT_SIZE = 14;\n const textMeasurer = new TextMeasurer(`600 ${LABEL_FONT_SIZE}px Manrope`);\n const isVertical = orientation === 'vertical';\n\n function getMaxStrWidth(strs: string[]) {\n if (!strs.length) {\n return 0;\n }\n return Math.max(...strs.map(str => textMeasurer.getTextWidth(str)));\n }\n\n function getMultilineMaxStrWidth(strs: string[][]) {\n if (!strs.length) {\n return 0;\n }\n return Math.max(...strs.map(getMaxStrWidth));\n }\n\n // x ticks are always strings and can have variable width in different facets, and can be rotated;\n // for x we consider the widest tick caption in row (column for horizontal orientation);\n // y ticks are always numbers, and we consider only the widest number of all facets\n // because numbers sizes are closer to each other, and it makes more equal facets grid without superwide empty offsets\n let axisCaptionsWidthByRows: number[] = [];\n let axisCaptionsWidthByColumns: number[] = [];\n let xTail = 0;\n let yTail = 0;\n\n const facetRows = getFacetRows(facetKeys, rowsCount, columnsCount);\n const facetColumns = getFacetColumns(facetKeys, rowsCount, columnsCount);\n\n function getSizeWithPositionCenter(columnOrRowKeys:string[][]) {\n return columnOrRowKeys.map(keys =>\n Math.max(\n ...keys.map(facetKey =>\n Math.max(\n ...scalesByFacet[facetKey]\n .domain()\n // do not consider empty ticks captions, for example - single group\n .map(axisKey =>\n axisKey ? axisLabels[facetKey][axisKey].length * CAPTION_LINE_HEIGHT : 0\n )\n )\n )\n )\n );\n }\n function getSizeWithPosition45deg(columnOrRowKeys:string[][]) {\n return columnOrRowKeys.map(keys => {\n return Math.max(\n ...keys.map(key => {\n const labels = scalesByFacet[key]\n .domain()\n .map(axisKey => axisLabels[key][axisKey]);\n const ticksWidth = getMultilineMaxStrWidth(labels);\n return ticksWidth > 0 ? ticksWidth * SIN_45 + LABEL_FONT_SIZE : 0;\n })\n );\n });\n }\n function getSizeWithPosition90deg(columnOrRowKeys:string[][]) {\n return columnOrRowKeys\n // max of ticks width in every facet's column\n .map(keys =>\n Math.max(\n ...keys.map(facetKey =>\n getMultilineMaxStrWidth(\n scalesByFacet[facetKey]\n .domain()\n .map(axisKey => axisLabels[facetKey][axisKey])\n )\n )\n )\n );\n }\n function getTail(columnOrRowKeys:string[][], first = true) {\n const keys = first ? columnOrRowKeys[0] : columnOrRowKeys[columnOrRowKeys.length - 1];\n return Math.max(\n ...keys.map(facetKey => {\n const scale = scalesByFacet[facetKey];\n const ticks = scale.domain();\n const pos = (idx:number) => (scale(ticks[first ? idx : ticks.length - idx - 1] as string) as number) + scale.bandwidth() / 2;\n return Math.max(\n ...ticks.map((tick, idx) => getMaxStrWidth(axisLabels[facetKey][tick]) * SIN_45 - pos(idx) + LABEL_FONT_SIZE)\n );\n })\n );\n }\n if (!isVertical) {\n if (labelsPosition === '45deg') {\n axisCaptionsWidthByColumns = getSizeWithPosition45deg(facetColumns);\n yTail = getTail(facetColumns, false);\n } else {\n // with horizontal chart orientation X ticks are always in horizontal position\n axisCaptionsWidthByColumns = getSizeWithPosition90deg(facetColumns);\n }\n } else {\n if (labelsPosition === 'center') {\n axisCaptionsWidthByRows = getSizeWithPositionCenter(facetRows);\n }\n if (labelsPosition === '45deg') {\n axisCaptionsWidthByRows = getSizeWithPosition45deg(facetRows);\n xTail = getTail(facetRows, true);\n }\n if (labelsPosition === '90deg') {\n axisCaptionsWidthByRows = getSizeWithPosition90deg(facetRows);\n }\n }\n\n return {axisCaptionsWidthByRows, axisCaptionsWidthByColumns, xTail, yTail};\n }"],"names":["SIN_45","measureMultilineDiscreteLabels","facetKeys","rowsCount","columnsCount","labelsPosition","axisLabels","orientation","scalesByFacet","textMeasurer","TextMeasurer","isVertical","getMaxStrWidth","strs","n","str","getMultilineMaxStrWidth","axisCaptionsWidthByRows","axisCaptionsWidthByColumns","xTail","yTail","facetRows","getFacetRows","facetColumns","getFacetColumns","getSizeWithPositionCenter","columnOrRowKeys","keys","facetKey","axisKey","CAPTION_LINE_HEIGHT","getSizeWithPosition45deg","key","labels","ticksWidth","getSizeWithPosition90deg","getTail","first","scale","ticks","pos","idx","tick"],"mappings":";;;AAOA,MAAMA,IAAS,KAAK,IAAI,KAAK,KAAK,CAAC;AAE5B,SAASC,EACRC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACF;AAEE,QAAMC,IAAe,IAAIC,EAAa,kBAAkC,GAClEC,IAAaJ,MAAgB;AAEnC,WAASK,EAAeC,GAAgB;AACpC,WAAKA,EAAK,SAGH,KAAK,IAAI,GAAGA,EAAK,IAAI,CAAAC,MAAOL,EAAa,aAAaM,CAAG,CAAC,CAAC,IAFvD;AAAA,EAGf;AAEA,WAASC,EAAwBH,GAAkB;AAC/C,WAAKA,EAAK,SAGH,KAAK,IAAI,GAAGA,EAAK,IAAID,CAAc,CAAC,IAFhC;AAAA,EAGf;AAMA,MAAIK,IAAoC,CAAA,GACpCC,IAAuC,CAAA,GACvCC,IAAQ,GACRC,IAAQ;AAEZ,QAAMC,IAAYC,EAAapB,GAAWC,GAAWC,CAAY,GAC3DmB,IAAeC,EAAgBtB,GAAWC,GAAWC,CAAY;AAEvE,WAASqB,EAA0BC,GAA4B;AAC3D,WAAOA,EAAgB;AAAA,MAAI,OACnB,KAAK;AAAA,QACD,GAAGC,EAAK;AAAA,UAAI,OACR,KAAK;AAAA,YACD,GAAGnB,EAAcoB,CAAQ,EACpB,OAAA,EAEA;AAAA,c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AAI,CAAC,IAAI1C,IAASwC,EAAIC,CAAG,IAAI,EAAe;AAAA,QAAA;AAAA,MAEpH,CAAC;AAAA,IAAA;AAAA,EAEb;AACA,SAAK9B,KASGN,MAAmB,aACnBY,IAA0BQ,EAA0BJ,CAAS,IAE7DhB,MAAmB,YACnBY,IAA0Bc,EAAyBV,CAAS,GAC5DF,IAAQiB,EAAQf,GAAW,EAAI,IAE/BhB,MAAmB,YACnBY,IAA0BkB,EAAyBd,CAAS,MAhB5DhB,MAAmB,WACnBa,IAA6Ba,EAAyBR,CAAY,GAClEH,IAAQgB,EAAQb,GAAc,EAAK,KAGnCL,IAA6BiB,EAAyBZ,CAAY,GAenE,EAAC,yBAAAN,GAAyB,4BAAAC,GAA4B,OAAAC,GAAO,OAAAC,EAAAA;AACxE;","x_google_ignoreList":[0]}
|
package/dist/node_modules/@milaboratories/miplots4/dist/{discrete/utils → utils}/splitTextByWidth.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextMeasurer as f } from "
|
|
1
|
+
import { TextMeasurer as f } from "./TextMeasurer/TextMeasurer.js";
|
|
2
2
|
function d(h, p, a, o = 14) {
|
|
3
3
|
const i = new f(`600 ${o}px Manrope`), s = [];
|
|
4
4
|
h.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach((n) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitTextByWidth.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/utils/splitTextByWidth.ts"],"sourcesContent":["import { TextMeasurer } from './TextMeasurer/TextMeasurer';\n\nfunction splitWord(word:string, startLineLength:number, maxLength:number, fontSize = 14) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n // \"_\" and \"-\" symbols have priority as separation bounds, if this is not enough split by single symbols\n const parts:string[] = [];\n word\n .split(/(?=[_-])|(?<=[_-])/)\n .forEach((part) => {\n const length = textMeasurer.getTextWidth(part);\n if (length > maxLength) {\n parts.push(...part.split(''));\n } else {\n parts.push(part);\n }\n });\n let currentLine = '';\n let currentLineLength = 0;\n let i = 0;\n let firstPart = '';\n while (currentLineLength <= startLineLength) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < startLineLength) {\n currentLine += parts[i];\n firstPart = currentLine;\n i++;\n }\n currentLineLength = nextLength;\n }\n currentLine = '';\n currentLineLength = 0;\n const lines:string[] = [];\n for (i; i < parts.length; i++) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < maxLength) {\n currentLine += parts[i];\n currentLineLength = nextLength;\n } else {\n lines.push(currentLine);\n currentLine = parts[i];\n currentLineLength = textMeasurer.getTextWidth(parts[i]);\n }\n }\n return {\n firstPart,\n lines,\n lastPart: currentLine,\n lastPartLength: currentLineLength\n };\n}\n\nexport function splitTextByWidth (text:string, maxWidth: number, fontSize: number) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n if (text.trim() === '') {\n return [];\n }\n if (textMeasurer.getTextWidth(text) <= maxWidth) {\n return [text];\n }\n const words = text.split(/\\s+/);\n const result:string[] = [];\n let currentLine = '';\n let currentLineLength = 0;\n for (let i = 0; i < words.length; i++) {\n const tempLine = `${currentLine} ${words[i]}`;\n const tempLineLength = textMeasurer.getTextWidth(tempLine);\n if (tempLineLength <= maxWidth) {\n currentLine = tempLine;\n currentLineLength = tempLineLength;\n } else {\n const wordLength = textMeasurer.getTextWidth(words[i]);\n if (wordLength > maxWidth) {\n const {\n firstPart,\n lines,\n lastPart,\n lastPartLength\n } = splitWord(words[i], maxWidth - currentLineLength, maxWidth, fontSize);\n result.push(`${currentLine} ${firstPart}`);\n result.push(...lines);\n currentLine = lastPart;\n currentLineLength = lastPartLength;\n } else {\n result.push(currentLine);\n currentLine = words[i];\n currentLineLength = wordLength;\n }\n }\n }\n result.push(currentLine);\n return result.filter((line) => {\n return line.length > 0;\n });\n}\n"],"names":["splitWord","word","startLineLength","maxLength","fontSize","textMeasurer","TextMeasurer","parts","part","currentLine","currentLineLength","i","firstPart","nextLength","lines","splitTextByWidth","text","maxWidth","words","result","tempLine","tempLineLength","wordLength","lastPart","lastPartLength","line"],"mappings":";AAEA,SAASA,EAAUC,GAAaC,GAAwBC,GAAkBC,IAAW,IAAI;AACrF,QAAMC,IAAe,IAAIC,EAAa,OAAOF,CAAQ,YAAY,GAE3DG,IAAiB,CAAA;AACvBN,EAAAA,EACK,MAAM,IAAA,OAAA,oBAAoB,CAAA,EAC1B,QAAQ,CAACO,MAAS;AACAH,MAAa,aAAaG,CAAI,IAChCL,IACTI,EAAM,KAAK,GAAGC,EAAK,MAAM,EAAE,CAAC,IAE5BD,EAAM,KAAKC,CAAI;AAAA,EAEvB,CAAC;AACL,MAAIC,IAAc,IACdC,IAAoB,GACpBC,IAAI,GACJC,IAAY;AAChB,SAAOF,KAAqBR,KAAiB;AACzC,UAAMW,IAAaR,EAAa,aAAaI,IAAcF,EAAMI,CAAC,CAAC;AAC/DE,IAAAA,IAAaX,MACbO,KAAeF,EAAMI,CAAC,GACtBC,IAAYH,GACZE,MAEJD,IAAoBG;AAAAA,EACxB;AACAJ,MAAc,IACdC,IAAoB;AACpB,QAAMI,IAAiB,CAAA;AACvB,OAAKH,GAAGA,IAAIJ,EAAM,QAAQI,KAAK;AAC3B,UAAME,IAAaR,EAAa,aAAaI,IAAcF,EAAMI,CAAC,CAAC;AAC/DE,IAAAA,IAAaV,KACbM,KAAeF,EAAMI,CAAC,GACtBD,IAAoBG,MAEpBC,EAAM,KAAKL,CAAW,GACtBA,IAAcF,EAAMI,CAAC,GACrBD,IAAoBL,EAAa,aAAaE,EAAMI,CAAC,CAAC;AAAA,EAE9D;AACA,SAAO;AAAA,IACH,WAAAC;AAAAA,IACA,OAAAE;AAAAA,IACA,UAAUL;AAAAA,IACV,gBAAgBC;AAAAA,EAAA;AAExB;AAEO,SAASK,EAAkBC,GAAaC,GAAkBb,GAAkB;AAC/E,QAAMC,IAAe,IAAIC,EAAa,OAAOF,CAAQ,YAAY;AACjE,MAAIY,EAAK,WAAW;AAChB,WAAO,CAAA;AAEX,MAAIX,EAAa,aAAaW,CAAI,KAAKC;AACnC,WAAO,CAACD,CAAI;AAEhB,QAAME,IAAQF,EAAK,MAAM,KAAK,GACxBG,IAAkB,CAAA;AACxB,MAAIV,IAAc,IACdC,IAAoB;AACxB,WAASC,IAAI,GAAGA,IAAIO,EAAM,QAAQP,KAAK;AACnC,UAAMS,IAAW,GAAGX,CAAW,IAAIS,EAAMP,CAAC,CAAC,IACrCU,IAAiBhB,EAAa,aAAae,CAAQ;AACzD,QAAIC,KAAkBJ;AAClBR,UAAcW,GACdV,IAAoBW;AAAAA,SACjB;AACH,YAAMC,IAAajB,EAAa,aAAaa,EAAMP,CAAC,CAAC;AACrD,UAAIW,IAAaL,GAAU;AACvB,cAAM;AAAA,UACF,WAAAL;AAAAA,UACA,OAAAE;AAAAA,UACA,UAAAS;AAAAA,UACA,gBAAAC;AAAAA,QAAA,IACAxB,EAAUkB,EAAMP,CAAC,GAAGM,IAAWP,GAAmBO,GAAUb,CAAQ;AACxEe,QAAAA,EAAO,KAAK,GAAGV,CAAW,IAAIG,CAAS,EAAE,GACzCO,EAAO,KAAK,GAAGL,CAAK,GACpBL,IAAcc,GACdb,IAAoBc;AAAAA,MACxB;AACIL,QAAAA,EAAO,KAAKV,CAAW,GACvBA,IAAcS,EAAMP,CAAC,GACrBD,IAAoBY;AAAAA,IAE5B;AAAA,EACJ;AACA,SAAAH,EAAO,KAAKV,CAAW,GAChBU,EAAO,OAAO,CAACM,MACXA,EAAK,SAAS,CACxB;AACL;","x_google_ignoreList":[0]}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js";
|
|
2
|
+
import "../node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js";
|
|
3
|
+
import "../_virtual/canonicalize.js";
|
|
4
|
+
import "../node_modules/@milaboratories/pl-model-common/dist/plid.js";
|
|
5
|
+
import "../node_modules/@milaboratories/pl-model-common/dist/ref.js";
|
|
6
|
+
import "../node_modules/@platforma-sdk/model/dist/render/util/label.js";
|
|
7
|
+
import { isLabelColumn as H } from "../node_modules/@platforma-sdk/model/dist/components/PlDataTable.js";
|
|
8
|
+
import "../node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js";
|
|
2
9
|
import { DISCRETE_FILTER_KEY as L, SUBSET_FILTER_KEY as q, IS_LINKER_COLUMN as G } from "../constants.js";
|
|
3
10
|
import { columnOrAxisIdFromString as I, isColumnId as B, AxisId as C } from "../spec.js";
|
|
4
11
|
import { getStateCopy as W, getNotAllowedAxes as M, axisMustBeConsumed as X, getColumnOrAxisLabel as R } from "../utils.js";
|
|
5
|
-
var
|
|
6
|
-
const
|
|
12
|
+
var J = Object.defineProperty, Q = (f, e, t) => e in f ? J(f, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : f[e] = t, g = (f, e, t) => Q(f, typeof e != "symbol" ? e + "" : e, t);
|
|
13
|
+
const V = (f) => {
|
|
7
14
|
var e;
|
|
8
15
|
return ((e = f == null ? void 0 : f.annotations) == null ? void 0 : e[G]) === "true";
|
|
9
16
|
}, _ = class K {
|
|
@@ -15,9 +22,9 @@ const Q = (f) => {
|
|
|
15
22
|
dependsOn: s = [],
|
|
16
23
|
parentComponents: c = [],
|
|
17
24
|
annotations: l = {},
|
|
18
|
-
checkSourceBySpec:
|
|
25
|
+
checkSourceBySpec: u
|
|
19
26
|
}) {
|
|
20
|
-
g(this, "componentName"), g(this, "allowedTypes"), g(this, "settings"), g(this, "dependsOn"), g(this, "parentComponents"), g(this, "strictlyDependsOnParents"), g(this, "annotations"), g(this, "checkSourceBySpec"), this.componentName = e, this.allowedTypes = [...t], this.settings = { ...K.DefaultSettings, ...n }, this.dependsOn = [...s], this.parentComponents = [...c], this.strictlyDependsOnParents = i ?? !0, this.annotations = { ...l },
|
|
27
|
+
g(this, "componentName"), g(this, "allowedTypes"), g(this, "settings"), g(this, "dependsOn"), g(this, "parentComponents"), g(this, "strictlyDependsOnParents"), g(this, "annotations"), g(this, "checkSourceBySpec"), this.componentName = e, this.allowedTypes = [...t], this.settings = { ...K.DefaultSettings, ...n }, this.dependsOn = [...s], this.parentComponents = [...c], this.strictlyDependsOnParents = i ?? !0, this.annotations = { ...l }, u && (this.checkSourceBySpec = u);
|
|
21
28
|
}
|
|
22
29
|
get isRequired() {
|
|
23
30
|
return this.settings.required;
|
|
@@ -39,7 +46,7 @@ const Q = (f) => {
|
|
|
39
46
|
const d = C.fromAxisSpec(r).toCanonicalString();
|
|
40
47
|
return s.has(d);
|
|
41
48
|
}
|
|
42
|
-
const
|
|
49
|
+
const u = await Promise.all(
|
|
43
50
|
i.selectorStates.map(async ({ selectedSource: r }) => {
|
|
44
51
|
const d = I(r);
|
|
45
52
|
if (B(d)) {
|
|
@@ -50,7 +57,7 @@ const Q = (f) => {
|
|
|
50
57
|
})
|
|
51
58
|
);
|
|
52
59
|
return i.selectorStates.reduce(
|
|
53
|
-
(r, d, o) => (r[d.selectedSource] =
|
|
60
|
+
(r, d, o) => (r[d.selectedSource] = u[o], r),
|
|
54
61
|
{}
|
|
55
62
|
);
|
|
56
63
|
}
|
|
@@ -78,8 +85,8 @@ const Q = (f) => {
|
|
|
78
85
|
for (const c of i)
|
|
79
86
|
if (B(c)) {
|
|
80
87
|
const l = await e.pFrameProvider.getColumnSpecById(c);
|
|
81
|
-
(n = l == null ? void 0 : l.axesSpec) == null || n.forEach((
|
|
82
|
-
const r = C.fromAxisSpec(
|
|
88
|
+
(n = l == null ? void 0 : l.axesSpec) == null || n.forEach((u) => {
|
|
89
|
+
const r = C.fromAxisSpec(u);
|
|
83
90
|
s.add(r.toCanonicalString());
|
|
84
91
|
});
|
|
85
92
|
}
|
|
@@ -87,7 +94,7 @@ const Q = (f) => {
|
|
|
87
94
|
}
|
|
88
95
|
async getAllowedAxes(e, t) {
|
|
89
96
|
var n, i;
|
|
90
|
-
const s = this.getParentSelectedSources(e, t), c = /* @__PURE__ */ new Set(), l = [],
|
|
97
|
+
const s = this.getParentSelectedSources(e, t), c = /* @__PURE__ */ new Set(), l = [], u = /* @__PURE__ */ new Map();
|
|
91
98
|
for (const r of s)
|
|
92
99
|
if (B(r)) {
|
|
93
100
|
const d = await e.pFrameProvider.getColumnSpecById(r);
|
|
@@ -97,7 +104,7 @@ const Q = (f) => {
|
|
|
97
104
|
continue;
|
|
98
105
|
c.add(p), l.push(o);
|
|
99
106
|
const v = X(o);
|
|
100
|
-
|
|
107
|
+
u.set(p, {
|
|
101
108
|
kind: "axis",
|
|
102
109
|
name: o.name,
|
|
103
110
|
label: await R(e, p, [
|
|
@@ -114,25 +121,25 @@ const Q = (f) => {
|
|
|
114
121
|
});
|
|
115
122
|
}
|
|
116
123
|
}
|
|
117
|
-
return { parentAxes: c, parentAxesList: l, optionsInfo:
|
|
124
|
+
return { parentAxes: c, parentAxesList: l, optionsInfo: u };
|
|
118
125
|
}
|
|
119
|
-
async getOptions(e, t, n, i, s, c, l = /* @__PURE__ */ new Set(),
|
|
126
|
+
async getOptions(e, t, n, i, s, c, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set()) {
|
|
120
127
|
var r, d, o;
|
|
121
128
|
const p = this.settings.multipleSelectors, v = this.settings.required, O = await this.checkStateConsistency(e, t, s);
|
|
122
129
|
if (this.dependsOn.length && this.dependsOn.some((h) => t.components[h].selectorStates.length === 0))
|
|
123
130
|
return { multipleSelectors: p, required: v, stateConsistency: O, options: [], optionsInfo: /* @__PURE__ */ new Map() };
|
|
124
131
|
if (this.strictlyDependsOnParents && !this.settings.isDataComponent && this.parentComponents.some((h) => t.components[h].selectorStates.length === 0))
|
|
125
132
|
return { multipleSelectors: p, required: v, stateConsistency: O, options: [], optionsInfo: /* @__PURE__ */ new Map() };
|
|
126
|
-
const j = this.getParentSelectedSources(e, t), U = (await e.pFrameProvider.getColumns([], !1, this.allowedTypes, void 0, this.annotations)).filter((h) => !i.has(h.toCanonicalString())), { parentAxes: D, parentAxesList: Y, optionsInfo: F } = await this.getAllowedAxes(e, t), z = t.components[this.componentName],
|
|
133
|
+
const j = this.getParentSelectedSources(e, t), U = (await e.pFrameProvider.getColumns([], !1, this.allowedTypes, void 0, this.annotations)).filter((h) => !i.has(h.toCanonicalString())), { parentAxes: D, parentAxesList: Y, optionsInfo: F } = await this.getAllowedAxes(e, t), z = t.components[this.componentName], N = [];
|
|
127
134
|
if (this.settings.axesAllowed)
|
|
128
135
|
for (const h of D) {
|
|
129
136
|
const y = I(h), S = F.get(y.toCanonicalString()), w = this.allowedTypes.includes(S.spec.type), a = Object.entries(this.annotations).every(
|
|
130
|
-
([E,
|
|
137
|
+
([E, m]) => {
|
|
131
138
|
var x;
|
|
132
|
-
return ((x = S.spec.annotations) == null ? void 0 : x[E]) ===
|
|
139
|
+
return ((x = S.spec.annotations) == null ? void 0 : x[E]) === m;
|
|
133
140
|
}
|
|
134
|
-
), A = this.checkSourceBySpec ? this.checkSourceBySpec(S.spec, t) : !0,
|
|
135
|
-
w && a && A &&
|
|
141
|
+
), A = this.checkSourceBySpec ? this.checkSourceBySpec(S.spec, t) : !0, T = !this.settings.homogeneous || !(S != null && S.mustBeConsumed), b = !i.has(h), P = l.has(y.name) || u.has(y.toCanonicalString()), k = z.selectorStates.some((E) => E.selectedSource === h);
|
|
142
|
+
w && a && A && T && b && !P && !k && N.push({ value: h });
|
|
136
143
|
}
|
|
137
144
|
if (this.settings.columnsAllowed) {
|
|
138
145
|
const h = !this.settings.columnsWithExtraAxesAllowed && this.strictlyDependsOnParents;
|
|
@@ -145,23 +152,23 @@ const Q = (f) => {
|
|
|
145
152
|
Y,
|
|
146
153
|
D,
|
|
147
154
|
s
|
|
148
|
-
).map((
|
|
155
|
+
).map((m) => C.fromAxisSpec(m).toCanonicalString()), T = new Set(A);
|
|
149
156
|
if (
|
|
150
157
|
// do not add to available options label columns, or columns that are not fit by custom spec condition, or columns that are not fit by condition for data inputs
|
|
151
|
-
H(a) ||
|
|
152
|
-
const x = C.fromAxisSpec(
|
|
158
|
+
H(a) || V(a) || this.checkSourceBySpec && !this.checkSourceBySpec(a, t) || this.settings.isDataComponent && !c(a) || h && A.length > 0 || j.length && A.length > 0 && !a.axesSpec.some((m) => {
|
|
159
|
+
const x = C.fromAxisSpec(m).toCanonicalString();
|
|
153
160
|
return D.has(x);
|
|
154
161
|
})
|
|
155
162
|
)
|
|
156
163
|
continue;
|
|
157
|
-
const
|
|
158
|
-
if (this.settings.columnsWithExtraAxesAllowed &&
|
|
159
|
-
|
|
164
|
+
const b = ((r = a == null ? void 0 : a.axesSpec) == null ? void 0 : r.map((m) => C.fromAxisSpec(m).toCanonicalString())) ?? [], P = {};
|
|
165
|
+
if (this.settings.columnsWithExtraAxesAllowed && b.forEach((m, x) => {
|
|
166
|
+
T.has(m) && (P[m] = x);
|
|
160
167
|
}), a) {
|
|
161
|
-
const
|
|
168
|
+
const m = n[S] ?? await R(e, y.toCanonicalString(), []), x = {
|
|
162
169
|
kind: "column",
|
|
163
170
|
name: a.name,
|
|
164
|
-
label:
|
|
171
|
+
label: m,
|
|
165
172
|
type: a.valueType,
|
|
166
173
|
spec: a,
|
|
167
174
|
annotations: a.annotations,
|
|
@@ -172,13 +179,13 @@ const Q = (f) => {
|
|
|
172
179
|
};
|
|
173
180
|
F.set(w.toCanonicalString(), x);
|
|
174
181
|
}
|
|
175
|
-
const k = l.has(w.name) ||
|
|
176
|
-
(
|
|
182
|
+
const k = l.has(w.name) || u.has(w.toCanonicalString()), E = t.components[this.componentName].selectorStates.some(
|
|
183
|
+
(m) => m.selectedSource === S
|
|
177
184
|
);
|
|
178
|
-
!k && !E &&
|
|
185
|
+
!k && !E && N.push({ value: S });
|
|
179
186
|
}
|
|
180
187
|
}
|
|
181
|
-
return { multipleSelectors: p, required: v, stateConsistency: O, options:
|
|
188
|
+
return { multipleSelectors: p, required: v, stateConsistency: O, options: N, optionsInfo: F };
|
|
182
189
|
}
|
|
183
190
|
};
|
|
184
191
|
g(_, "DefaultSettings", {
|
|
@@ -191,8 +198,8 @@ g(_, "DefaultSettings", {
|
|
|
191
198
|
columnsWithExtraAxesAllowed: !0,
|
|
192
199
|
dimensionConsumer: !1
|
|
193
200
|
});
|
|
194
|
-
let
|
|
201
|
+
let le = _;
|
|
195
202
|
export {
|
|
196
|
-
|
|
203
|
+
le as ComponentController
|
|
197
204
|
};
|
|
198
205
|
//# sourceMappingURL=ComponentController.js.map
|
package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentController.js","sources":["../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/ComponentController.ts"],"sourcesContent":["import {isLabelColumn} from '@platforma-sdk/model';\nimport type {\n AxisData,\n ColumnData,\n ComponentGuideSimple,\n ComponentState,\n InputState,\n SelectorState,\n SelectorStateFilter,\n SelectorStateSimple,\n SourceOption,\n} from '../common';\nimport {\n DISCRETE_FILTER_KEY,\n IS_LINKER_COLUMN,\n SUBSET_FILTER_KEY,\n} from '../constants';\nimport type {DataStore} from '../store';\nimport type {ColumnId, ColumnOrAxisIdString} from '../spec';\nimport {AxisId, columnOrAxisIdFromString, isColumnId} from '../spec';\nimport type {AxisSpec, LinkerMap, PColumnSpec, ValueType} from '@milaboratories/pl-model-common';\nimport {axisMustBeConsumed, getColumnOrAxisLabel, getNotAllowedAxes, getStateCopy} from '../utils';\n\nconst isLinkerColumn = (columnSpec:PColumnSpec) => columnSpec?.annotations?.[IS_LINKER_COLUMN] === 'true';\n\ninterface ComponentControllerSettings {\n isDataComponent: boolean; // X, Y, Data source etc.\n multipleSelectors: boolean; // more than 1 selected column in input\n required: boolean;\n homogeneous: boolean;\n axesAllowed: boolean;\n columnsAllowed: boolean;\n columnsWithExtraAxesAllowed: boolean; // can contain column with extra axes with fixed values\n dimensionConsumer: boolean; // remove extra dimension from data-mapping after selecting a heterogeneous axis\n}\n\ninterface FieldControllerOptions<State extends InputState, Field extends keyof State['components']> {\n componentName: Field;\n allowedTypes: ValueType[];\n checkSourceBySpec?: (spec: AxisSpec | PColumnSpec, state: State) => boolean; // for more complicated logic than type is in allowed types and annotation exists\n annotations?: Record<string, string>;\n parentComponents?: (keyof State['components'])[];\n dependsOn?: (keyof State['components'])[];\n strictlyDependsOnParents?: boolean;\n ignoredOptionIds?: string[];\n settings: Partial<ComponentControllerSettings>;\n}\n\nexport class ComponentController<State extends InputState, Field extends keyof State['components']> {\n private static DefaultSettings: ComponentControllerSettings = {\n isDataComponent: false,\n multipleSelectors: false,\n required: false,\n homogeneous: false,\n axesAllowed: false,\n columnsAllowed: true,\n columnsWithExtraAxesAllowed: true,\n dimensionConsumer: false,\n };\n\n readonly componentName: Field;\n readonly allowedTypes: ValueType[];\n readonly settings: ComponentControllerSettings;\n private readonly dependsOn: (keyof State['components'])[];\n private readonly parentComponents: (keyof State['components'])[];\n private readonly strictlyDependsOnParents: boolean;\n private readonly annotations: Record<string, string>;\n private readonly checkSourceBySpec?: (spec: AxisSpec | PColumnSpec, state: State) => boolean;\n\n constructor({\n componentName,\n allowedTypes,\n settings,\n strictlyDependsOnParents,\n dependsOn = [],\n parentComponents = [],\n annotations = {},\n checkSourceBySpec,\n }: FieldControllerOptions<State, Field>) {\n this.componentName = componentName;\n this.allowedTypes = [...allowedTypes];\n this.settings = {...ComponentController.DefaultSettings, ...settings};\n this.dependsOn = [...dependsOn];\n this.parentComponents = [...parentComponents]; // corresponding data components for meta or X for Y in scatterplot\n this.strictlyDependsOnParents = strictlyDependsOnParents ?? true; // meta-inputs are strictly-depending on parents, X by Y (Y by X) - don't\n this.annotations = {...annotations};\n if (checkSourceBySpec) {\n this.checkSourceBySpec = checkSourceBySpec;\n }\n }\n\n get isRequired(): boolean {\n return this.settings.required;\n }\n\n get isDimensionsConsumer(): boolean {\n return this.settings.dimensionConsumer;\n }\n\n addSelected(state: State, selectorState: SelectorStateSimple | SelectorStateFilter) {\n const nextState = getStateCopy(state);\n nextState.components[this.componentName].selectorStates.push(selectorState as SelectorStateFilter);\n\n // ***\n // here should be logic for possibly parent qualifications updating\n // ***\n\n return nextState;\n }\n\n deleteSelected(state: State, selectedSourceStr: ColumnOrAxisIdString) {\n const nextState = getStateCopy(state);\n // ***\n // here should be logic for removing unnecessary qualifications (it can appear when some sources are deleted)\n // ***\n nextState.components[this.componentName].selectorStates = (\n nextState.components[this.componentName].selectorStates as SelectorState[]\n ).filter(item => item.selectedSource !== selectedSourceStr);\n return nextState;\n }\n\n async checkStateConsistency(\n store: DataStore,\n state: State,\n linkerMap: LinkerMap\n ): Promise<Record<string, boolean>> {\n const componentState = state.components[this.componentName as keyof InputState];\n const {parentAxes, parentAxesList} = await this.getAllowedAxes(store, state);\n \n function isAxisInSet(a: AxisSpec) {\n const id = AxisId.fromAxisSpec(a).toCanonicalString();\n return parentAxes.has(id);\n }\n\n const consistencyData = await Promise.all(\n componentState.selectorStates.map(async ({selectedSource}) => {\n const sourceId = columnOrAxisIdFromString(selectedSource);\n // if column selected - check all axes of column\n if (isColumnId(sourceId)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(sourceId);\n if (!columnSpec) {\n // if column is not in store - current store and selected column are not consistent\n return false;\n }\n\n const parents = this.parentComponents;\n if (parents.length === 0) {\n return true;\n }\n if ((this.strictlyDependsOnParents && !this.settings.columnsWithExtraAxesAllowed) && !this.settings.isDataComponent) {\n return columnSpec.axesSpec.every(a => isAxisInSet(a));\n } else if (this.settings.columnsWithExtraAxesAllowed && !this.settings.isDataComponent) {\n if (columnSpec.axesSpec.some(a => isAxisInSet(a))) {\n return true;\n }\n\n const notAllowed = getNotAllowedAxes(columnSpec, parentAxesList, parentAxes, linkerMap);\n return notAllowed.length < columnSpec.axesSpec.length;\n } else {\n return parentAxes.size === 0 || columnSpec.axesSpec.some(a => isAxisInSet(a));\n }\n }\n return parentAxes.has(selectedSource);\n })\n );\n return (componentState.selectorStates as (SelectorStateSimple | SelectorStateFilter)[]).reduce(\n (res: Record<string, boolean>, item, idx) => {\n res[item.selectedSource] = consistencyData[idx];\n return res;\n },\n {}\n );\n }\n\n async getProducingAxes(store: DataStore, state: State) {\n const componentState = state.components[this.componentName as keyof InputState];\n const selectedHereIds = componentState.selectorStates.map(s => columnOrAxisIdFromString(s.selectedSource));\n const selectedHereColumnIds = selectedHereIds.filter(id => isColumnId(id));\n\n const axes = new Set<ColumnOrAxisIdString>();\n\n const infoList = await Promise.all(\n selectedHereColumnIds.map(id => {\n return store.pFrameProvider.getColumnSpecById(id);\n })\n );\n\n infoList.forEach(columnSpec => {\n if (columnSpec) {\n columnSpec.axesSpec.forEach(axisSpec => {\n axes.add(AxisId.fromAxisSpec(axisSpec).toCanonicalString());\n });\n }\n });\n return axes;\n }\n\n getParentSelectedSources(store: DataStore, state: State): (ColumnId | AxisId)[] {\n const selectedSources = this.parentComponents.reduce((res: (ColumnId | AxisId)[], item) => {\n const selectedHere = state.components[item].selectorStates.map(s =>\n columnOrAxisIdFromString(s.selectedSource)\n );\n res.push(...selectedHere);\n return res;\n }, []);\n\n // ***\n // consider parent qualifications without selected here\n // ***\n return selectedSources;\n }\n\n async getParentAxes(store: DataStore, state: State) {\n const parentSelectedSources = this.getParentSelectedSources(store, state);\n const axes = new Set<ColumnOrAxisIdString>();\n\n for (const source of parentSelectedSources) {\n if (isColumnId(source)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(source);\n columnSpec?.axesSpec?.forEach(spec => {\n const id = AxisId.fromAxisSpec(spec);\n axes.add(id.toCanonicalString());\n });\n }\n }\n return axes;\n }\n\n async getAllowedAxes(store: DataStore, state: State) {\n const parentSelectedSources = this.getParentSelectedSources(store, state);\n const parentAxes = new Set<ColumnOrAxisIdString>();\n const parentAxesList:AxisSpec[] = [];\n const optionsInfo: Map<string, AxisData | ColumnData> = new Map();\n\n for (const source of parentSelectedSources) {\n if (isColumnId(source)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(source);\n for (const spec of columnSpec?.axesSpec ?? []) {\n const id = AxisId.fromAxisSpec(spec);\n const idStr = id.toCanonicalString();\n if (parentAxes.has(idStr)) {\n continue;\n }\n parentAxes.add(idStr);\n parentAxesList.push(spec);\n const mustBeConsumed = axisMustBeConsumed(spec); // request unique values only for non-homogenous axes\n optionsInfo.set(idStr, {\n kind: 'axis',\n name: spec.name,\n label: await getColumnOrAxisLabel(store, idStr, [\n source.toCanonicalString(),\n ]),\n type: spec.type,\n mustBeConsumed,\n dividable: false,\n spec,\n annotations: spec.annotations,\n isSubsetFilter: spec.annotations?.[SUBSET_FILTER_KEY] === 'true',\n isDiscreteFilter:\n spec.type === 'String' || spec.annotations?.[DISCRETE_FILTER_KEY] === 'true',\n parentSources: [source.toCanonicalString()],\n });\n }\n }\n }\n\n return {parentAxes, parentAxesList, optionsInfo};\n }\n\n async getOptions(\n store: DataStore,\n state: State,\n labelsMap: Record<string, string>,\n consumedSourcesSet: Set<ColumnOrAxisIdString>,\n linkerMap: LinkerMap,\n dataColumnPredicate: (spec: PColumnSpec) => boolean,\n ignoredNamesSet: Set<string> = new Set(),\n fixedSelectedSet: Set<ColumnOrAxisIdString> = new Set()\n ): Promise<ComponentGuideSimple> {\n const multipleSelectors = this.settings.multipleSelectors;\n const required = this.settings.required;\n const stateConsistency = await this.checkStateConsistency(store, state, linkerMap);\n\n if (this.dependsOn.length && this.dependsOn.some(dep => state.components[dep].selectorStates.length === 0)) {\n return {multipleSelectors, required, stateConsistency, options: [], optionsInfo: new Map()};\n }\n\n if (\n this.strictlyDependsOnParents &&\n !this.settings.isDataComponent &&\n this.parentComponents.some(name => state.components[name].selectorStates.length === 0)\n ) {\n return {multipleSelectors, required, stateConsistency, options: [], optionsInfo: new Map()};\n }\n\n const parentSelectedSources = this.getParentSelectedSources(store, state);\n const allowedColumns = (\n await store.pFrameProvider.getColumns([], false, this.allowedTypes, undefined, this.annotations)\n ).filter(item => !consumedSourcesSet.has(item.toCanonicalString()));\n\n const {parentAxes, parentAxesList, optionsInfo} = await this.getAllowedAxes(store, state);\n\n const thisState: ComponentState = state.components[this.componentName];\n const options: SourceOption[] = [];\n if (this.settings.axesAllowed) {\n for (const idStr of parentAxes) {\n const id = columnOrAxisIdFromString(idStr) as AxisId;\n const axisData = optionsInfo.get(id.toCanonicalString()) as AxisData;\n\n const typeOK = this.allowedTypes.includes(axisData.spec.type);\n const annotationsOK = Object.entries(this.annotations).every(\n ([k, v]) => axisData.spec.annotations?.[k] === v\n );\n const checkBySpecOK = this.checkSourceBySpec ? this.checkSourceBySpec(axisData.spec, state) : true;\n const axisNatureOK = !this.settings.homogeneous || !axisData?.mustBeConsumed;\n const decreasingDimensionsOK = !consumedSourcesSet.has(idStr);\n const ignored = ignoredNamesSet.has(id.name) || fixedSelectedSet.has(id.toCanonicalString());\n const selectedHere = thisState.selectorStates.some(item => item.selectedSource === idStr);\n\n if (typeOK && annotationsOK && checkBySpecOK && axisNatureOK && decreasingDimensionsOK && !ignored && !selectedHere) {\n options.push({value: idStr});\n }\n }\n }\n\n if (this.settings.columnsAllowed) {\n const strictlyCompatible = !this.settings.columnsWithExtraAxesAllowed && this.strictlyDependsOnParents;\n for (const columnId of allowedColumns) {\n const columnIdString = columnId.toCanonicalString();\n const id = columnOrAxisIdFromString(columnIdString);\n\n const columnSpec = await store.pFrameProvider.getColumnSpecById(id);\n if (!columnSpec) {\n continue;\n }\n const extraAxesIds = getNotAllowedAxes(\n columnSpec,\n parentAxesList,\n parentAxes,\n linkerMap\n ).map((axisSpec) => AxisId.fromAxisSpec(axisSpec).toCanonicalString());\n\n const extraAxesSet = new Set(extraAxesIds);\n if (\n // do not add to available options label columns, or columns that are not fit by custom spec condition, or columns that are not fit by condition for data inputs\n isLabelColumn(columnSpec) || isLinkerColumn(columnSpec) ||\n (this.checkSourceBySpec && !this.checkSourceBySpec(columnSpec, state)) ||\n (this.settings.isDataComponent && !dataColumnPredicate(columnSpec)) ||\n strictlyCompatible && extraAxesIds.length > 0 ||\n parentSelectedSources.length && extraAxesIds.length > 0 && !columnSpec.axesSpec.some((axisSpec) => {\n const axisIdStr = AxisId.fromAxisSpec(axisSpec).toCanonicalString();\n return parentAxes.has(axisIdStr);\n })\n ) {\n continue;\n }\n const axesIds = columnSpec?.axesSpec?.map(axisSpec => AxisId.fromAxisSpec(axisSpec).toCanonicalString()) ?? [];\n const extraAxesIndexes:Record<string, number> = {};\n if (this.settings.columnsWithExtraAxesAllowed) {\n axesIds.forEach((id, idx) => {\n if (extraAxesSet.has(id)) {\n extraAxesIndexes[id] = idx;\n }\n });\n }\n if (columnSpec) {\n const label =\n labelsMap[columnIdString] ??\n (await getColumnOrAxisLabel(store, columnId.toCanonicalString(), []));\n const columnInfo: ColumnData = {\n kind: 'column',\n name: columnSpec.name,\n label,\n type: columnSpec.valueType,\n spec: columnSpec,\n annotations: columnSpec.annotations,\n isSubsetFilter: columnSpec.annotations?.[SUBSET_FILTER_KEY] === 'true',\n isDiscreteFilter:\n columnSpec.valueType === 'String' ||\n columnSpec.annotations?.[DISCRETE_FILTER_KEY] === 'true',\n axesToBeFixed: extraAxesIds,\n axesToBeFixedIndexes: extraAxesIndexes,\n };\n optionsInfo.set(id.toCanonicalString(), columnInfo);\n }\n\n const ignored = ignoredNamesSet.has(id.name) || fixedSelectedSet.has(id.toCanonicalString());\n const selectedHere = state.components[this.componentName].selectorStates.some(\n item => item.selectedSource === columnIdString\n );\n if (!ignored && !selectedHere) {\n options.push({value: columnIdString});\n }\n }\n }\n return {multipleSelectors, required, stateConsistency, options, optionsInfo};\n }\n}\n"],"names":["isLinkerColumn","columnSpec","_a","IS_LINKER_COLUMN","_ComponentController","componentName","allowedTypes","settings","strictlyDependsOnParents","dependsOn","parentComponents","annotations","checkSourceBySpec","__publicField","state","selectorState","nextState","getStateCopy","selectedSourceStr","item","store","linkerMap","componentState","parentAxes","parentAxesList","isAxisInSet","a","id","AxisId","consistencyData","selectedSource","sourceId","columnOrAxisIdFromString","isColumnId","C","getNotAllowedAxes","res","idx","selectedHereColumnIds","n","s","axes","axisSpec","selectedHere","parentSelectedSources","source","spec","optionsInfo","idStr","mustBeConsumed","axisMustBeConsumed","getColumnOrAxisLabel","SUBSET_FILTER_KEY","_b","DISCRETE_FILTER_KEY","labelsMap","consumedSourcesSet","dataColumnPredicate","ignoredNamesSet","fixedSelectedSet","multipleSelectors","required","stateConsistency","dep","name","allowedColumns","thisState","options","axisData","typeOK","annotationsOK","k","v","checkBySpecOK","axisNatureOK","decreasingDimensionsOK","ignored","strictlyCompatible","columnId","columnIdString","extraAxesIds","extraAxesSet","isLabelColumn","axisIdStr","axesIds","extraAxesIndexes","label","columnInfo","_c","ComponentController"],"mappings":";;;;;AAuBA,MAAMA,IAAiB,CAACC,MAA2B;;AAAA,WAAAC,IAAAD,KAAA,OAAA,SAAAA,EAAY,gBAAZ,OAAA,SAAAC,EAA0BC,CAAAA,OAAsB;AAAA,GAyBtFC,IAAN,MAAMA,EAAuF;AAAA,EAqBhG,YAAY;AAAA,IACR,eAAAC;AAAAA,IACA,cAAAC;AAAAA,IACA,UAAAC;AAAAA,IACA,0BAAAC;AAAAA,IACA,WAAAC,IAAY,CAAA;AAAA,IACZ,kBAAAC,IAAmB,CAAA;AAAA,IACnB,aAAAC,IAAc,CAAA;AAAA,IACd,mBAAAC;AAAAA,EAAA,GACqC;AAlBhCC,MAAA,MAAA,eAAA,GACAA,EAAA,MAAA,cAAA,GACAA,EAAA,MAAA,UAAA,GACQA,EAAA,MAAA,WAAA,GACAA,EAAA,MAAA,kBAAA,GACAA,EAAA,MAAA,0BAAA,GACAA,EAAA,MAAA,aAAA,GACAA,EAAA,MAAA,mBAAA,GAYb,KAAK,gBAAgBR,GAChB,KAAA,eAAe,CAAC,GAAGC,CAAY,GACpC,KAAK,WAAW,EAAC,GAAGF,EAAoB,iBAAiB,GAAGG,KACvD,KAAA,YAAY,CAAC,GAAGE,CAAS,GACzB,KAAA,mBAAmB,CAAC,GAAGC,CAAgB,GAC5C,KAAK,2BAA2BF,KAA4B,IACvD,KA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,EAAS,kBAAA,GAAqB,CAAA,CAAE,GACjES,IAAyB;AAAA,YAC3B,MAAM;AAAA,YACN,MAAMtF,EAAW;AAAA,YACjB,OAAAqF;AAAAA,YACA,MAAMrF,EAAW;AAAA,YACjB,MAAMA;AAAAA,YACN,aAAaA,EAAW;AAAA,YACxB,kBAAgBoD,IAAApD,EAAW,gBAAX,OAAA,SAAAoD,EAAyBD,CAAAA,OAAuB;AAAA,YAChE,kBACInD,EAAW,cAAc,cACzBuF,IAAAvF,EAAW,gBAAX,OAAA,SAAAuF,EAAyBlC,CAAAA,OAAyB;AAAA,YACtD,eAAe0B;AAAAA,YACf,sBAAsBK;AAAAA,UAAA;AAE1BtC,UAAAA,EAAY,IAAIpB,EAAG,kBAAA,GAAqB4D,CAAU;AAAA,QAAA;AAGhD,cAAAX,IAAUlB,EAAgB,IAAI/B,EAAG,IAAI,KAAKgC,EAAiB,IAAIhC,EAAG,mBAAmB,GACrFgB,IAAe7B,EAAM,WAAW,KAAK,aAAa,EAAE,eAAe;AAAA,UACrE,CAAAK,MAAQA,EAAK,mBAAmB4D;AAAAA,QAAA;AAEhC,SAACH,KAAW,CAACjC,KACbwB,EAAQ,KAAK,EAAC,OAAOY,GAAe;AAAA,MACxC;AAAA,IACJ;AAEJ,WAAO,EAAC,mBAAAnB,GAAmB,UAAAC,GAAU,kBAAAC,GAAkB,SAAAK,GAAS,aAAApB,EAAAA;AAAAA,EAAW;AAEnF;AA5VIlC,EADST,GACM,mBAA+C;AAAA,EAC1D,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,6BAA6B;AAAA,EAC7B,mBAAmB;AACvB,CAAA;AAVG,IAAMqF,KAANrF;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"ComponentController.js","sources":["../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/ComponentController.ts"],"sourcesContent":["import {isLabelColumn} from '@platforma-sdk/model';\nimport type {\n AxisData,\n ColumnData,\n ComponentGuideSimple,\n ComponentState,\n InputState,\n SelectorState,\n SelectorStateFilter,\n SelectorStateSimple,\n SourceOption,\n} from '../common';\nimport {\n DISCRETE_FILTER_KEY,\n IS_LINKER_COLUMN,\n SUBSET_FILTER_KEY,\n} from '../constants';\nimport type {DataStore} from '../store';\nimport type {ColumnId, ColumnOrAxisIdString} from '../spec';\nimport {AxisId, columnOrAxisIdFromString, isColumnId} from '../spec';\nimport type {AxisSpec, LinkerMap, PColumnSpec, ValueType} from '@milaboratories/pl-model-common';\nimport {axisMustBeConsumed, getColumnOrAxisLabel, getNotAllowedAxes, getStateCopy} from '../utils';\n\nconst isLinkerColumn = (columnSpec:PColumnSpec) => columnSpec?.annotations?.[IS_LINKER_COLUMN] === 'true';\n\ninterface ComponentControllerSettings {\n isDataComponent: boolean; // X, Y, Data source etc.\n multipleSelectors: boolean; // more than 1 selected column in input\n required: boolean;\n homogeneous: boolean;\n axesAllowed: boolean;\n columnsAllowed: boolean;\n columnsWithExtraAxesAllowed: boolean; // can contain column with extra axes with fixed values\n dimensionConsumer: boolean; // remove extra dimension from data-mapping after selecting a heterogeneous axis\n}\n\ninterface FieldControllerOptions<State extends InputState, Field extends keyof State['components']> {\n componentName: Field;\n allowedTypes: ValueType[];\n checkSourceBySpec?: (spec: AxisSpec | PColumnSpec, state: State) => boolean; // for more complicated logic than type is in allowed types and annotation exists\n annotations?: Record<string, string>;\n parentComponents?: (keyof State['components'])[];\n dependsOn?: (keyof State['components'])[];\n strictlyDependsOnParents?: boolean;\n ignoredOptionIds?: string[];\n settings: Partial<ComponentControllerSettings>;\n}\n\nexport class ComponentController<State extends InputState, Field extends keyof State['components']> {\n private static DefaultSettings: ComponentControllerSettings = {\n isDataComponent: false,\n multipleSelectors: false,\n required: false,\n homogeneous: false,\n axesAllowed: false,\n columnsAllowed: true,\n columnsWithExtraAxesAllowed: true,\n dimensionConsumer: false,\n };\n\n readonly componentName: Field;\n readonly allowedTypes: ValueType[];\n readonly settings: ComponentControllerSettings;\n private readonly dependsOn: (keyof State['components'])[];\n private readonly parentComponents: (keyof State['components'])[];\n private readonly strictlyDependsOnParents: boolean;\n private readonly annotations: Record<string, string>;\n private readonly checkSourceBySpec?: (spec: AxisSpec | PColumnSpec, state: State) => boolean;\n\n constructor({\n componentName,\n allowedTypes,\n settings,\n strictlyDependsOnParents,\n dependsOn = [],\n parentComponents = [],\n annotations = {},\n checkSourceBySpec,\n }: FieldControllerOptions<State, Field>) {\n this.componentName = componentName;\n this.allowedTypes = [...allowedTypes];\n this.settings = {...ComponentController.DefaultSettings, ...settings};\n this.dependsOn = [...dependsOn];\n this.parentComponents = [...parentComponents]; // corresponding data components for meta or X for Y in scatterplot\n this.strictlyDependsOnParents = strictlyDependsOnParents ?? true; // meta-inputs are strictly-depending on parents, X by Y (Y by X) - don't\n this.annotations = {...annotations};\n if (checkSourceBySpec) {\n this.checkSourceBySpec = checkSourceBySpec;\n }\n }\n\n get isRequired(): boolean {\n return this.settings.required;\n }\n\n get isDimensionsConsumer(): boolean {\n return this.settings.dimensionConsumer;\n }\n\n addSelected(state: State, selectorState: SelectorStateSimple | SelectorStateFilter) {\n const nextState = getStateCopy(state);\n nextState.components[this.componentName].selectorStates.push(selectorState as SelectorStateFilter);\n\n // ***\n // here should be logic for possibly parent qualifications updating\n // ***\n\n return nextState;\n }\n\n deleteSelected(state: State, selectedSourceStr: ColumnOrAxisIdString) {\n const nextState = getStateCopy(state);\n // ***\n // here should be logic for removing unnecessary qualifications (it can appear when some sources are deleted)\n // ***\n nextState.components[this.componentName].selectorStates = (\n nextState.components[this.componentName].selectorStates as SelectorState[]\n ).filter(item => item.selectedSource !== selectedSourceStr);\n return nextState;\n }\n\n async checkStateConsistency(\n store: DataStore,\n state: State,\n linkerMap: LinkerMap\n ): Promise<Record<string, boolean>> {\n const componentState = state.components[this.componentName as keyof InputState];\n const {parentAxes, parentAxesList} = await this.getAllowedAxes(store, state);\n \n function isAxisInSet(a: AxisSpec) {\n const id = AxisId.fromAxisSpec(a).toCanonicalString();\n return parentAxes.has(id);\n }\n\n const consistencyData = await Promise.all(\n componentState.selectorStates.map(async ({selectedSource}) => {\n const sourceId = columnOrAxisIdFromString(selectedSource);\n // if column selected - check all axes of column\n if (isColumnId(sourceId)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(sourceId);\n if (!columnSpec) {\n // if column is not in store - current store and selected column are not consistent\n return false;\n }\n\n const parents = this.parentComponents;\n if (parents.length === 0) {\n return true;\n }\n if ((this.strictlyDependsOnParents && !this.settings.columnsWithExtraAxesAllowed) && !this.settings.isDataComponent) {\n return columnSpec.axesSpec.every(a => isAxisInSet(a));\n } else if (this.settings.columnsWithExtraAxesAllowed && !this.settings.isDataComponent) {\n if (columnSpec.axesSpec.some(a => isAxisInSet(a))) {\n return true;\n }\n\n const notAllowed = getNotAllowedAxes(columnSpec, parentAxesList, parentAxes, linkerMap);\n return notAllowed.length < columnSpec.axesSpec.length;\n } else {\n return parentAxes.size === 0 || columnSpec.axesSpec.some(a => isAxisInSet(a));\n }\n }\n return parentAxes.has(selectedSource);\n })\n );\n return (componentState.selectorStates as (SelectorStateSimple | SelectorStateFilter)[]).reduce(\n (res: Record<string, boolean>, item, idx) => {\n res[item.selectedSource] = consistencyData[idx];\n return res;\n },\n {}\n );\n }\n\n async getProducingAxes(store: DataStore, state: State) {\n const componentState = state.components[this.componentName as keyof InputState];\n const selectedHereIds = componentState.selectorStates.map(s => columnOrAxisIdFromString(s.selectedSource));\n const selectedHereColumnIds = selectedHereIds.filter(id => isColumnId(id));\n\n const axes = new Set<ColumnOrAxisIdString>();\n\n const infoList = await Promise.all(\n selectedHereColumnIds.map(id => {\n return store.pFrameProvider.getColumnSpecById(id);\n })\n );\n\n infoList.forEach(columnSpec => {\n if (columnSpec) {\n columnSpec.axesSpec.forEach(axisSpec => {\n axes.add(AxisId.fromAxisSpec(axisSpec).toCanonicalString());\n });\n }\n });\n return axes;\n }\n\n getParentSelectedSources(store: DataStore, state: State): (ColumnId | AxisId)[] {\n const selectedSources = this.parentComponents.reduce((res: (ColumnId | AxisId)[], item) => {\n const selectedHere = state.components[item].selectorStates.map(s =>\n columnOrAxisIdFromString(s.selectedSource)\n );\n res.push(...selectedHere);\n return res;\n }, []);\n\n // ***\n // consider parent qualifications without selected here\n // ***\n return selectedSources;\n }\n\n async getParentAxes(store: DataStore, state: State) {\n const parentSelectedSources = this.getParentSelectedSources(store, state);\n const axes = new Set<ColumnOrAxisIdString>();\n\n for (const source of parentSelectedSources) {\n if (isColumnId(source)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(source);\n columnSpec?.axesSpec?.forEach(spec => {\n const id = AxisId.fromAxisSpec(spec);\n axes.add(id.toCanonicalString());\n });\n }\n }\n return axes;\n }\n\n async getAllowedAxes(store: DataStore, state: State) {\n const parentSelectedSources = this.getParentSelectedSources(store, state);\n const parentAxes = new Set<ColumnOrAxisIdString>();\n const parentAxesList:AxisSpec[] = [];\n const optionsInfo: Map<string, AxisData | ColumnData> = new Map();\n\n for (const source of parentSelectedSources) {\n if (isColumnId(source)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(source);\n for (const spec of columnSpec?.axesSpec ?? []) {\n const id = AxisId.fromAxisSpec(spec);\n const idStr = id.toCanonicalString();\n if (parentAxes.has(idStr)) {\n continue;\n }\n parentAxes.add(idStr);\n parentAxesList.push(spec);\n const mustBeConsumed = axisMustBeConsumed(spec); // request unique values only for non-homogenous axes\n optionsInfo.set(idStr, {\n kind: 'axis',\n name: spec.name,\n label: await getColumnOrAxisLabel(store, idStr, [\n source.toCanonicalString(),\n ]),\n type: spec.type,\n mustBeConsumed,\n dividable: false,\n spec,\n annotations: spec.annotations,\n isSubsetFilter: spec.annotations?.[SUBSET_FILTER_KEY] === 'true',\n isDiscreteFilter:\n spec.type === 'String' || spec.annotations?.[DISCRETE_FILTER_KEY] === 'true',\n parentSources: [source.toCanonicalString()],\n });\n }\n }\n }\n\n return {parentAxes, parentAxesList, optionsInfo};\n }\n\n async getOptions(\n store: DataStore,\n state: State,\n labelsMap: Record<string, string>,\n consumedSourcesSet: Set<ColumnOrAxisIdString>,\n linkerMap: LinkerMap,\n dataColumnPredicate: (spec: PColumnSpec) => boolean,\n ignoredNamesSet: Set<string> = new Set(),\n fixedSelectedSet: Set<ColumnOrAxisIdString> = new Set()\n ): Promise<ComponentGuideSimple> {\n const multipleSelectors = this.settings.multipleSelectors;\n const required = this.settings.required;\n const stateConsistency = await this.checkStateConsistency(store, state, linkerMap);\n\n if (this.dependsOn.length && this.dependsOn.some(dep => state.components[dep].selectorStates.length === 0)) {\n return {multipleSelectors, required, stateConsistency, options: [], optionsInfo: new Map()};\n }\n\n if (\n this.strictlyDependsOnParents &&\n !this.settings.isDataComponent &&\n this.parentComponents.some(name => state.components[name].selectorStates.length === 0)\n ) {\n return {multipleSelectors, required, stateConsistency, options: [], optionsInfo: new Map()};\n }\n\n const parentSelectedSources = this.getParentSelectedSources(store, state);\n const allowedColumns = (\n await store.pFrameProvider.getColumns([], false, this.allowedTypes, undefined, this.annotations)\n ).filter(item => !consumedSourcesSet.has(item.toCanonicalString()));\n\n const {parentAxes, parentAxesList, optionsInfo} = await this.getAllowedAxes(store, state);\n\n const thisState: ComponentState = state.components[this.componentName];\n const options: SourceOption[] = [];\n if (this.settings.axesAllowed) {\n for (const idStr of parentAxes) {\n const id = columnOrAxisIdFromString(idStr) as AxisId;\n const axisData = optionsInfo.get(id.toCanonicalString()) as AxisData;\n\n const typeOK = this.allowedTypes.includes(axisData.spec.type);\n const annotationsOK = Object.entries(this.annotations).every(\n ([k, v]) => axisData.spec.annotations?.[k] === v\n );\n const checkBySpecOK = this.checkSourceBySpec ? this.checkSourceBySpec(axisData.spec, state) : true;\n const axisNatureOK = !this.settings.homogeneous || !axisData?.mustBeConsumed;\n const decreasingDimensionsOK = !consumedSourcesSet.has(idStr);\n const ignored = ignoredNamesSet.has(id.name) || fixedSelectedSet.has(id.toCanonicalString());\n const selectedHere = thisState.selectorStates.some(item => item.selectedSource === idStr);\n\n if (typeOK && annotationsOK && checkBySpecOK && axisNatureOK && decreasingDimensionsOK && !ignored && !selectedHere) {\n options.push({value: idStr});\n }\n }\n }\n\n if (this.settings.columnsAllowed) {\n const strictlyCompatible = !this.settings.columnsWithExtraAxesAllowed && this.strictlyDependsOnParents;\n for (const columnId of allowedColumns) {\n const columnIdString = columnId.toCanonicalString();\n const id = columnOrAxisIdFromString(columnIdString);\n\n const columnSpec = await store.pFrameProvider.getColumnSpecById(id);\n if (!columnSpec) {\n continue;\n }\n const extraAxesIds = getNotAllowedAxes(\n columnSpec,\n parentAxesList,\n parentAxes,\n linkerMap\n ).map((axisSpec) => AxisId.fromAxisSpec(axisSpec).toCanonicalString());\n\n const extraAxesSet = new Set(extraAxesIds);\n if (\n // do not add to available options label columns, or columns that are not fit by custom spec condition, or columns that are not fit by condition for data inputs\n isLabelColumn(columnSpec) || isLinkerColumn(columnSpec) ||\n (this.checkSourceBySpec && !this.checkSourceBySpec(columnSpec, state)) ||\n (this.settings.isDataComponent && !dataColumnPredicate(columnSpec)) ||\n strictlyCompatible && extraAxesIds.length > 0 ||\n parentSelectedSources.length && extraAxesIds.length > 0 && !columnSpec.axesSpec.some((axisSpec) => {\n const axisIdStr = AxisId.fromAxisSpec(axisSpec).toCanonicalString();\n return parentAxes.has(axisIdStr);\n })\n ) {\n continue;\n }\n const axesIds = columnSpec?.axesSpec?.map(axisSpec => AxisId.fromAxisSpec(axisSpec).toCanonicalString()) ?? [];\n const extraAxesIndexes:Record<string, number> = {};\n if (this.settings.columnsWithExtraAxesAllowed) {\n axesIds.forEach((id, idx) => {\n if (extraAxesSet.has(id)) {\n extraAxesIndexes[id] = idx;\n }\n });\n }\n if (columnSpec) {\n const label =\n labelsMap[columnIdString] ??\n (await getColumnOrAxisLabel(store, columnId.toCanonicalString(), []));\n const columnInfo: ColumnData = {\n kind: 'column',\n name: columnSpec.name,\n label,\n type: columnSpec.valueType,\n spec: columnSpec,\n annotations: columnSpec.annotations,\n isSubsetFilter: columnSpec.annotations?.[SUBSET_FILTER_KEY] === 'true',\n isDiscreteFilter:\n columnSpec.valueType === 'String' ||\n columnSpec.annotations?.[DISCRETE_FILTER_KEY] === 'true',\n axesToBeFixed: extraAxesIds,\n axesToBeFixedIndexes: extraAxesIndexes,\n };\n optionsInfo.set(id.toCanonicalString(), columnInfo);\n }\n\n const ignored = ignoredNamesSet.has(id.name) || fixedSelectedSet.has(id.toCanonicalString());\n const selectedHere = state.components[this.componentName].selectorStates.some(\n item => item.selectedSource === columnIdString\n );\n if (!ignored && !selectedHere) {\n options.push({value: columnIdString});\n }\n }\n }\n return {multipleSelectors, required, stateConsistency, options, optionsInfo};\n }\n}\n"],"names":["isLinkerColumn","columnSpec","_a","IS_LINKER_COLUMN","_ComponentController","componentName","allowedTypes","settings","strictlyDependsOnParents","dependsOn","parentComponents","annotations","checkSourceBySpec","__publicField","state","selectorState","nextState","getStateCopy","selectedSourceStr","item","store","linkerMap","componentState","parentAxes","parentAxesList","isAxisInSet","a","id","AxisId","consistencyData","selectedSource","sourceId","columnOrAxisIdFromString","isColumnId","C","getNotAllowedAxes","res","idx","selectedHereColumnIds","n","s","axes","axisSpec","selectedHere","parentSelectedSources","source","spec","optionsInfo","idStr","mustBeConsumed","axisMustBeConsumed","getColumnOrAxisLabel","SUBSET_FILTER_KEY","_b","DISCRETE_FILTER_KEY","labelsMap","consumedSourcesSet","dataColumnPredicate","ignoredNamesSet","fixedSelectedSet","multipleSelectors","required","stateConsistency","dep","name","allowedColumns","thisState","options","axisData","typeOK","annotationsOK","k","v","checkBySpecOK","axisNatureOK","decreasingDimensionsOK","ignored","strictlyCompatible","columnId","columnIdString","extraAxesIds","extraAxesSet","isLabelColumn","axisIdStr","axesIds","extraAxesIndexes","label","columnInfo","_c","ComponentController"],"mappings":";;;;;;;;;;;;AAuBA,MAAMA,IAAiB,CAACC,MAA2B;;AAAA,WAAAC,IAAAD,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