@milaboratories/graph-maker 1.1.162 → 1.1.164
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 +7 -0
- package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
- package/dist/GraphMaker/constantsCommon.js +26 -19
- package/dist/GraphMaker/constantsCommon.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/Line.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/Line.vue.js +63 -52
- package/dist/GraphMaker/forms/LayersForm/Layer/discrete/Line.vue.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/heatmap/Heatmap.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/heatmap/Heatmap.vue.js +122 -91
- package/dist/GraphMaker/forms/LayersForm/Layer/heatmap/Heatmap.vue.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue.js +105 -77
- package/dist/GraphMaker/forms/LayersForm/Layer/heatmap/HeatmapClustered.vue.js.map +1 -1
- package/dist/GraphMaker/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/index.vue.js +50 -46
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +1 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +5 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js +28 -24
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.d.ts +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.js +11 -10
- package/dist/GraphMaker/utils/createChartSettingsForRender/getLayersDataFromForms.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +4 -4
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Legend.js +3 -3
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Legend.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +24 -24
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +13 -13
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js +31 -40
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +25 -25
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js +13 -8
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/index.js +58 -58
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +4 -4
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +204 -110
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +81 -78
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/react/index.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/react-dom/index.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +11 -10
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +14 -9
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js.map +1 -1
- package/package.json +2 -2
package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/index.js
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
import { j as i } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import { Annotation as
|
|
3
|
-
import { ANNOTATION_WIDTH as
|
|
4
|
-
function
|
|
5
|
-
return s.showTitle &&
|
|
2
|
+
import { Annotation as u } from "./Annotation.js";
|
|
3
|
+
import { ANNOTATION_WIDTH as p, ANNOTATIONS_OFFSET as m } from "../../constants.js";
|
|
4
|
+
function y(s, e) {
|
|
5
|
+
return s.showTitle && e.includes(s.titlePosition);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function Y({
|
|
8
8
|
facetKey: s,
|
|
9
|
-
sideElementBBoxes:
|
|
9
|
+
sideElementBBoxes: e,
|
|
10
10
|
annotations: x,
|
|
11
11
|
annotationColorScales: n,
|
|
12
12
|
cellsMeta: f,
|
|
13
|
-
chartEdgeSides:
|
|
13
|
+
chartEdgeSides: o,
|
|
14
14
|
sharedX: h,
|
|
15
|
-
sharedY:
|
|
16
|
-
width:
|
|
17
|
-
height:
|
|
18
|
-
scales:
|
|
19
|
-
stepX:
|
|
15
|
+
sharedY: v,
|
|
16
|
+
width: K,
|
|
17
|
+
height: T,
|
|
18
|
+
scales: g,
|
|
19
|
+
stepX: C,
|
|
20
20
|
stepY: G,
|
|
21
|
-
aes:
|
|
22
|
-
frame:
|
|
23
|
-
xGroupKeys:
|
|
24
|
-
yGroupKeys:
|
|
25
|
-
xKeysByGroups:
|
|
26
|
-
yKeysByGroups:
|
|
27
|
-
tooltipsData:
|
|
28
|
-
cellsRenderingMode:
|
|
21
|
+
aes: b,
|
|
22
|
+
frame: B,
|
|
23
|
+
xGroupKeys: S,
|
|
24
|
+
yGroupKeys: w,
|
|
25
|
+
xKeysByGroups: N,
|
|
26
|
+
yKeysByGroups: j,
|
|
27
|
+
tooltipsData: A,
|
|
28
|
+
cellsRenderingMode: D
|
|
29
29
|
}) {
|
|
30
|
-
const l = x.filter((t) =>
|
|
30
|
+
const l = x.filter((t) => o.includes(t.position) || !h && ["left", "right"].includes(t.position) || !v && ["top", "bottom"].includes(t.position)), O = l.filter((t) => t.position === "left"), L = l.filter((t) => t.position === "right"), E = l.filter((t) => t.position === "top"), I = l.filter((t) => t.position === "bottom"), { xDataByKeys: d, yDataByKeys: c } = f, r = {
|
|
31
31
|
facetKey: s,
|
|
32
|
-
scales:
|
|
33
|
-
stepX:
|
|
32
|
+
scales: g,
|
|
33
|
+
stepX: C,
|
|
34
34
|
stepY: G,
|
|
35
|
-
width:
|
|
36
|
-
height:
|
|
37
|
-
aes:
|
|
38
|
-
frame:
|
|
39
|
-
xGroupKeys:
|
|
40
|
-
yGroupKeys:
|
|
41
|
-
xKeysByGroups:
|
|
42
|
-
yKeysByGroups:
|
|
43
|
-
tooltipsData:
|
|
44
|
-
cellsRenderingMode:
|
|
35
|
+
width: K,
|
|
36
|
+
height: T,
|
|
37
|
+
aes: b,
|
|
38
|
+
frame: B,
|
|
39
|
+
xGroupKeys: S,
|
|
40
|
+
yGroupKeys: w,
|
|
41
|
+
xKeysByGroups: N,
|
|
42
|
+
yKeysByGroups: j,
|
|
43
|
+
tooltipsData: A,
|
|
44
|
+
cellsRenderingMode: D
|
|
45
45
|
};
|
|
46
46
|
return /* @__PURE__ */ i.jsxs("g", { children: [
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
O.map((t, a) => /* @__PURE__ */ i.jsx(
|
|
48
|
+
u,
|
|
49
49
|
{
|
|
50
50
|
annotation: t,
|
|
51
51
|
colorScale: n[t.id],
|
|
52
|
-
data: c[t.valueColumn.value],
|
|
53
|
-
showTitle:
|
|
54
|
-
x:
|
|
55
|
-
y:
|
|
52
|
+
data: c[t.valueColumn.valueLabels ?? t.valueColumn.value],
|
|
53
|
+
showTitle: y(t, o),
|
|
54
|
+
x: e.left.annotations.x + a * p,
|
|
55
|
+
y: e.left.annotations.y,
|
|
56
56
|
...r
|
|
57
57
|
},
|
|
58
58
|
t.id
|
|
59
59
|
)),
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
L.map((t, a) => /* @__PURE__ */ i.jsx(
|
|
61
|
+
u,
|
|
62
62
|
{
|
|
63
63
|
annotation: t,
|
|
64
64
|
colorScale: n[t.id],
|
|
65
|
-
data: c[t.valueColumn.value],
|
|
66
|
-
showTitle:
|
|
67
|
-
x:
|
|
68
|
-
y:
|
|
65
|
+
data: c[t.valueColumn.valueLabels ?? t.valueColumn.value],
|
|
66
|
+
showTitle: y(t, o),
|
|
67
|
+
x: e.right.annotations.x + a * p + m,
|
|
68
|
+
y: e.right.annotations.y,
|
|
69
69
|
...r
|
|
70
70
|
},
|
|
71
71
|
t.id
|
|
72
72
|
)),
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
E.map((t, a) => /* @__PURE__ */ i.jsx(
|
|
74
|
+
u,
|
|
75
75
|
{
|
|
76
76
|
annotation: t,
|
|
77
77
|
colorScale: n[t.id],
|
|
78
|
-
data: d[t.valueColumn.value],
|
|
79
|
-
showTitle:
|
|
80
|
-
x:
|
|
81
|
-
y:
|
|
78
|
+
data: d[t.valueColumn.valueLabels ?? t.valueColumn.value],
|
|
79
|
+
showTitle: y(t, o),
|
|
80
|
+
x: e.top.annotations.x,
|
|
81
|
+
y: e.top.annotations.y + a * p,
|
|
82
82
|
...r
|
|
83
83
|
},
|
|
84
84
|
t.id
|
|
85
85
|
)),
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
I.map((t, a) => /* @__PURE__ */ i.jsx(
|
|
87
|
+
u,
|
|
88
88
|
{
|
|
89
89
|
annotation: t,
|
|
90
90
|
colorScale: n[t.id],
|
|
91
|
-
data: d[t.valueColumn.value],
|
|
92
|
-
showTitle:
|
|
93
|
-
x:
|
|
94
|
-
y:
|
|
91
|
+
data: d[t.valueColumn.valueLabels ?? t.valueColumn.value],
|
|
92
|
+
showTitle: y(t, o),
|
|
93
|
+
x: e.bottom.annotations.x,
|
|
94
|
+
y: e.bottom.annotations.y + a * p + m,
|
|
95
95
|
...r
|
|
96
96
|
},
|
|
97
97
|
t.id
|
|
@@ -99,6 +99,6 @@ function F({
|
|
|
99
99
|
] });
|
|
100
100
|
}
|
|
101
101
|
export {
|
|
102
|
-
|
|
102
|
+
Y as Annotations
|
|
103
103
|
};
|
|
104
104
|
//# sourceMappingURL=index.js.map
|
package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@milaboratories/miplots4/src/heatmap/components/Annotations/index.tsx"],"sourcesContent":["import type {TooltipsData} from '../../../common/Tooltip';\nimport {Annotation} from './Annotation';\nimport type {\n AnnotationColorScales,\n AnnotationTooltipData,\n ChartDimensionsData,\n ChartScales,\n} from '../types';\nimport {ANNOTATION_WIDTH, ANNOTATIONS_OFFSET} from '../../constants';\nimport type {Cell} from '../../getCells';\nimport type {GroupedCellsData} from '../../getCells';\nimport type {HeatmapSettingsImpl} from '../../HeatmapSettingsImpl';\nimport React from 'react';\n\nfunction showTitle(item: HeatmapSettingsImpl['annotations'][0], chartEdgeSides: ChartDimensionsData['chartEdgeSides']) {\n return item.showTitle && chartEdgeSides.includes(item.titlePosition);\n}\n\ninterface AnnotationProps {\n facetKey: string;\n sideElementBBoxes: ChartDimensionsData['sideElementBBoxes'];\n annotations: HeatmapSettingsImpl['annotations'];\n cellsMeta: GroupedCellsData['meta'];\n annotationColorScales: AnnotationColorScales;\n sharedX: boolean;\n sharedY: boolean;\n chartEdgeSides: ChartDimensionsData['chartEdgeSides'];\n width: number;\n height: number;\n scales: ChartScales;\n stepX: number;\n stepY: number;\n aes: HeatmapSettingsImpl['aes'];\n frame: HeatmapSettingsImpl['chartSettings']['frame'];\n xGroupKeys: string[];\n yGroupKeys: string[];\n xKeysByGroups: GroupedCellsData['facets'][keyof GroupedCellsData['facets']]['xKeysByGroups'];\n yKeysByGroups: GroupedCellsData['facets'][keyof GroupedCellsData['facets']]['yKeysByGroups'];\n tooltipsData: TooltipsData<Cell|AnnotationTooltipData>;\n cellsRenderingMode: 'canvas' | 'svg';\n}\n\nexport function Annotations({\n facetKey,\n sideElementBBoxes,\n annotations,\n annotationColorScales,\n cellsMeta,\n chartEdgeSides,\n sharedX,\n sharedY,\n width,\n height,\n scales,\n stepX,\n stepY,\n aes,\n frame,\n xGroupKeys,\n yGroupKeys,\n xKeysByGroups,\n yKeysByGroups,\n tooltipsData,\n cellsRenderingMode,\n}: AnnotationProps) {\n const usedAnnotations = annotations.filter(item => {\n return (\n chartEdgeSides.includes(item.position) ||\n (!sharedX && ['left', 'right'].includes(item.position)) ||\n (!sharedY && ['top', 'bottom'].includes(item.position))\n );\n });\n const leftAnnotations = usedAnnotations.filter(item => item.position === 'left');\n const rightAnnotations = usedAnnotations.filter(item => item.position === 'right');\n const topAnnotations = usedAnnotations.filter(item => item.position === 'top');\n const bottomAnnotations = usedAnnotations.filter(item => item.position === 'bottom');\n const {xDataByKeys, yDataByKeys} = cellsMeta;\n\n const commonProps = {\n facetKey,\n scales,\n stepX,\n stepY,\n width,\n height,\n aes,\n frame,\n xGroupKeys,\n yGroupKeys,\n xKeysByGroups,\n yKeysByGroups,\n tooltipsData,\n cellsRenderingMode,\n };\n return (\n <g>\n {leftAnnotations.map((item, idx) => {\n return (\n <Annotation\n key={item.id}\n annotation={item}\n colorScale={annotationColorScales[item.id]}\n data={yDataByKeys[item.valueColumn.value]}\n showTitle={showTitle(item, chartEdgeSides)}\n x={sideElementBBoxes.left.annotations.x + idx * ANNOTATION_WIDTH}\n y={sideElementBBoxes.left.annotations.y}\n {...commonProps}\n />\n );\n })}\n {rightAnnotations.map((item, idx) => {\n return (\n <Annotation\n key={item.id}\n annotation={item}\n colorScale={annotationColorScales[item.id]}\n data={yDataByKeys[item.valueColumn.value]}\n showTitle={showTitle(item, chartEdgeSides)}\n x={sideElementBBoxes.right.annotations.x + idx * ANNOTATION_WIDTH + ANNOTATIONS_OFFSET}\n y={sideElementBBoxes.right.annotations.y}\n {...commonProps}\n />\n );\n })}\n {topAnnotations.map((item, idx) => {\n return (\n <Annotation\n key={item.id}\n annotation={item}\n colorScale={annotationColorScales[item.id]}\n data={xDataByKeys[item.valueColumn.value]}\n showTitle={showTitle(item, chartEdgeSides)}\n x={sideElementBBoxes.top.annotations.x}\n y={sideElementBBoxes.top.annotations.y + idx * ANNOTATION_WIDTH}\n {...commonProps}\n />\n );\n })}\n {bottomAnnotations.map((item, idx) => {\n return (\n <Annotation\n key={item.id}\n annotation={item}\n colorScale={annotationColorScales[item.id]}\n data={xDataByKeys[item.valueColumn.value]}\n showTitle={showTitle(item, chartEdgeSides)}\n x={sideElementBBoxes.bottom.annotations.x}\n y={sideElementBBoxes.bottom.annotations.y + idx * ANNOTATION_WIDTH + ANNOTATIONS_OFFSET}\n {...commonProps}\n />\n );\n })}\n </g>\n );\n}\n"],"names":["showTitle","item","chartEdgeSides","Annotations","facetKey","sideElementBBoxes","annotations","annotationColorScales","cellsMeta","sharedX","sharedY","width","height","scales","stepX","stepY","aes","frame","xGroupKeys","yGroupKeys","xKeysByGroups","yKeysByGroups","tooltipsData","cellsRenderingMode","usedAnnotations","leftAnnotations","rightAnnotations","topAnnotations","bottomAnnotations","xDataByKeys","yDataByKeys","commonProps","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@milaboratories/miplots4/src/heatmap/components/Annotations/index.tsx"],"sourcesContent":["import type {TooltipsData} from '../../../common/Tooltip';\nimport {Annotation} from './Annotation';\nimport type {\n AnnotationColorScales,\n AnnotationTooltipData,\n ChartDimensionsData,\n ChartScales,\n} from '../types';\nimport {ANNOTATION_WIDTH, ANNOTATIONS_OFFSET} from '../../constants';\nimport type {Cell} from '../../getCells';\nimport type {GroupedCellsData} from '../../getCells';\nimport type {HeatmapSettingsImpl} from '../../HeatmapSettingsImpl';\nimport React from 'react';\n\nfunction showTitle(item: HeatmapSettingsImpl['annotations'][0], chartEdgeSides: ChartDimensionsData['chartEdgeSides']) {\n return item.showTitle && chartEdgeSides.includes(item.titlePosition);\n}\n\ninterface AnnotationProps {\n facetKey: string;\n sideElementBBoxes: ChartDimensionsData['sideElementBBoxes'];\n annotations: HeatmapSettingsImpl['annotations'];\n cellsMeta: GroupedCellsData['meta'];\n annotationColorScales: AnnotationColorScales;\n sharedX: boolean;\n sharedY: boolean;\n chartEdgeSides: ChartDimensionsData['chartEdgeSides'];\n width: number;\n height: number;\n scales: ChartScales;\n stepX: number;\n stepY: number;\n aes: HeatmapSettingsImpl['aes'];\n frame: HeatmapSettingsImpl['chartSettings']['frame'];\n xGroupKeys: string[];\n yGroupKeys: string[];\n xKeysByGroups: GroupedCellsData['facets'][keyof GroupedCellsData['facets']]['xKeysByGroups'];\n yKeysByGroups: GroupedCellsData['facets'][keyof GroupedCellsData['facets']]['yKeysByGroups'];\n tooltipsData: TooltipsData<Cell|AnnotationTooltipData>;\n cellsRenderingMode: 'canvas' | 'svg';\n}\n\nexport function Annotations({\n facetKey,\n sideElementBBoxes,\n annotations,\n annotationColorScales,\n cellsMeta,\n chartEdgeSides,\n sharedX,\n sharedY,\n width,\n height,\n scales,\n stepX,\n stepY,\n aes,\n frame,\n xGroupKeys,\n yGroupKeys,\n xKeysByGroups,\n yKeysByGroups,\n tooltipsData,\n cellsRenderingMode,\n}: AnnotationProps) {\n const usedAnnotations = annotations.filter(item => {\n return (\n chartEdgeSides.includes(item.position) ||\n (!sharedX && ['left', 'right'].includes(item.position)) ||\n (!sharedY && ['top', 'bottom'].includes(item.position))\n );\n });\n const leftAnnotations = usedAnnotations.filter(item => item.position === 'left');\n const rightAnnotations = usedAnnotations.filter(item => item.position === 'right');\n const topAnnotations = usedAnnotations.filter(item => item.position === 'top');\n const bottomAnnotations = usedAnnotations.filter(item => item.position === 'bottom');\n const {xDataByKeys, yDataByKeys} = cellsMeta;\n\n const commonProps = {\n facetKey,\n scales,\n stepX,\n stepY,\n width,\n height,\n aes,\n frame,\n xGroupKeys,\n yGroupKeys,\n xKeysByGroups,\n yKeysByGroups,\n tooltipsData,\n cellsRenderingMode,\n };\n return (\n <g>\n {leftAnnotations.map((item, idx) => {\n return (\n <Annotation\n key={item.id}\n annotation={item}\n colorScale={annotationColorScales[item.id]}\n data={yDataByKeys[item.valueColumn.valueLabels ?? item.valueColumn.value]}\n showTitle={showTitle(item, chartEdgeSides)}\n x={sideElementBBoxes.left.annotations.x + idx * ANNOTATION_WIDTH}\n y={sideElementBBoxes.left.annotations.y}\n {...commonProps}\n />\n );\n })}\n {rightAnnotations.map((item, idx) => {\n return (\n <Annotation\n key={item.id}\n annotation={item}\n colorScale={annotationColorScales[item.id]}\n data={yDataByKeys[item.valueColumn.valueLabels ?? item.valueColumn.value]}\n showTitle={showTitle(item, chartEdgeSides)}\n x={sideElementBBoxes.right.annotations.x + idx * ANNOTATION_WIDTH + ANNOTATIONS_OFFSET}\n y={sideElementBBoxes.right.annotations.y}\n {...commonProps}\n />\n );\n })}\n {topAnnotations.map((item, idx) => {\n return (\n <Annotation\n key={item.id}\n annotation={item}\n colorScale={annotationColorScales[item.id]}\n data={xDataByKeys[item.valueColumn.valueLabels ?? item.valueColumn.value]}\n showTitle={showTitle(item, chartEdgeSides)}\n x={sideElementBBoxes.top.annotations.x}\n y={sideElementBBoxes.top.annotations.y + idx * ANNOTATION_WIDTH}\n {...commonProps}\n />\n );\n })}\n {bottomAnnotations.map((item, idx) => {\n return (\n <Annotation\n key={item.id}\n annotation={item}\n colorScale={annotationColorScales[item.id]}\n data={xDataByKeys[item.valueColumn.valueLabels ?? item.valueColumn.value]}\n showTitle={showTitle(item, chartEdgeSides)}\n x={sideElementBBoxes.bottom.annotations.x}\n y={sideElementBBoxes.bottom.annotations.y + idx * ANNOTATION_WIDTH + ANNOTATIONS_OFFSET}\n {...commonProps}\n />\n );\n })}\n </g>\n );\n}\n"],"names":["showTitle","item","chartEdgeSides","Annotations","facetKey","sideElementBBoxes","annotations","annotationColorScales","cellsMeta","sharedX","sharedY","width","height","scales","stepX","stepY","aes","frame","xGroupKeys","yGroupKeys","xKeysByGroups","yKeysByGroups","tooltipsData","cellsRenderingMode","usedAnnotations","leftAnnotations","rightAnnotations","topAnnotations","bottomAnnotations","xDataByKeys","yDataByKeys","commonProps","l","idx","jsx","Annotation","ANNOTATION_WIDTH","ANNOTATIONS_OFFSET"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as t } from "../../node_modules/react/jsx-runtime.js";
|
|
2
2
|
import { Tooltip as E } from "../../common/Tooltip.js";
|
|
3
|
-
import { useDataFrame as
|
|
3
|
+
import { useDataFrame as J } from "../../common/useDataFrame.js";
|
|
4
4
|
import { FONT_SIZE as N, FACET_TITLE_OFFSET as P } from "../constants.js";
|
|
5
5
|
import { Annotations as Q } from "./Annotations/index.js";
|
|
6
6
|
import { Captions as U } from "./Captions/index.js";
|
|
@@ -37,7 +37,7 @@ function fe({
|
|
|
37
37
|
tooltipsData: e,
|
|
38
38
|
cellsRenderingMode: D
|
|
39
39
|
}) {
|
|
40
|
-
const R =
|
|
40
|
+
const R = J(), { xAxis: V, yAxis: W, tooltips: T } = p, { width: G, height: B } = l.inner, { padding: i, chartEdgeSides: _, sideElementBBoxes: n } = l, { xGroupLabels: H, yGroupLabels: I, xLabels: O, yLabels: q } = a, h = s.x.domain(), S = s.y.domain(), b = {
|
|
41
41
|
left: x.left + l.left + i.left,
|
|
42
42
|
right: d.totalWidth - (x.left + l.left + i.left),
|
|
43
43
|
top: x.top + l.top + i.top,
|
|
@@ -160,8 +160,8 @@ function fe({
|
|
|
160
160
|
xGroupLabels: H,
|
|
161
161
|
yGroupLabels: I,
|
|
162
162
|
labelAngles: M,
|
|
163
|
-
xLabels:
|
|
164
|
-
yLabels:
|
|
163
|
+
xLabels: O,
|
|
164
|
+
yLabels: q
|
|
165
165
|
}
|
|
166
166
|
)
|
|
167
167
|
] }),
|
|
@@ -1,38 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import h from "../node_modules/lodash/lodash.js";
|
|
2
|
+
import { exhaustive as ee } from "../utils/index.js";
|
|
3
|
+
import N from "../node_modules/d3-array/src/mean.js";
|
|
4
|
+
import { quantileSorted as ae } from "../node_modules/d3-array/src/quantile.js";
|
|
5
|
+
import te from "../node_modules/d3-array/src/deviation.js";
|
|
6
|
+
import ue from "../node_modules/d3-array/src/extent.js";
|
|
7
|
+
function oe(a) {
|
|
8
|
+
const u = te(a), o = N(a);
|
|
9
|
+
return u === void 0 || o === void 0 || u === 0 ? (n) => n : (n) => (n - o) / u;
|
|
8
10
|
}
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return
|
|
11
|
+
function le(a) {
|
|
12
|
+
const u = N(a), [o, n] = ue(a);
|
|
13
|
+
return u === void 0 || o === void 0 || n === void 0 || n === o ? (y) => y : (y) => (y - u) / (n - o);
|
|
12
14
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
+
function se(a, u) {
|
|
16
|
+
return a === "standardScaling" ? oe(u) : a === "meanNormalization" ? le(u) : (o) => o;
|
|
15
17
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
+
function k(a, u) {
|
|
19
|
+
switch (a) {
|
|
20
|
+
case "max": {
|
|
21
|
+
let o = u[0];
|
|
22
|
+
for (const n of u)
|
|
23
|
+
o = Math.max(o, n);
|
|
24
|
+
return o;
|
|
25
|
+
}
|
|
26
|
+
case "min": {
|
|
27
|
+
let o = u[0];
|
|
28
|
+
for (const n of u)
|
|
29
|
+
o = Math.min(o, n);
|
|
30
|
+
return o;
|
|
31
|
+
}
|
|
32
|
+
case "median": {
|
|
33
|
+
const o = u.sort((n, y) => n - y);
|
|
34
|
+
return ae(o, 0.5);
|
|
35
|
+
}
|
|
36
|
+
case "mean":
|
|
37
|
+
return N(u) ?? u[0];
|
|
38
|
+
default:
|
|
39
|
+
ee(a, `Unknown aggregation function ${a}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function Q(a) {
|
|
43
|
+
const u = [...new Set(a)].sort();
|
|
44
|
+
return u.length > 3 ? [...u.slice(0, 3), "..."].join(", ") : u.join(", ");
|
|
45
|
+
}
|
|
46
|
+
function I(a) {
|
|
47
|
+
if (!a.length)
|
|
18
48
|
return [];
|
|
19
|
-
let
|
|
20
|
-
return
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}),
|
|
25
|
-
}),
|
|
49
|
+
let u = [[]];
|
|
50
|
+
return a.forEach((o) => {
|
|
51
|
+
const n = [];
|
|
52
|
+
o.forEach((y) => {
|
|
53
|
+
n.push(...u.map((v) => [...v, y]));
|
|
54
|
+
}), u = n;
|
|
55
|
+
}), u;
|
|
26
56
|
}
|
|
27
|
-
const
|
|
28
|
-
(
|
|
57
|
+
const R = (a, u, o = {}) => a.sort(
|
|
58
|
+
(n, y) => u === "asc" ? (o[n] ?? n).localeCompare(o[y] ?? y, "en", { numeric: !0 }) : (o[y] ?? y).localeCompare(o[n] ?? n, "en", { numeric: !0 })
|
|
29
59
|
);
|
|
30
|
-
function
|
|
31
|
-
|
|
60
|
+
function ne() {
|
|
61
|
+
return {
|
|
32
62
|
meta: {
|
|
33
|
-
facetKeys:
|
|
34
|
-
xGroupKeys:
|
|
35
|
-
yGroupKeys:
|
|
63
|
+
facetKeys: [],
|
|
64
|
+
xGroupKeys: [],
|
|
65
|
+
yGroupKeys: [],
|
|
36
66
|
xKeysByGroups: {},
|
|
37
67
|
yKeysByGroups: {},
|
|
38
68
|
xLabels: {},
|
|
@@ -41,104 +71,168 @@ function se(l, o, s, m, c, B, E, j, O, k, d, F, K, H, J) {
|
|
|
41
71
|
yGroupLabels: {},
|
|
42
72
|
xDataByKeys: {},
|
|
43
73
|
yDataByKeys: {},
|
|
44
|
-
facetKeyValues:
|
|
45
|
-
xGroupKeyValues:
|
|
46
|
-
yGroupKeyValues:
|
|
74
|
+
facetKeyValues: {},
|
|
75
|
+
xGroupKeyValues: {},
|
|
76
|
+
yGroupKeyValues: {},
|
|
47
77
|
valueExtent: [1 / 0, -1 / 0]
|
|
48
78
|
},
|
|
49
79
|
facets: {}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function re(a, u, o, n, y) {
|
|
83
|
+
if (u.x || u.y) {
|
|
84
|
+
const v = [1 / 0, -1 / 0];
|
|
85
|
+
a.meta.facetKeys.forEach((m) => {
|
|
86
|
+
const { xKeys: L, yKeys: M, cells: V, xKeysByGroups: g, yKeysByGroups: G } = a.facets[m], c = u.x ? g : L.reduce((e, r) => (e[r] = [r], e), {}), b = u.y ? G : M.reduce((e, r) => (e[r] = [r], e), {}), d = Object.keys(c), D = Object.keys(b);
|
|
87
|
+
for (const e of d)
|
|
88
|
+
for (const r of D) {
|
|
89
|
+
const B = [];
|
|
90
|
+
if (c[e].forEach((K) => {
|
|
91
|
+
b[r].forEach((C) => {
|
|
92
|
+
var p, S, _;
|
|
93
|
+
const j = (S = (p = V[K]) == null ? void 0 : p[C]) == null ? void 0 : S.value;
|
|
94
|
+
j !== void 0 && (B.push(j), (_ = V[K]) == null || delete _[C]);
|
|
95
|
+
});
|
|
96
|
+
}), B.length > 0) {
|
|
97
|
+
const K = k(u.method, B);
|
|
98
|
+
a.facets[m].cells[e] || (a.facets[m].cells[e] = {}), a.facets[m].cells[e][r] = {
|
|
99
|
+
isCell: !0,
|
|
100
|
+
idx: 0,
|
|
101
|
+
id: `${e}_${r}`,
|
|
102
|
+
x: e,
|
|
103
|
+
y: r,
|
|
104
|
+
value: K,
|
|
105
|
+
normalizedValue: K
|
|
106
|
+
}, v[0] = Math.min(K, v[0]), v[1] = Math.max(K, v[1]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
u.x && d.forEach((e) => {
|
|
110
|
+
o.forEach((r) => {
|
|
111
|
+
const B = y.find((p) => p.valueColumn.value === r || p.valueColumn.valueLabels === r);
|
|
112
|
+
if (!B)
|
|
113
|
+
return;
|
|
114
|
+
const K = [];
|
|
115
|
+
c[e].forEach((p) => {
|
|
116
|
+
K.push(a.meta.xDataByKeys[r][p]), delete a.meta.xDataByKeys[r][p];
|
|
117
|
+
});
|
|
118
|
+
const C = B.type === "continuous" ? k(u.method, K) : Q(K);
|
|
119
|
+
a.meta.xDataByKeys[r][e] = C;
|
|
120
|
+
});
|
|
121
|
+
}), u.y && (n.forEach((e) => {
|
|
122
|
+
a.meta.yDataByKeys[e] = {};
|
|
123
|
+
}), D.forEach((e) => {
|
|
124
|
+
n.forEach((r) => {
|
|
125
|
+
const B = y.find((p) => p.valueColumn.value === r || p.valueColumn.valueLabels === r);
|
|
126
|
+
if (!B)
|
|
127
|
+
return;
|
|
128
|
+
const K = [];
|
|
129
|
+
b[e].forEach((p) => {
|
|
130
|
+
K.push(a.meta.yDataByKeys[r][p]), delete a.meta.yDataByKeys[r][p];
|
|
131
|
+
});
|
|
132
|
+
const C = B.type === "continuous" ? k(u.method, K) : Q(K);
|
|
133
|
+
a.meta.yDataByKeys[r][e] = C;
|
|
134
|
+
});
|
|
135
|
+
})), u.x && (a.facets[m].xKeys = Object.keys(g), a.facets[m].xKeysByGroups = { null: a.facets[m].xKeys }, a.meta.xLabels = a.meta.xGroupLabels, a.meta.xGroupKeys = ["null"], a.meta.xGroupKeyValues = { null: ["null"] }), u.y && (a.facets[m].yKeys = Object.keys(G), a.facets[m].yKeysByGroups = { null: a.facets[m].yKeys }, a.meta.yLabels = a.meta.yGroupLabels, a.meta.yGroupKeys = ["null"], a.meta.yGroupKeyValues = { null: ["null"] });
|
|
136
|
+
}), a.meta.valueExtent = v;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function ye(a, u) {
|
|
140
|
+
if (u) {
|
|
141
|
+
const o = [1 / 0, -1 / 0];
|
|
142
|
+
a.meta.facetKeys.forEach((n) => {
|
|
143
|
+
const { xKeys: y, yKeys: v, cells: m } = a.facets[n], L = u.direction === "row" ? y : v, M = u.direction === "row" ? v : y, V = u.direction === "row" ? (g, G) => {
|
|
144
|
+
var c;
|
|
145
|
+
return (c = m[g]) == null ? void 0 : c[G];
|
|
146
|
+
} : (g, G) => {
|
|
147
|
+
var c;
|
|
148
|
+
return (c = m[G]) == null ? void 0 : c[g];
|
|
149
|
+
};
|
|
150
|
+
M.forEach((g) => {
|
|
151
|
+
const G = [];
|
|
152
|
+
L.forEach((b) => {
|
|
153
|
+
var d;
|
|
154
|
+
const D = (d = V(b, g)) == null ? void 0 : d.value;
|
|
155
|
+
D !== void 0 && G.push(D);
|
|
156
|
+
});
|
|
157
|
+
const c = se(u.method, G);
|
|
158
|
+
L.forEach((b) => {
|
|
159
|
+
const d = V(b, g);
|
|
160
|
+
d !== void 0 && (d.normalizedValue = c(d.value), o[0] = Math.min(d.normalizedValue, o[0]), o[1] = Math.max(d.normalizedValue, o[1]));
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}), a.meta.valueExtent = o;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function pe(a, u, o, n, y, v, m, L, M, V, g, G, c, b, d, D) {
|
|
167
|
+
const e = ne(), r = y.length ? y.map((t) => c[t.value] ?? a.getColumnCategories(t.value)) : [["null"]], B = v.length ? v.map((t) => c[t.value] ?? a.getColumnCategories(t.value)) : [["null"]], K = m.length ? m.map((t) => c[t.value] ?? a.getColumnCategories(t.value)) : [["null"]], C = I(r), p = I(B), S = I(K), _ = C.map((t) => t.join("_")), j = p.map((t) => t.join("_")), O = S.map((t) => t.join("_"));
|
|
168
|
+
e.meta.facetKeys = _, e.meta.xGroupKeys = j, e.meta.yGroupKeys = O, e.meta.facetKeyValues = _.reduce((t, l, f) => (t[l] = C[f], t), {}), e.meta.xGroupKeyValues = j.reduce((t, l, f) => (t[l] = p[f], t), {}), e.meta.yGroupKeyValues = O.reduce((t, l, f) => (t[l] = S[f], t), {});
|
|
169
|
+
const U = u.valueLabels ?? u.value, A = o.valueLabels ?? o.value, T = L.filter((t) => t.axis === "x").map((t) => t.valueColumn.valueLabels ?? t.valueColumn.value), W = L.filter((t) => t.axis === "y").map((t) => t.valueColumn.valueLabels ?? t.valueColumn.value), Y = Object.values(M ?? {}).map((t) => t.value), Z = Object.values(V ?? {}).map((t) => t.value), F = h.uniq([...T, ...Y, U]), H = h.uniq([...W, ...Z, A]);
|
|
170
|
+
for (let t = 0; t < a.rowsCount; t++) {
|
|
171
|
+
const l = y.length ? y.map((s) => a.getColumnValue(s.value, t)).join("_") : "null", f = v.length ? v.map((s) => a.getColumnValue(s.value, t)).join("_") : "null", E = m.length ? m.map((s) => a.getColumnValue(s.value, t)).join("_") : "null", $ = v.length ? v.map((s) => a.getColumnValue(s.valueLabels ?? s.value, t)).join(", ") : "", X = m.length ? m.map((s) => a.getColumnValue(s.valueLabels ?? s.value, t)).join(", ") : "";
|
|
172
|
+
e.meta.xGroupLabels[f] = $, e.meta.yGroupLabels[E] = X;
|
|
173
|
+
const i = String(a.getColumnValue(u.value, t)), x = String(a.getColumnValue(o.value, t)), w = a.getColumnValue(n.value, t) ?? G;
|
|
174
|
+
if (i === "null" || x === "null" || w === null)
|
|
56
175
|
continue;
|
|
57
|
-
if (
|
|
176
|
+
if (e.facets[l] || (e.facets[l] = {
|
|
58
177
|
xKeys: [],
|
|
59
178
|
yKeys: [],
|
|
60
179
|
xKeysByGroups: {},
|
|
61
180
|
yKeysByGroups: {},
|
|
62
181
|
cells: {}
|
|
63
|
-
}),
|
|
64
|
-
throw Error(`More than 1 value for x=${
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
throw Error(`More than 1 x-label value for x=${
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
throw Error(`More than 1 y-label value for y=${
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
throw Error(`More than 1 value for x = ${
|
|
75
|
-
|
|
76
|
-
}),
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
throw Error(`More than 1 value for y = ${
|
|
80
|
-
|
|
81
|
-
}),
|
|
182
|
+
}), e.facets[l].xKeysByGroups[f] || (e.facets[l].xKeysByGroups[f] = []), e.facets[l].yKeysByGroups[E] || (e.facets[l].yKeysByGroups[E] = []), e.facets[l].xKeys.push(i), e.facets[l].yKeys.push(x), e.facets[l].xKeysByGroups[f].push(i), e.facets[l].yKeysByGroups[E].push(x), e.facets[l].cells[i] || (e.facets[l].cells[i] = {}), e.meta.valueExtent[0] = Math.min(w, e.meta.valueExtent[0]), e.meta.valueExtent[1] = Math.max(w, e.meta.valueExtent[1]), e.facets[l].cells[i][x] && e.facets[l].cells[i][x].value !== w)
|
|
183
|
+
throw Error(`More than 1 value for x=${i}, y=${x}`);
|
|
184
|
+
const J = a.getColumnValue(U, t);
|
|
185
|
+
if (e.meta.xLabels[i] && String(J) !== e.meta.xLabels[i])
|
|
186
|
+
throw Error(`More than 1 x-label value for x=${i}`);
|
|
187
|
+
const P = a.getColumnValue(A, t);
|
|
188
|
+
if (e.meta.yLabels[x] && String(P) !== e.meta.yLabels[x])
|
|
189
|
+
throw Error(`More than 1 y-label value for y=${x}`);
|
|
190
|
+
e.meta.xLabels[i] = String(J), e.meta.yLabels[x] = String(P), F.forEach((s) => {
|
|
191
|
+
const q = typeof e.meta.xDataByKeys[s] < "u", z = q && typeof e.meta.xDataByKeys[s][i] < "u";
|
|
192
|
+
if (q || (e.meta.xDataByKeys[s] = {}), z && e.meta.xDataByKeys[s][i] !== a.getColumnValue(s, t))
|
|
193
|
+
throw Error(`More than 1 value for x = ${i} and column = ${s}`);
|
|
194
|
+
z || (e.meta.xDataByKeys[s][i] = a.getColumnValue(s, t));
|
|
195
|
+
}), H.forEach((s) => {
|
|
196
|
+
const q = typeof e.meta.yDataByKeys[s] < "u", z = q && typeof e.meta.yDataByKeys[s][x] < "u";
|
|
197
|
+
if (q || (e.meta.yDataByKeys[s] = {}), z && e.meta.yDataByKeys[s][x] !== a.getColumnValue(s, t))
|
|
198
|
+
throw Error(`More than 1 value for y = ${x} and column = ${s}`);
|
|
199
|
+
z || (e.meta.yDataByKeys[s][x] = a.getColumnValue(s, t));
|
|
200
|
+
}), e.facets[l].cells[i][x] = {
|
|
82
201
|
isCell: !0,
|
|
83
|
-
idx:
|
|
84
|
-
id: `${
|
|
85
|
-
x:
|
|
86
|
-
y,
|
|
87
|
-
value:
|
|
88
|
-
normalizedValue:
|
|
202
|
+
idx: t,
|
|
203
|
+
id: `${i}_${x}`,
|
|
204
|
+
x: i,
|
|
205
|
+
y: x,
|
|
206
|
+
value: w,
|
|
207
|
+
normalizedValue: w
|
|
89
208
|
};
|
|
90
209
|
}
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
210
|
+
return e.meta.facetKeys = e.meta.facetKeys.filter((t) => e.facets[t]), e.meta.facetKeys.forEach((t) => {
|
|
211
|
+
const l = e.facets[t], f = h.uniq(l.xKeys), E = h.uniq(l.yKeys);
|
|
212
|
+
l.xKeys = c[u.value] ? h.intersection(c[u.value], f) : f, l.yKeys = c[o.value] ? h.intersection(c[o.value], E) : E, j.forEach(($) => {
|
|
213
|
+
e.facets[t].xKeysByGroups[$] = h.intersection(
|
|
214
|
+
l.xKeys,
|
|
215
|
+
e.facets[t].xKeysByGroups[$]
|
|
97
216
|
);
|
|
98
|
-
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
217
|
+
}), O.forEach(($) => {
|
|
218
|
+
e.facets[t].yKeysByGroups[$] = h.intersection(
|
|
219
|
+
l.yKeys,
|
|
220
|
+
e.facets[t].yKeysByGroups[$]
|
|
102
221
|
);
|
|
103
222
|
});
|
|
104
|
-
}),
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const x = [];
|
|
116
|
-
L.forEach((u) => {
|
|
117
|
-
var f;
|
|
118
|
-
const G = (f = y(u, p)) == null ? void 0 : f.value;
|
|
119
|
-
G !== void 0 && x.push(G);
|
|
120
|
-
});
|
|
121
|
-
const h = ae(d.method, x);
|
|
122
|
-
L.forEach((u) => {
|
|
123
|
-
const f = y(u, p);
|
|
124
|
-
f !== void 0 && (f.normalizedValue = h(f.value), e[0] = Math.min(f.normalizedValue, e[0]), e[1] = Math.max(f.normalizedValue, e[1]));
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
}), a.meta.valueExtent = e;
|
|
128
|
-
}
|
|
129
|
-
return a.meta.xKeysByGroups = V.reduce((e, t) => {
|
|
130
|
-
const r = q(v.uniq(
|
|
131
|
-
v.flatten(a.meta.facetKeys.map((i) => a.facets[i].xKeysByGroups[t]))
|
|
132
|
-
), H.sorting, a.meta.xLabels);
|
|
133
|
-
return e[t] = K[o.value] ? v.intersection(K[o.value], r) : r, e;
|
|
134
|
-
}, {}), a.meta.yKeysByGroups = C.reduce((e, t) => {
|
|
135
|
-
const r = q(v.uniq(
|
|
136
|
-
v.flatten(a.meta.facetKeys.map((i) => a.facets[i].yKeysByGroups[t]))
|
|
137
|
-
), J.sorting, a.meta.yLabels);
|
|
138
|
-
return e[t] = K[s.value] ? v.intersection(K[s.value], r) : r, e;
|
|
139
|
-
}, {}), a.meta.valueExtent[0] === 1 / 0 && (a.meta.valueExtent[0] = 0), a.meta.valueExtent[1] === -1 / 0 && (a.meta.valueExtent[1] = 0), a;
|
|
223
|
+
}), re(e, D, F, H, L), ye(e, g), e.meta.xKeysByGroups = e.meta.xGroupKeys.reduce((t, l) => {
|
|
224
|
+
const f = R(h.uniq(
|
|
225
|
+
h.flatten(e.meta.facetKeys.map((E) => e.facets[E].xKeysByGroups[l]))
|
|
226
|
+
), b.sorting, e.meta.xLabels);
|
|
227
|
+
return t[l] = c[u.value] ? h.intersection(c[u.value], f) : f, t;
|
|
228
|
+
}, {}), e.meta.yKeysByGroups = e.meta.yGroupKeys.reduce((t, l) => {
|
|
229
|
+
const f = R(h.uniq(
|
|
230
|
+
h.flatten(e.meta.facetKeys.map((E) => e.facets[E].yKeysByGroups[l]))
|
|
231
|
+
), d.sorting, e.meta.yLabels);
|
|
232
|
+
return t[l] = c[o.value] ? h.intersection(c[o.value], f) : f, t;
|
|
233
|
+
}, {}), e.meta.valueExtent[0] === 1 / 0 && (e.meta.valueExtent[0] = 0), e.meta.valueExtent[1] === -1 / 0 && (e.meta.valueExtent[1] = 0), e;
|
|
140
234
|
}
|
|
141
235
|
export {
|
|
142
|
-
|
|
236
|
+
pe as getCells
|
|
143
237
|
};
|
|
144
238
|
//# sourceMappingURL=getCells.js.map
|