Skip to content

Commit 3de8390

Browse files
committed
Fix #501 Show graph overlay only on click and not hover
1 parent 5521980 commit 3de8390

File tree

1 file changed

+9
-5
lines changed
  • redisinsight/ui/src/packages/redisgraph/src

1 file changed

+9
-5
lines changed

redisinsight/ui/src/packages/redisgraph/src/graphd3.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,10 @@ function GraphD3(_selector: HTMLDivElement, _options: any): IGraphD3 {
816816
if (typeof options.onNodeClick === 'function') {
817817
options.onNodeClick(this, d, event)
818818
}
819+
820+
if (info) {
821+
updateInfo(d)
822+
}
819823
})
820824
.on('dblclick', function onNodeDoubleClick(event, d) {
821825
stickNode(this, event, d)
@@ -843,10 +847,6 @@ function GraphD3(_selector: HTMLDivElement, _options: any): IGraphD3 {
843847
.call(zoom.translateTo as any, d.x, d.y), 10)
844848
})
845849
.on('mouseenter', function onNodeMouseEnter(event, d) {
846-
if (info) {
847-
updateInfo(d)
848-
}
849-
850850
if (typeof options.onNodeMouseEnter === 'function') {
851851
options.onNodeMouseEnter(this, d, event)
852852
}
@@ -893,6 +893,10 @@ function GraphD3(_selector: HTMLDivElement, _options: any): IGraphD3 {
893893
if (typeof options.onNodeInfoClick === 'function') {
894894
options.onNodeInfoClick(this, d, event)
895895
}
896+
897+
if (info) {
898+
updateInfo(d)
899+
}
896900
})
897901

898902
g.append('rect')
@@ -985,7 +989,7 @@ function GraphD3(_selector: HTMLDivElement, _options: any): IGraphD3 {
985989
options.onRelationshipDoubleClick(this, d, event)
986990
}
987991
})
988-
.on('mouseenter', (event, d) => {
992+
.on('click', (event, d) => {
989993
if (info) {
990994
updateInfo(d)
991995
}

0 commit comments

Comments
 (0)