@cyber-harbour/ui 1.0.68 → 1.0.69
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/index.d.mts +0 -4
- package/dist/index.d.ts +0 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Graph2D/Graph2D.tsx +2 -7
- package/src/Graph2D/types.ts +0 -4
package/package.json
CHANGED
package/src/Graph2D/Graph2D.tsx
CHANGED
|
@@ -90,10 +90,8 @@ export const Graph2D: any = forwardRef<Graph2DRef, Graph2DProps>(
|
|
|
90
90
|
highlightLinks: new Set(),
|
|
91
91
|
lastMousePos: { x: 0, y: 0 },
|
|
92
92
|
mustBeStoppedPropagation: false,
|
|
93
|
-
lastHoveredNode: null,
|
|
94
93
|
mouseStartPos: null,
|
|
95
94
|
isDragging: false,
|
|
96
|
-
lastHoveredNodeRef: null,
|
|
97
95
|
width: width * RATIO,
|
|
98
96
|
height: height * RATIO,
|
|
99
97
|
});
|
|
@@ -1062,13 +1060,10 @@ export const Graph2D: any = forwardRef<Graph2DRef, Graph2DProps>(
|
|
|
1062
1060
|
const handleNodeHover = useCallback(
|
|
1063
1061
|
(node: NodeObject | null) => {
|
|
1064
1062
|
// Перевіряємо, чи вузол той самий, що і останній вузол, на який наводили
|
|
1065
|
-
if (node === stateRef.current.
|
|
1063
|
+
if (node === stateRef.current.hoveredNode) {
|
|
1066
1064
|
return; // Пропускаємо обробку, якщо це той самий вузол
|
|
1067
1065
|
}
|
|
1068
1066
|
|
|
1069
|
-
// Оновлюємо посилання на останній наведений вузол
|
|
1070
|
-
stateRef.current.lastHoveredNodeRef = node;
|
|
1071
|
-
|
|
1072
1067
|
const newHighlightNodes = new Set<NodeObject>();
|
|
1073
1068
|
const newHighlightLinks = new Set<any>();
|
|
1074
1069
|
|
|
@@ -1350,8 +1345,8 @@ export const Graph2D: any = forwardRef<Graph2DRef, Graph2DProps>(
|
|
|
1350
1345
|
|
|
1351
1346
|
if (shouldRenderLink) {
|
|
1352
1347
|
renderCanvas2D();
|
|
1348
|
+
return;
|
|
1353
1349
|
}
|
|
1354
|
-
return;
|
|
1355
1350
|
}
|
|
1356
1351
|
}
|
|
1357
1352
|
|
package/src/Graph2D/types.ts
CHANGED
|
@@ -57,10 +57,6 @@ export interface GraphState {
|
|
|
57
57
|
lastMousePos: { x: number; y: number };
|
|
58
58
|
/** Флаг необходимости остановки распространения события */
|
|
59
59
|
mustBeStoppedPropagation: boolean;
|
|
60
|
-
/** Последний узел, над которым был курсор */
|
|
61
|
-
lastHoveredNode: NodeObject | null;
|
|
62
|
-
/** Кэшированная ссылка на последний узел, над которым был курсор (для избежания лишних вычислений) */
|
|
63
|
-
lastHoveredNodeRef: NodeObject | null;
|
|
64
60
|
/** Начальная позиция курсора при начале перетаскивания */
|
|
65
61
|
mouseStartPos: { x: number; y: number } | null;
|
|
66
62
|
/** Флаг режима перетаскивания */
|