Skip to content

Commit

Permalink
Added Network constants in options, this close #8
Browse files Browse the repository at this point in the history
  • Loading branch information
dlumbrer committed Feb 1, 2017
1 parent 9e31e71 commit 717fb49
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
6 changes: 4 additions & 2 deletions public/network_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ function NetworkVisTypeProvider(Private) {
maxNodeSize: 80,
minNodeSize: 8,
maxEdgeSize: 20,
minEdgeSize: 0.1
minEdgeSize: 0.1,
springConstant: 0.001,
gravitationalConstant: -35000
},
editor: '<network-vis-params></network-vis-params>'
editor: require('plugins/network_vis/network_vis_params.html')
},

////////MIRAR THIS
Expand Down
8 changes: 4 additions & 4 deletions public/network_vis_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ define(function (require) {
height: container.getBoundingClientRect().height.toString(),
physics:{
barnesHut:{
gravitationalConstant: -35000,
springConstant:0.01
gravitationalConstant: $scope.vis.params.gravitationalConstant,
springConstant: $scope.vis.params.springConstant
}
},
"edges": {
Expand Down Expand Up @@ -540,8 +540,8 @@ define(function (require) {
height: container.getBoundingClientRect().height.toString(),
physics: {
barnesHut: {
gravitationalConstant: -3500,
springConstant: 0.001,
gravitationalConstant: $scope.vis.params.gravitationalConstant,
springConstant: $scope.vis.params.springConstant,
springLength: 500
}
},
Expand Down
12 changes: 12 additions & 0 deletions public/network_vis_params.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ <h5><strong>Extra</strong></h5>
</label>
</div>

<br>

<h5><strong>Network constants</strong></h5>
<div>
Gravitational
<input type="number" ng-model="vis.params.gravitationalConstant" id="gravC">
</div>
<div>
Spring
<input type="number" ng-model="vis.params.springConstant" id="springC">
</div>


<hr>

Expand Down

0 comments on commit 717fb49

Please sign in to comment.