From 0844bf0223edd9fa28b879edae331a37f0fa990f Mon Sep 17 00:00:00 2001 From: Nikita Rokotyan Date: Fri, 22 Nov 2024 14:14:15 -0800 Subject: [PATCH] Component | Graph: Config option to disable link highlight on hover - Adds a new `linkHighlightOnHover` config option to the Graph component to enable/disable link hover highlight - Updates the `_onLinkMouseOver` method to only set the `hovered` state if `linkHighlightOnHover` is true --- packages/ts/src/components/graph/config.ts | 3 +++ packages/ts/src/components/graph/index.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/ts/src/components/graph/config.ts b/packages/ts/src/components/graph/config.ts index 749c87832..cbe33bb55 100644 --- a/packages/ts/src/components/graph/config.ts +++ b/packages/ts/src/components/graph/config.ts @@ -148,6 +148,8 @@ export interface GraphConfigInterface; + /** Highlight links on hover. Default: `true` */ + linkHighlightOnHover?: boolean; /** Set selected link by its unique id. Default: `undefined` */ selectedLinkId?: number | string; @@ -327,6 +329,7 @@ export const GraphDefaultConfig: GraphConfigInterface): void { if (this._isDragging) return - d._state.hovered = true + if (this.config.linkHighlightOnHover) d._state.hovered = true this._updateNodesLinksPartial() }