Skip to content
Snippets Groups Projects
Commit e7a10a5a authored by Alvaro Graves's avatar Alvaro Graves
Browse files

Merge pull request #5 from joernhees/master

add gravity, distance and charge parameter to D3forcegraph template
parents deac4460 7c9ef9cf
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,9 @@ class Haanga_Extension_Filter_D3ForceGraph{ ...@@ -40,6 +40,9 @@ class Haanga_Extension_Filter_D3ForceGraph{
$options['height'] = 500; $options['height'] = 500;
$options['color'] = '#aec7e8'; $options['color'] = '#aec7e8';
$options['radius'] = 10; $options['radius'] = 10;
$options['gravity'] = 0.05;
$options['distance'] = 100;
$options['charge'] = -100;
for($z=2; $z < count($names); $z++){ for($z=2; $z < count($names); $z++){
$pair = explode("=", $names[$z]); $pair = explode("=", $names[$z]);
$key = trim($pair[0], "\" '"); $key = trim($pair[0], "\" '");
...@@ -115,9 +118,9 @@ function redraw() { ...@@ -115,9 +118,9 @@ function redraw() {
var force = d3.layout.force() var force = d3.layout.force()
.gravity(.05) .gravity('.$options['gravity'].')
.distance(100) .distance('.$options['distance'].')
.charge(-100) .charge('.$options['charge'].')
.size([width, height]); .size([width, height]);
force force
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment