Skip to content

Commit

Permalink
center network on selected node using some dirty hack until @Yomguith…
Browse files Browse the repository at this point in the history
…ereal saves us! (closes #367)
  • Loading branch information
boogheta committed Mar 4, 2022
1 parent 71732df commit ff0e8fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions hyphe_frontend/app/components/sigmaNetwork.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ angular.module('hyphe.sigmaNetworkComponent', [])
labelGridCellSize: 150,
labelRenderedSizeThreshold: 5
})
window.sigmaRenderer = renderer;

$scope.zoomIn = function(){
var camera = renderer.getCamera()
Expand Down
4 changes: 4 additions & 0 deletions hyphe_frontend/app/components/webentitiesNetworkWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ angular.module('hyphe.webentitiesNetworkWidgetComponent', [])
}
});
$scope.bothDegree = $scope.bothDegree/2; //the bothDegree was counted from the two nodes so we have to divide it by 2.

var nodePosition = window.sigmaRenderer.getNodeDisplayData(nid);
window.sigmaRenderer.getCamera().animate(nodePosition, {duration: 500});

};

$scope.networkStageClick = function(){
Expand Down

0 comments on commit ff0e8fe

Please sign in to comment.