From 1dd5ccb4d6cfd8f0e0db6ce1a0ef1e7de26d56bd Mon Sep 17 00:00:00 2001 From: Michael Chin Date: Mon, 28 Mar 2022 15:21:02 -0700 Subject: [PATCH 1/2] Fix graph search overriding physics setting --- src/graph_notebook/widgets/src/force_widget.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/graph_notebook/widgets/src/force_widget.ts b/src/graph_notebook/widgets/src/force_widget.ts index d37e7db4..380c1e1e 100644 --- a/src/graph_notebook/widgets/src/force_widget.ts +++ b/src/graph_notebook/widgets/src/force_widget.ts @@ -798,12 +798,19 @@ export class ForceView extends DOMWidgetView { } }); - this.vis?.setOptions({ physics: false }); + // check if physics have been manually disabled/enabled, set flag to indicate that this setting shouldn't be changed + let re_enable_physics = false; + if (this.visOptions.physics.enabled == true) { + this.vis?.setOptions({ physics: false }); + re_enable_physics = true; + } this.nodeDataset.update(nodeUpdate); this.edgeDataset.update(edgeUpdate); - this.vis?.setOptions({ physics: true }); - this.vis?.stopSimulation(); + if (re_enable_physics) { + this.vis?.setOptions({ physics: true }); + this.vis?.stopSimulation(); + } this.nodeIDSearchMatches = Object.keys(nodeIDs); this.edgeIDSearchMatches = Object.keys(edgeIDs); } From f9e9268bc78b011fe151b6771977b3b5f08e2fcc Mon Sep 17 00:00:00 2001 From: Michael Chin Date: Mon, 28 Mar 2022 15:38:49 -0700 Subject: [PATCH 2/2] update changelog --- ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.md b/ChangeLog.md index 3aeb43ce..9caa0c15 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,7 @@ Starting with v1.31.6, this file will contain a record of major features and updates made in each release of graph-notebook. ## Upcoming +- Fixed graph search overriding physics setting ([Link to PR](https://github.com/aws/graph-notebook/pull/282)) ## Release 3.2.0 (February 25, 2022) - Added new notebooks: guides for using SPARQL and RDF with Neptune ML ([Link to PR](https://github.com/aws/graph-notebook/pull/252))