Skip to content

Commit b48320c

Browse files
fix selected node highlights in force widget (#741)
1 parent ec759e0 commit b48320c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/graph_notebook/options/options.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
# Documentation for these options: https://visjs.github.io/vis-network/docs/network
77
OPTIONS_DEFAULT_DIRECTED = {
88
"nodes": {
9-
"borderWidthSelected": 0,
9+
"borderWidthSelected": 3,
1010
"borderWidth": 0,
11+
"chosen": True,
1112
"color": {
1213
"background": "rgba(210, 229, 255, 1)",
1314
"border": "transparent",

src/graph_notebook/widgets/src/force_widget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ export class ForceView extends DOMWidgetView {
493493
this.vis?.on("deselectNode", (params) => {
494494
console.log("deselect");
495495
params.previousSelection.nodes.forEach((value) => {
496-
this.handleDeselectNode(value);
496+
this.handleDeselectNode(value.id);
497497
});
498498
});
499499

test/unit/options/test_options.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ def test_vis_options_merge_complete_config(self):
127127
},
128128
'expected': {
129129
"nodes": {
130-
"borderWidthSelected": 0,
130+
"borderWidthSelected": 3,
131131
"borderWidth": 0,
132+
"chosen": True,
132133
"color": {
133134
"background": "rgba(210, 229, 255, 1)",
134135
"border": "transparent",
@@ -222,8 +223,9 @@ def test_vis_options_merge_complete_config(self):
222223
},
223224
'expected': {
224225
"nodes": {
225-
"borderWidthSelected": 0,
226+
"borderWidthSelected": 3,
226227
"borderWidth": 0,
228+
"chosen": True,
227229
"color": {
228230
"background": "rgba(210, 229, 255, 1)",
229231
"border": "transparent",

0 commit comments

Comments
 (0)