Skip to content

Fix graph search overriding physics setting #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd
- Added JupyterLab startup script to auto-load magics extensions ([Link to PR](https://github.com/aws/graph-notebook/pull/277))
- Added includeWaiting option to %oc_status, fix same for %gremlin_status ([Link to PR](https://github.com/aws/graph-notebook/pull/272))
- Added `--store-to` option to %status ([Link to PR](https://github.com/aws/graph-notebook/pull/278))
- Fixed graph search overriding physics setting ([Link to PR](https://github.com/aws/graph-notebook/pull/282))
- Removed `requests-aws4auth` requirement ([Link to PR](https://github.com/aws/graph-notebook/pull/291))

## Release 3.3.0 (March 28, 2022)
Expand Down
13 changes: 10 additions & 3 deletions src/graph_notebook/widgets/src/force_widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down