- Timestamp:
- 10/19/13 11:10:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SMC/trunk/SMC/src/web/scripts/js/smc-graph.js
r3629 r3815 57 57 "charge":{"value":250, "min":10, "max":1000, "widget":"slider" }, 58 58 "friction":{"value":75, "min":1, "max":100, "widget":"slider" }, 59 "gravity":{"value":20, "min":1, "max":100, "widget":"slider" }, 59 60 "node-size": {"value":"count", "values":["1","4","8","16","count"], "widget":"selectone" }, 60 61 "labels": {"value":"show", "values":["show","hide"], "widget":"selectone" }, … … 262 263 var filtered_index_nodes = data_all.nodes.filter(function(d, i) { 263 264 // console.log(d.name.indexOf(search_string)); 264 return d.name.toLowerCase().indexOf(search_string ) > -1;265 return d.name.toLowerCase().indexOf(search_string.toLowerCase()) > -1; 265 266 }); 266 267 … … 323 324 324 325 .friction(parseInt(opt("friction")) / 100 ) 325 .linkDistance(parseInt(opt("link-distance"))) 326 .gravity(0.5) 326 327 .gravity(parseInt(opt("gravity")) / 100 ) 328 329 /* .linkDistance(parseInt(opt("link-distance")))*/ 330 331 .linkDistance(function(d){return link_distance / (d.weight * d.value) }) 327 332 /* Profiles: 328 333 329 .linkDistance(function(d){return link_distance / (d.weight * d.value) })334 330 335 .linkStrength(function(d){return d.weight})*/ 331 336 //.charge(parseInt(opt("charge")) * -1) 332 .charge(function(d) { if (opt("node-size")=="count") 337 338 if (parseInt(opt("charge"))==0) { 339 force.charge(0); 340 } else { 341 force.charge(function(d) { if (opt("node-size")=="count") 333 342 {var node_charge = (Math.sqrt(d.count)<=min_circle) ? min_circle : Math.sqrt(d.count) / data.node_size_ratio; 334 343 //console.log (node_charge + ':' + d.count); … … 337 346 //{ return -d.count * parseInt(opt("charge")); } 338 347 else { return parseInt(opt("charge")) * -1} }) 339 .on("tick", tick) 348 } 349 350 force.on("tick", tick) 340 351 .start(); 352 341 353 if (opt("layout")=='freeze') { 342 354 data.nodes.forEach(function(d) { d.fixed=true });
Note: See TracChangeset
for help on using the changeset viewer.