Open everbeek opened 9 years ago
The linkStrength does not seem to have any effect.
I looked again at the collision detection example, in three browsers. In Chrome and IE, it runs rather quickly, but in Firefox, there is an open bug regarding SVG rendering, which hasn't quite been fixed yet. There are indications it will be fixed soon though. The example has more nodes than we generally would have, so if that example works swiftly, we could probably use that approach to deal with nodes overlapping due to arc pressure.
http://bl.ocks.org/mbostock/1748247
Ok, I just checked my FF verison, and went from 33.x to 34, and it has dramatically sped up SVG rendering! I feel like I have entered the future.
I should test this example with IE 9 as well though (25% of IE users; another 20% use IE8 which does not support SVG anyway; Chrome and FF users have a strong tendency to upgrade in a fairly timely fashion, so they would receive fine performance with collisions). Testing with IE11 emulation shows 8 to fail, and IE9 and also 10 to do fine, but do I trust that they are actually using SVG engines that would be used in the wild? I should use a Win7 VM to test this out, as it seems to be the only honest way to test it.
I have a virtual machine with IE10 running...that was acceptable. I need to get an image with IE9 on it though.
Tried IE9, and performance seems acceptable to me. I shall try setting up collision detection again.
I think I am close to having the quadtree collision detection working, but my current problem is that points are considered rather than shapes. So if the centers of two nodes are not close enough to one another, then they will not be allowed into my code that checks their offsets from each other. I am confirming that this is the case, then figuring out how to get it working from here.
It's too twitchy, because the collision displacement is immediately fought by the link rigidty. I played with parameters and it didn't help.
I am looking at charge again, but I don't know what will come of it.
Well...I decided to plop Bostock's circular node version into what I had, and to ignore the fact I have rectangles...and it is working really well. I am going to clean things up, and commit this. It is easy to turn off. I shall also disable charge, since that apparently internally deals with another quadtree.
The circular one that seems to work is at: http://bl.ocks.org/mbostock/1748247 The rectangular one that I didn't get working is at: http://bl.ocks.org/ilyabo/2585241
Related: http://bl.ocks.org/eweitnauer/6941997 http://bl.ocks.org/mbostock/4343214 http://jimkang.com/quadtreevis/ http://bl.ocks.org/patricksurry/6478178 http://bl.ocks.org/eweitnauer/6941997
Here is a typical outcome of collision detection, and a typical outcome without. There's no sense of modularity in either, but at least the nodes are not all attempting to cluster on top of one another.
I am not entirely satisfied with the collision result. The layout is extremely disorganized.
Adding a gravitational bias within cliques would help. Is there an easier less structured way? Gravity equation that attracts nodes that are connected perhaps (still fought by link strength)? That would produce gravitational clusters out of cliques without having to analyze the graph...
I should really try to get the collisions to respect the rectangles. It would surely increase layout quality.
Aha! The concept layouts file has a charge setting in it. This was probably clobbering my changes elsewhere. I will give that a shot again.
Ok, so setting charge from -30 or -100 to -500, better still to -800, creates behavior comparable to that of the collision version, but still allows overlap frequently. It is smoother though...
Try these to see if they improve force layout behavior: -use locus in center to control overall force position -increase weights on inheritance, slightly on composition, lowest for mapping.
https://github.com/mbostock/d3/wiki/Force-Layout#linkStrength
The force.linkStrength parameter to the layout can be a function, which would be applied to each edge. This is how we would modulate the inheritance, composition, property relation and mapping arc strengths. Alternatively, the force.theta property is a global node repulsion parameter, and this could also get the desired effect. It is implemented in an efficient way, n*log(n), but we'd have to see how it ran.
I hope that linkStrength changes will cause nodes in the following export data to be laid out without throwing parallel series of inheritance and composition arcs together, and thus not putting lots of nodes into the same space. The export is produced from an Eye Part concept expansion on this base graph: http://127.0.0.1:8888/conceptPathToRoot.html?gwt.codesvr=127.0.0.1:9997&initial_vis=term_neighborhood&ontology_acronym=SNOMEDCT&full_concept_id=http%3A%2F%2Fpurl.bioontology.org%2Fontology%2FSNOMEDCT%2F81745001