@centreon/ui 24.4.1-MON-34377-implement-tree-chart-on-centreon-ui.5 → 24.4.1-MON-34377-implement-tree-chart-on-centreon-ui.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "24.4.1-MON-34377-implement-tree-chart-on-centreon-ui.5",
3
+ "version": "24.4.1-MON-34377-implement-tree-chart-on-centreon-ui.6",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -29,13 +29,16 @@ const Minimap = ({
29
29
  zoom
30
30
  });
31
31
 
32
+ const finalHeight = Math.max(contentClientRect?.height || 0, height);
33
+ const finalWidth = Math.max(contentClientRect?.width || 0, width);
34
+
32
35
  return (
33
36
  <g className={classes.minimap} clipPath="url(#zoom-clip)">
34
37
  <rect
35
38
  className={classes.minimapBackground}
36
- height={Math.max(contentClientRect?.height || 0, height)}
39
+ height={finalHeight}
37
40
  rx={radius}
38
- width={Math.max(contentClientRect?.width || 0, width)}
41
+ width={finalWidth}
39
42
  />
40
43
  {children}
41
44
  <rect
@@ -49,9 +52,9 @@ const Minimap = ({
49
52
  <rect
50
53
  data-testid="minimap-interaction"
51
54
  fill="transparent"
52
- height={Math.max(contentClientRect?.height || 0, height)}
55
+ height={finalHeight}
53
56
  rx={radius}
54
- width={Math.max(contentClientRect?.width || 0, width)}
57
+ width={finalWidth}
55
58
  onMouseDown={transformTo}
56
59
  onMouseMove={move}
57
60
  onWheel={zoomInOut}
@@ -4,7 +4,6 @@ import type {
4
4
  TouchEvent as ReactTouchEvent
5
5
  } from 'react';
6
6
 
7
- import { has } from 'ramda';
8
7
  import { Point } from '@visx/point';
9
8
 
10
9
  type EventType =
@@ -44,16 +43,7 @@ const getXAndYFromEvent = (event?: EventType): PointCoords => {
44
43
  };
45
44
  }
46
45
 
47
- const boundingClientRect = has('getBoundingClientRect', event.target)
48
- ? event.target.getBoundingClientRect()
49
- : null;
50
-
51
- if (!boundingClientRect) return { ...DEFAULT_POINT };
52
-
53
- return {
54
- x: boundingClientRect.x + boundingClientRect.width / 2,
55
- y: boundingClientRect.y + boundingClientRect.height / 2
56
- };
46
+ return { ...DEFAULT_POINT };
57
47
  };
58
48
 
59
49
  export const localPoint = (event: EventType): PointCoords | null => {