@milaboratories/graph-maker 1.1.156 → 1.1.158

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.
Files changed (71) hide show
  1. package/dist/GraphMaker/components/Chart.vue.d.ts.map +1 -1
  2. package/dist/GraphMaker/components/Chart.vue.js +20 -16
  3. package/dist/GraphMaker/components/Chart.vue.js.map +1 -1
  4. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts.map +1 -1
  5. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js +24 -23
  6. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js.map +1 -1
  7. package/dist/GraphMaker/constantsCommon.d.ts +1 -0
  8. package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
  9. package/dist/GraphMaker/constantsCommon.js +17 -16
  10. package/dist/GraphMaker/constantsCommon.js.map +1 -1
  11. package/dist/GraphMaker/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.d.ts.map +1 -1
  12. package/dist/GraphMaker/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.js +104 -93
  13. package/dist/GraphMaker/forms/AxesSettingsForm/HeatmapAxesSettingsForm.vue.js.map +1 -1
  14. package/dist/GraphMaker/index.vue.js +33 -33
  15. package/dist/GraphMaker/index.vue.js.map +1 -1
  16. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +1 -0
  17. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
  18. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js +11 -11
  19. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js.map +1 -1
  20. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +136 -135
  21. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
  22. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js +2 -2
  23. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
  24. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +115 -107
  25. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
  26. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/AnnotationCellsCanvas.js +99 -0
  27. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/AnnotationCellsCanvas.js.map +1 -0
  28. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/AnnotationCellsSvg.js +57 -0
  29. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/AnnotationCellsSvg.js.map +1 -0
  30. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/index.js +43 -43
  31. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/index.js.map +1 -1
  32. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/CanvasCells.js +85 -0
  33. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/CanvasCells.js.map +1 -0
  34. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Captions/AxisCaptions.js +5 -5
  35. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Captions/GroupCaptions.js +16 -16
  36. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +191 -197
  37. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
  38. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +29 -27
  39. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js.map +1 -1
  40. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/SvgCells.js +38 -0
  41. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/SvgCells.js.map +1 -0
  42. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/tooltipUtils.js +44 -0
  43. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/tooltipUtils.js.map +1 -0
  44. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/constants.js +16 -15
  45. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/constants.js.map +1 -1
  46. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +63 -66
  47. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
  48. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +64 -62
  49. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
  50. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateChartSideElementSizes.js +9 -9
  51. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/ChartsGroup.js +14 -14
  52. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +5 -4
  53. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js.map +1 -1
  54. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +10 -8
  55. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +1 -1
  56. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +21 -21
  57. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +19 -19
  58. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +8 -8
  59. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +9 -9
  60. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +7 -7
  61. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js +2 -2
  62. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js.map +1 -1
  63. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +59 -57
  64. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -1
  65. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/components/PlDataTable.js.map +1 -1
  66. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js +13 -13
  67. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +137 -133
  68. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -1
  69. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +74 -74
  70. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
  71. package/package.json +3 -3
@@ -1,97 +1,97 @@
1
1
  import { j as i } from "../../../node_modules/react/jsx-runtime.js";
2
2
  import { Annotation as p } from "./Annotation.js";
3
3
  import { ANNOTATION_WIDTH as y, ANNOTATIONS_OFFSET as m } from "../../constants.js";
4
- function u(n, o) {
5
- return n.showTitle && o.includes(n.titlePosition);
4
+ function u(s, o) {
5
+ return s.showTitle && o.includes(s.titlePosition);
6
6
  }
7
- function W({
8
- facetKey: n,
7
+ function F({
8
+ facetKey: s,
9
9
  sideElementBBoxes: o,
10
10
  annotations: x,
11
- annotationColorScales: s,
11
+ annotationColorScales: n,
12
12
  cellsMeta: f,
13
- chartEdgeSides: e,
13
+ chartEdgeSides: a,
14
14
  sharedX: h,
15
15
  sharedY: K,
16
16
  width: T,
17
- height: v,
18
- scales: g,
17
+ height: g,
18
+ scales: v,
19
19
  stepX: B,
20
20
  stepY: G,
21
21
  aes: S,
22
22
  frame: w,
23
- xGroupKeys: C,
24
- yGroupKeys: N,
25
- xKeysByGroups: j,
26
- yKeysByGroups: A,
23
+ xGroupKeys: N,
24
+ yGroupKeys: j,
25
+ xKeysByGroups: A,
26
+ yKeysByGroups: C,
27
27
  tooltipsData: D,
28
- activeElementContainer: E
28
+ cellsRenderingMode: O
29
29
  }) {
30
- const l = x.filter((t) => e.includes(t.position) || !h && ["left", "right"].includes(t.position) || !K && ["top", "bottom"].includes(t.position)), O = l.filter((t) => t.position === "left"), b = l.filter((t) => t.position === "right"), I = l.filter((t) => t.position === "top"), X = l.filter((t) => t.position === "bottom"), { xDataByKeys: c, yDataByKeys: d } = f, r = {
31
- facetKey: n,
32
- scales: g,
30
+ const l = x.filter((t) => a.includes(t.position) || !h && ["left", "right"].includes(t.position) || !K && ["top", "bottom"].includes(t.position)), b = l.filter((t) => t.position === "left"), E = l.filter((t) => t.position === "right"), I = l.filter((t) => t.position === "top"), M = l.filter((t) => t.position === "bottom"), { xDataByKeys: d, yDataByKeys: c } = f, r = {
31
+ facetKey: s,
32
+ scales: v,
33
33
  stepX: B,
34
34
  stepY: G,
35
35
  width: T,
36
- height: v,
36
+ height: g,
37
37
  aes: S,
38
38
  frame: w,
39
- xGroupKeys: C,
40
- yGroupKeys: N,
41
- xKeysByGroups: j,
42
- yKeysByGroups: A,
39
+ xGroupKeys: N,
40
+ yGroupKeys: j,
41
+ xKeysByGroups: A,
42
+ yKeysByGroups: C,
43
43
  tooltipsData: D,
44
- activeElementContainer: E
44
+ cellsRenderingMode: O
45
45
  };
46
46
  return /* @__PURE__ */ i.jsxs("g", { children: [
47
- O.map((t, a) => /* @__PURE__ */ i.jsx(
47
+ b.map((t, e) => /* @__PURE__ */ i.jsx(
48
48
  p,
49
49
  {
50
50
  annotation: t,
51
- colorScale: s[t.id],
52
- data: d[t.valueColumn.value],
53
- showTitle: u(t, e),
54
- x: o.left.annotations.x + a * y,
51
+ colorScale: n[t.id],
52
+ data: c[t.valueColumn.value],
53
+ showTitle: u(t, a),
54
+ x: o.left.annotations.x + e * y,
55
55
  y: o.left.annotations.y,
56
56
  ...r
57
57
  },
58
58
  t.id
59
59
  )),
60
- b.map((t, a) => /* @__PURE__ */ i.jsx(
60
+ E.map((t, e) => /* @__PURE__ */ i.jsx(
61
61
  p,
62
62
  {
63
63
  annotation: t,
64
- colorScale: s[t.id],
65
- data: d[t.valueColumn.value],
66
- showTitle: u(t, e),
67
- x: o.right.annotations.x + a * y + m,
64
+ colorScale: n[t.id],
65
+ data: c[t.valueColumn.value],
66
+ showTitle: u(t, a),
67
+ x: o.right.annotations.x + e * y + m,
68
68
  y: o.right.annotations.y,
69
69
  ...r
70
70
  },
71
71
  t.id
72
72
  )),
73
- I.map((t, a) => /* @__PURE__ */ i.jsx(
73
+ I.map((t, e) => /* @__PURE__ */ i.jsx(
74
74
  p,
75
75
  {
76
76
  annotation: t,
77
- colorScale: s[t.id],
78
- data: c[t.valueColumn.value],
79
- showTitle: u(t, e),
77
+ colorScale: n[t.id],
78
+ data: d[t.valueColumn.value],
79
+ showTitle: u(t, a),
80
80
  x: o.top.annotations.x,
81
- y: o.top.annotations.y + a * y,
81
+ y: o.top.annotations.y + e * y,
82
82
  ...r
83
83
  },
84
84
  t.id
85
85
  )),
86
- X.map((t, a) => /* @__PURE__ */ i.jsx(
86
+ M.map((t, e) => /* @__PURE__ */ i.jsx(
87
87
  p,
88
88
  {
89
89
  annotation: t,
90
- colorScale: s[t.id],
91
- data: c[t.valueColumn.value],
92
- showTitle: u(t, e),
90
+ colorScale: n[t.id],
91
+ data: d[t.valueColumn.value],
92
+ showTitle: u(t, a),
93
93
  x: o.bottom.annotations.x,
94
- y: o.bottom.annotations.y + a * y + m,
94
+ y: o.bottom.annotations.y + e * y + m,
95
95
  ...r
96
96
  },
97
97
  t.id
@@ -99,6 +99,6 @@ function W({
99
99
  ] });
100
100
  }
101
101
  export {
102
- W as Annotations
102
+ F as Annotations
103
103
  };
104
104
  //# sourceMappingURL=index.js.map
@@ -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 activeElementContainer?: Element;\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 activeElementContainer\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 activeElementContainer\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","activeElementContainer","usedAnnotations","leftAnnotations","rightAnnotations","topAnnotations","bottomAnnotations","xDataByKeys","yDataByKeys","commonProps","i","idx","jsx","Annotation","ANNOTATION_WIDTH","ANNOTATIONS_OFFSET"],"mappings":";;;AAcA,SAASA,EAAUC,GAA6CC,GAAuD;AACnH,SAAOD,EAAK,aAAaC,EAAe,SAASD,EAAK,aAAa;AACvE;AA0BO,SAASE,EAAY;AAAA,EACxB,UAAAC;AAAAA,EACA,mBAAAC;AAAAA,EACA,aAAAC;AAAAA,EACA,uBAAAC;AAAAA,EACA,WAAAC;AAAAA,EACA,gBAAAN;AAAAA,EACA,SAAAO;AAAAA,EACA,SAAAC;AAAAA,EACA,OAAAC;AAAAA,EACA,QAAAC;AAAAA,EACA,QAAAC;AAAAA,EACA,OAAAC;AAAAA,EACA,OAAAC;AAAAA,EACA,KAAAC;AAAAA,EACA,OAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA,eAAAC;AAAAA,EACA,eAAAC;AAAAA,EACA,cAAAC;AAAAA,EACA,wBAAAC;AACJ,GAAoB;AAChB,QAAMC,IAAkBlB,EAAY,OAAO,CAAAL,MAEnCC,EAAe,SAASD,EAAK,QAAQ,KACpC,CAACQ,KAAW,CAAC,QAAQ,OAAO,EAAE,SAASR,EAAK,QAAQ,KACpD,CAACS,KAAW,CAAC,OAAO,QAAQ,EAAE,SAAST,EAAK,QAAQ,CAE5D,GACKwB,IAAkBD,EAAgB,OAAO,CAAAvB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AAAA,QACxC,WAAWD,EAAUC,GAAMC,CAAc;AAAA,QACzC,GAAGG,EAAkB,MAAM,YAAY,IAAI4B,IAAMG,IAAmBC;AAAAA,QACpE,GAAGhC,EAAkB,MAAM,YAAY;AAAA,QACtC,GAAG0B;AAAAA,MAAA;AAAA,MAPC9B,EAAK;AAAA,IAAA,CAUrB;AAAA,IACA0B,EAAe,IAAI,CAAC1B,GAAMgC,MAEnBC,gBAAAA,EAAAA;AAAAA,MAACC;AAAAA,MAAA;AAAA,QAEG,YAAYlC;AAAAA,QACZ,YAAYM,EAAsBN,EAAK,EAAE;AAAA,QACzC,MAAM4B,EAAY5B,EAAK,YAAY,KAAK;AAAA,QACxC,WAAWD,EAAUC,GAAMC,CAAc;AAAA,QACzC,GAAGG,EAAkB,IAAI,YAAY;AAAA,QACrC,GAAGA,EAAkB,IAAI,YAAY,IAAI4B,IAAMG;AAAAA,QAC9C,GAAGL;AAAAA,MAAA;AAAA,MAPC9B,EAAK;AAAA,IAAA,CAUrB;AAAA,IACA2B,EAAkB,IAAI,CAAC3B,GAAMgC,MAEtBC,gBAAAA,EAAAA;AAAAA,MAACC;AAAAA,MAAA;AAAA,QAEG,YAAYlC;AAAAA,QACZ,YAAYM,EAAsBN,EAAK,EAAE;AAAA,QACzC,MAAM4B,EAAY5B,EAAK,YAAY,KAAK;AAAA,QACxC,WAAWD,EAAUC,GAAMC,CAAc;AAAA,QACzC,GAAGG,EAAkB,OAAO,YAAY;AAAA,QACxC,GAAGA,EAAkB,OAAO,YAAY,IAAI4B,IAAMG,IAAmBC;AAAAA,QACpE,GAAGN;AAAAA,MAAA;AAAA,MAPC9B,EAAK;AAAA,IAAA,CAUrB;AAAA,EAAA,GACL;AAER;","x_google_ignoreList":[0]}
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","i","idx","jsx","Annotation","ANNOTATION_WIDTH","ANNOTATIONS_OFFSET"],"mappings":";;;AAcA,SAASA,EAAUC,GAA6CC,GAAuD;AACnH,SAAOD,EAAK,aAAaC,EAAe,SAASD,EAAK,aAAa;AACvE;AA0BO,SAASE,EAAY;AAAA,EACxB,UAAAC;AAAAA,EACA,mBAAAC;AAAAA,EACA,aAAAC;AAAAA,EACA,uBAAAC;AAAAA,EACA,WAAAC;AAAAA,EACA,gBAAAN;AAAAA,EACA,SAAAO;AAAAA,EACA,SAAAC;AAAAA,EACA,OAAAC;AAAAA,EACA,QAAAC;AAAAA,EACA,QAAAC;AAAAA,EACA,OAAAC;AAAAA,EACA,OAAAC;AAAAA,EACA,KAAAC;AAAAA,EACA,OAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA,eAAAC;AAAAA,EACA,eAAAC;AAAAA,EACA,cAAAC;AAAAA,EACA,oBAAAC;AACJ,GAAoB;AAChB,QAAMC,IAAkBlB,EAAY,OAAO,CAAAL,MAEnCC,EAAe,SAASD,EAAK,QAAQ,KACpC,CAACQ,KAAW,CAAC,QAAQ,OAAO,EAAE,SAASR,EAAK,QAAQ,KACpD,CAACS,KAAW,CAAC,OAAO,QAAQ,EAAE,SAAST,EAAK,QAAQ,CAE5D,GACKwB,IAAkBD,EAAgB,OAAO,CAAAvB,MAAQA,EAAK,aAAa,MAAM,GACzEyB,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AAc;AAAA,QACzC,GAAGG,EAAkB,MAAM,YAAY,IAAI4B,IAAMG,IAAmBC;AAAAA,QACpE,GAAGhC,EAAkB,MAAM,YAAY;AAAA,QACtC,GAAG0B;AAAAA,MAAA;AAAA,MAPC9B,EAAK;AAAA,IAAA,CAUrB;AAAA,IACA0B,EAAe,IAAI,CAAC1B,GAAMgC,MAEnBC,gBAAAA,EAAAA;AAAAA,MAACC;AAAAA,MAAA;AAAA,QAEG,YAAYlC;AAAAA,QACZ,YAAYM,EAAsBN,EAAK,EAAE;AAAA,QACzC,MAAM4B,EAAY5B,EAAK,YAAY,KAAK;AAAA,QACxC,WAAWD,EAAUC,GAAMC,CAAc;AAAA,QACzC,GAAGG,EAAkB,IAAI,YAAY;AAAA,QACrC,GAAGA,EAAkB,IAAI,YAAY,IAAI4B,IAAMG;AAAAA,QAC9C,GAAGL;AAAAA,MAAA;AAAA,MAPC9B,EAAK;AAAA,IAAA,CAUrB;AAAA,IACA2B,EAAkB,IAAI,CAAC3B,GAAMgC,MAEtBC,gBAAAA,EAAAA;AAAAA,MAACC;AAAAA,MAAA;AAAA,QAEG,YAAYlC;AAAAA,QACZ,YAAYM,EAAsBN,EAAK,EAAE;AAAA,QACzC,MAAM4B,EAAY5B,EAAK,YAAY,KAAK;AAAA,QACxC,WAAWD,EAAUC,GAAMC,CAAc;AAAA,QACzC,GAAGG,EAAkB,OAAO,YAAY;AAAA,QACxC,GAAGA,EAAkB,OAAO,YAAY,IAAI4B,IAAMG,IAAmBC;AAAAA,QACpE,GAAGN;AAAAA,MAAA;AAAA,MAPC9B,EAAK;AAAA,IAAA,CAUrB;AAAA,EAAA,GACL;AAER;","x_google_ignoreList":[0]}
@@ -0,0 +1,85 @@
1
+ import { j as w } from "../../node_modules/react/jsx-runtime.js";
2
+ import { r as x } from "../../_virtual/index.js";
3
+ import { useFunction as K } from "../../utils/hooks/useFunction.js";
4
+ function L(e, t, s, o, n, r, v, g, h, d, m, u) {
5
+ var f;
6
+ if (e) {
7
+ e.beginPath(), e.clearRect(0, 0, m, u);
8
+ for (const a of o)
9
+ for (const i of n) {
10
+ const c = (f = s == null ? void 0 : s[a]) == null ? void 0 : f[i];
11
+ if (!c)
12
+ continue;
13
+ const p = t.x(a), l = t.y(i);
14
+ e.fillStyle = c.value === null ? h : d(c.normalizedValue), e.fillRect(p, l, r, v);
15
+ }
16
+ }
17
+ }
18
+ function S(e, t, s) {
19
+ let o = 0, n = e.length - 1;
20
+ for (; o <= n; ) {
21
+ const r = Math.floor((o + n) / 2);
22
+ if (Math.abs(e[r] - t) < s)
23
+ return e[r] >= t ? r - 1 : r;
24
+ t < e[r] ? n = r - 1 : o = r + 1;
25
+ }
26
+ return -1;
27
+ }
28
+ function C(e, t, s, o) {
29
+ const n = S(t, e, o);
30
+ return n === -1 ? -1 : s[n];
31
+ }
32
+ function X({
33
+ width: e,
34
+ height: t,
35
+ facetKey: s,
36
+ scales: o,
37
+ cells: n,
38
+ xKeys: r,
39
+ yKeys: v,
40
+ stepX: g,
41
+ stepY: h,
42
+ aes: d,
43
+ colorScale: m,
44
+ tooltipsData: u
45
+ }) {
46
+ const f = x.useRef(null), a = window.devicePixelRatio || 1, i = x.useRef(null), c = () => {
47
+ L(
48
+ i.current,
49
+ o,
50
+ n,
51
+ r,
52
+ v,
53
+ g,
54
+ h,
55
+ d.cellStrokeColor,
56
+ d.emptyCellColor,
57
+ m,
58
+ e,
59
+ t
60
+ );
61
+ };
62
+ x.useEffect(() => {
63
+ const l = f.current;
64
+ i.current || (i.current = (l == null ? void 0 : l.getContext("2d")) ?? null), l && i.current && (l.style.width = e + "px", l.style.height = t + "px", i.current.scale(a, a)), c();
65
+ }, [e, t]), c();
66
+ const p = K((l) => {
67
+ var y;
68
+ const R = l.nativeEvent.offsetX, E = l.nativeEvent.offsetY, b = C(R, o.x.range(), o.x.domain(), g), j = C(E, o.y.range(), o.y.domain(), h), M = (y = n[b]) == null ? void 0 : y[j];
69
+ M ? u.onMouseEnter(M, s) : u.onMouseLeave();
70
+ });
71
+ return /* @__PURE__ */ w.jsx("foreignObject", { width: e, height: t, children: /* @__PURE__ */ w.jsx(
72
+ "canvas",
73
+ {
74
+ ref: f,
75
+ width: a * e,
76
+ height: a * t,
77
+ onMouseMove: p,
78
+ onMouseLeave: () => u.onMouseLeave()
79
+ }
80
+ ) });
81
+ }
82
+ export {
83
+ X as CanvasCells
84
+ };
85
+ //# sourceMappingURL=CanvasCells.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasCells.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/heatmap/components/CanvasCells.tsx"],"sourcesContent":["import type { Cell, GroupedCellsData } from '../getCells';\nimport type { AnnotationTooltipData, ChartScales } from './types';\nimport type { TooltipsData } from '../../common/Tooltip';\nimport type { HeatmapSettingsImpl } from '../HeatmapSettingsImpl';\nimport type { MouseEventHandler } from 'react';\nimport { useEffect, useRef } from 'react';\nimport { useFunction } from '../../utils/hooks/useFunction';\n\nfunction renderCells<T>(\n ctx: CanvasRenderingContext2D | null,\n scales: ChartScales,\n cells: GroupedCellsData['facets'][keyof GroupedCellsData['facets']]['cells'],\n xKeys: string[],\n yKeys: string[],\n stepX: number,\n stepY: number,\n strokeColor: string,\n emptyCellColor: string,\n colorScale: (value: T) => string,\n width: number,\n height: number\n) {\n if (!ctx) {\n return;\n }\n ctx.beginPath(); // Start a new path\n ctx.clearRect(0, 0, width, height);\n for (const xKey of xKeys) {\n for (const yKey of yKeys) {\n const cell = cells?.[xKey]?.[yKey];\n if (!cell) {\n continue;\n }\n const x = scales.x(xKey);\n const y = scales.y(yKey);\n ctx.fillStyle = cell.value === null ? emptyCellColor : colorScale(cell.normalizedValue as T),\n ctx.fillRect(x, y, stepX, stepY); // Add a rectangle to the current path\n }\n }\n}\n\nfunction binarySearch(arr: number[], val: number, step: number) {\n let start = 0;\n let end = arr.length - 1;\n\n while (start <= end) {\n const mid = Math.floor((start + end) / 2);\n if (Math.abs(arr[mid] - val) < step) {\n return arr[mid] >= val ? mid - 1 : mid;\n }\n\n if (val < arr[mid]) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n return -1;\n}\nfunction searchKey(px: number, positions: number[], keys: string[], step: number) {\n const pos = binarySearch(positions, px, step);\n if (pos === -1) {\n return -1;\n }\n return keys[pos];\n}\n\ninterface CanvasCellsProps<T> {\n width: number,\n height: number,\n facetKey: string,\n scales: ChartScales,\n cells: GroupedCellsData['facets'][keyof GroupedCellsData['facets']]['cells'],\n xKeys: string[],\n yKeys: string[],\n stepX: number,\n stepY: number,\n aes: HeatmapSettingsImpl['aes'];\n colorScale: (value: T) => string,\n tooltipsData: TooltipsData<Cell | AnnotationTooltipData>;\n}\n\nexport function CanvasCells<ValueType>({\n width,\n height,\n facetKey,\n scales,\n cells,\n xKeys,\n yKeys,\n stepX,\n stepY,\n aes,\n colorScale,\n tooltipsData,\n}: CanvasCellsProps<ValueType>) {\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n const canvasRatio = window.devicePixelRatio || 1;\n const ctx = useRef<CanvasRenderingContext2D | null>(null);\n const render = () => {\n renderCells<ValueType>(\n ctx.current,\n scales,\n cells,\n xKeys,\n yKeys, stepX, stepY,\n aes.cellStrokeColor,\n aes.emptyCellColor,\n colorScale,\n width,\n height\n );\n };\n useEffect(() => {\n const canvasEl = canvasRef.current;\n if (!ctx.current) {\n ctx.current = canvasEl?.getContext('2d') ?? null;\n }\n if (canvasEl && ctx.current) {\n canvasEl.style.width = width + 'px';\n canvasEl.style.height = height + 'px';\n ctx.current.scale(canvasRatio, canvasRatio);\n }\n render();\n }, [width, height]);\n render();\n\n const moveOnCanvas: MouseEventHandler<HTMLCanvasElement> = useFunction((e: React.MouseEvent) => {\n const x = e.nativeEvent.offsetX;\n const y = e.nativeEvent.offsetY;\n const xKey = searchKey(x, scales.x.range(), scales.x.domain(), stepX);\n const yKey = searchKey(y, scales.y.range(), scales.y.domain(), stepY);\n const activeCell = cells[xKey]?.[yKey];\n if (activeCell) {\n tooltipsData.onMouseEnter(activeCell, facetKey);\n } else {\n tooltipsData.onMouseLeave();\n }\n });\n\n return (\n <foreignObject width={width} height={height}>\n <canvas\n ref={canvasRef}\n width={canvasRatio * width}\n height={canvasRatio * height}\n onMouseMove={moveOnCanvas}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n />\n </foreignObject>\n );\n}"],"names":["renderCells","ctx","scales","cells","xKeys","yKeys","stepX","stepY","strokeColor","emptyCellColor","colorScale","width","height","xKey","yKey","cell","_a","x","y","binarySearch","arr","val","step","start","end","mid","searchKey","px","positions","keys","pos","CanvasCells","facetKey","aes","tooltipsData","canvasRef","useRef","canvasRatio","render","useEffect","canvasEl","moveOnCanvas","useFunction","e","activeCell","jsx"],"mappings":";;;AAQA,SAASA,EACLC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACF;;AACE,MAAKX,GAGL;AAAAA,MAAI,aACJA,EAAI,UAAU,GAAG,GAAGU,GAAOC,CAAM;AACjC,eAAWC,KAAQT;AACf,iBAAWU,KAAQT,GAAO;AACtB,cAAMU,KAAOC,IAAAb,KAAA,gBAAAA,EAAQU,CAAAA,MAAR,gBAAAG,EAAgBF,CAAAA;AAC7B,YAAI,CAACC;AACD;AAEJ,cAAME,IAAIf,EAAO,EAAEW,CAAI,GACjBK,IAAIhB,EAAO,EAAEY,CAAI;AACvBb,UAAI,YAAYc,EAAK,UAAU,OAAON,IAAiBC,EAAWK,EAAK,eAAoB,GACvFd,EAAI,SAASgB,GAAGC,GAAGZ,GAAOC,CAAK;AAAA,MACvC;AAAA,EAAA;AAER;AAEA,SAASY,EAAaC,GAAeC,GAAaC,GAAc;AAC5D,MAAIC,IAAQ,GACRC,IAAMJ,EAAI,SAAS;AAEvB,SAAOG,KAASC,KAAK;AACjB,UAAMC,IAAM,KAAK,OAAOF,IAAQC,KAAO,CAAC;AACxC,QAAI,KAAK,IAAIJ,EAAIK,CAAG,IAAIJ,CAAG,IAAIC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AAAA,EACJ,GAAG,CAAC3B,GAAOC,CAAM,CAAC,GAClB0B,EAAAA;AAEA,QAAMG,IAAqDC,EAAY,CAACC,MAAwB;;AAC5F,UAAM1B,IAAI0B,EAAE,YAAY,SAClBzB,IAAIyB,EAAE,YAAY,SAClB9B,IAAOa,EAAUT,GAAGf,EAAO,EAAE,MAAA,GAASA,EAAO,EAAE,UAAUI,CAAK,GAC9DQ,IAAOY,EAAUR,GAAGhB,EAAO,EAAE,MAAA,GAASA,EAAO,EAAE,UAAUK,CAAK,GAC9DqC,KAAa5B,IAAAb,EAAMU,CAAI,MAAV,gBAAAG,EAAcF,CAAAA;AAC7B8B,IAAAA,IACAV,EAAa,aAAaU,GAAYZ,CAAQ,IAE9CE,EAAa,aAAA;AAAA,EAErB,CAAC;AAED,SACIW,gBAAAA,EAAAA,IAAC,iBAAA,EAAc,OAAAlC,GAAc,QAAAC,GACzB,UAAAiC,gBAAAA,EAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKV;AAAAA,MACL,OAAOE,IAAc1B;AAAAA,MACrB,QAAQ0B,IAAczB;AAAAA,MACtB,aAAa6B;AAAAA,MACb,cAAc,MAAMP,EAAa,aAAA;AAAA,IAAA;AAAA,EAAa,GAEtD;AAER;","x_google_ignoreList":[0]}
@@ -1,6 +1,6 @@
1
1
  import { j as t } from "../../../node_modules/react/jsx-runtime.js";
2
2
  import { BLACK as a } from "../../../constants.js";
3
- import { DEFAULT_TICKS_SIZE as k, TICK_OFFSET as $ } from "../../constants.js";
3
+ import { DEFAULT_TICKS_SIZE as k, TICK_OFFSET as j } from "../../constants.js";
4
4
  function D({
5
5
  sideElementBBoxes: s,
6
6
  debug: f,
@@ -41,7 +41,7 @@ function D({
41
41
  ] }),
42
42
  C && /* @__PURE__ */ t.jsxs("g", { fontSize: "14px", transform: `translate(${h.x},${h.y})`, children: [
43
43
  L.map((r) => {
44
- const y = o.xAxisLabels !== 0, e = A.position === "bottom", d = e ? 0 : h.height, m = e ? d + V : d - V, b = e ? m + $ : m - $, l = w.x(r) + B / 2, c = -o.xAxisLabels, p = y ? e ? "end" : "start" : "middle";
44
+ const y = o.xAxisLabels !== 0, e = A.position === "bottom", d = e ? 0 : h.height, m = e ? d + V : d - V, b = e ? m + j : m - j, l = w.x(r) + B / 2, c = -o.xAxisLabels, p = y ? e ? "end" : "start" : "middle";
45
45
  return /* @__PURE__ */ t.jsxs("g", { children: [
46
46
  /* @__PURE__ */ t.jsx("line", { x1: l, x2: l, y1: d, y2: m, stroke: a }),
47
47
  /* @__PURE__ */ t.jsx(
@@ -90,10 +90,10 @@ function D({
90
90
  }
91
91
  ),
92
92
  F && /* @__PURE__ */ t.jsx("g", { fontSize: "14px", transform: `translate(${x.x},${x.y})`, children: u.map((r) => {
93
- const y = o.yAxisLabels !== 0, e = g.position === "left", d = -(90 - o.yAxisLabels), m = o.yAxisLabels === 0 ? "middle" : e ? "end" : "start", b = y ? "central" : e ? "auto" : "hanging", l = e ? x.width : 0, c = e ? l - T : l + T, p = e ? c - $ : c + $, j = w.y(r) + E / 2;
93
+ const y = o.yAxisLabels !== 0, e = g.position === "left", d = -(90 - o.yAxisLabels), m = o.yAxisLabels === 0 ? "middle" : e ? "end" : "start", b = y ? "central" : e ? "auto" : "hanging", l = e ? x.width : 0, c = e ? l - T : l + T, p = e ? c - j : c + j, $ = w.y(r) + E / 2;
94
94
  return /* @__PURE__ */ t.jsxs("g", { children: [
95
- /* @__PURE__ */ t.jsx("line", { x1: l, x2: c, y1: j, y2: j, stroke: a }),
96
- /* @__PURE__ */ t.jsx("text", { x: p, y: j, textAnchor: m, transform: `rotate(${d},${p},${j})`, dominantBaseline: b, children: S[r] })
95
+ /* @__PURE__ */ t.jsx("line", { x1: l, x2: c, y1: $, y2: $, stroke: a }),
96
+ /* @__PURE__ */ t.jsx("text", { x: p, y: $, textAnchor: m, transform: `rotate(${d},${p},${$})`, dominantBaseline: b, children: S[r] })
97
97
  ] }, r);
98
98
  }) }),
99
99
  f && /* @__PURE__ */ t.jsx(
@@ -1,6 +1,6 @@
1
- import { j as r } from "../../../node_modules/react/jsx-runtime.js";
1
+ import { j as e } from "../../../node_modules/react/jsx-runtime.js";
2
2
  import { TICK_OFFSET as h } from "../../constants.js";
3
- function I({
3
+ function P({
4
4
  sideElementBBoxes: s,
5
5
  xGroupKeys: G,
6
6
  yGroupKeys: $,
@@ -17,14 +17,14 @@ function I({
17
17
  debug: j
18
18
  }) {
19
19
  const L = s.top.groups.isVisible || s.bottom.groups.isVisible, l = s.top.groups.isVisible ? s.top.groups : s.bottom.groups, C = s.left.groups.isVisible || s.right.groups.isVisible, n = s.left.groups.isVisible ? s.left.groups : s.right.groups;
20
- return /* @__PURE__ */ r.jsxs("g", { children: [
21
- L && /* @__PURE__ */ r.jsx("g", { transform: `translate(${l.x},${l.y})`, children: G.map((t) => {
20
+ return /* @__PURE__ */ e.jsxs("g", { children: [
21
+ L && /* @__PURE__ */ e.jsx("g", { transform: `translate(${l.x},${l.y})`, children: G.map((t) => {
22
22
  const a = f[t].length;
23
23
  if (a === 0)
24
24
  return null;
25
- const e = b.xGroupLabels, o = e !== 0, g = K.groupingPosition === "top", p = a * B, i = y.x(f[t][0]) + p / 2, u = o ? g ? l.height : 0 : l.height / 2, x = -e, d = e === 45 ? 2 * h : e === 90 ? h : 0, c = o ? g ? "start" : "end" : "middle";
26
- return /* @__PURE__ */ r.jsxs("g", { transform: `translate(${i},${u + d})`, children: [
27
- /* @__PURE__ */ r.jsx(
25
+ const r = b.xGroupLabels, o = r !== 0, g = K.groupingPosition === "top", p = a * B, i = y.x(f[t][0]) + p / 2, u = o ? g ? l.height : 0 : l.height / 2, x = -r, d = r === 45 ? 2 * h : r === 90 ? h : 0, c = o ? g ? "start" : "end" : "middle";
26
+ return /* @__PURE__ */ e.jsxs("g", { transform: `translate(${i},${u + d})`, children: [
27
+ /* @__PURE__ */ e.jsx(
28
28
  "text",
29
29
  {
30
30
  transform: `rotate(${x})`,
@@ -33,7 +33,7 @@ function I({
33
33
  children: w[t]
34
34
  }
35
35
  ),
36
- j && /* @__PURE__ */ r.jsx(
36
+ j && /* @__PURE__ */ e.jsx(
37
37
  "rect",
38
38
  {
39
39
  x: -p / 2,
@@ -45,13 +45,13 @@ function I({
45
45
  )
46
46
  ] }, t);
47
47
  }) }),
48
- C && /* @__PURE__ */ r.jsx("g", { transform: `translate(${n.x},${n.y})`, children: $.map((t) => {
48
+ C && /* @__PURE__ */ e.jsx("g", { transform: `translate(${n.x},${n.y})`, children: $.map((t) => {
49
49
  const a = m[t].length;
50
50
  if (a === 0)
51
51
  return null;
52
- const e = a * V, o = k.groupingPosition === "left", g = o ? n.width : 0, p = y.y(m[t][0]) + e / 2, i = b.yGroupLabels, u = i !== 0, x = i === 45 ? -45 : (o ? -1 : 1) * (90 - i), d = i === 45 ? 2 * h : i === 90 ? h : 0, c = u ? o ? "end" : "start" : "middle";
53
- return /* @__PURE__ */ r.jsxs("g", { transform: `translate(${g - d},${p})`, children: [
54
- /* @__PURE__ */ r.jsx(
52
+ const r = a * V, o = k.groupingPosition === "left", g = o ? n.width : 0, p = y.y(m[t][0]) + r / 2, i = b.yGroupLabels, u = i !== 0, x = i === 45 ? -45 : (o ? -1 : 1) * (90 - i), d = i === 45 ? 2 * h : i === 90 ? h : 0, c = u ? o ? "end" : "start" : "middle";
53
+ return /* @__PURE__ */ e.jsxs("g", { transform: `translate(${g - d},${p})`, children: [
54
+ /* @__PURE__ */ e.jsx(
55
55
  "text",
56
56
  {
57
57
  y: u ? 0 : -n.width / 2,
@@ -61,13 +61,13 @@ function I({
61
61
  children: A[t]
62
62
  }
63
63
  ),
64
- j && /* @__PURE__ */ r.jsx(
64
+ j && /* @__PURE__ */ e.jsx(
65
65
  "rect",
66
66
  {
67
67
  x: -n.width / 2,
68
- y: -e / 2,
68
+ y: -r / 2,
69
69
  width: n.width,
70
- height: e,
70
+ height: r,
71
71
  stroke: "black",
72
72
  fill: "none"
73
73
  }
@@ -77,6 +77,6 @@ function I({
77
77
  ] });
78
78
  }
79
79
  export {
80
- I as GroupCaptions
80
+ P as GroupCaptions
81
81
  };
82
82
  //# sourceMappingURL=GroupCaptions.js.map