Hi
So I've been working on the forcebasedlayout for more than a week now,
here are some news.
I've translated the D3 code, and have implemented a new quadtree, the
mondrian one wasn't that compatible.
But, I have a problem, it seems there is no more bug in th code, but it
still doesn't do what is expected, so I read and read th D3 code and
don't find where are my mistakes. I've started to write test, so maybe I
will find something that way. I've made some simplifications but as I do
translate javascript to smalltalk, I can't do exactly the same things,
and ....
Ok... made a new test, before to send this email, and in fact the
problem that I have and that does not appear in javascript is due to the
length of the links.
It seems that in D3, the node position is kinda relative (maybe
something with the window border, or something like that), but in Pharo,
its more 'static', so it needs to be chosen well for each graph.
Still need to be checked, but with a length of 20, in initialize, you
got a good result with Collection.
-----------------
| view rawView |
rawView := ROView new.
view := ROMondrianViewBuilder view: rawView.
"-------------"
"-------------"
ROEaselMorphic new populateMenuOn: view.
view open.
view interaction on: ROMouseEnter do: [ :n |
| nodes |
nodes := view raw elementsFromModels: n element model
allSubclasses.
ROHighlightElements on: nodes ].
view interaction on: ROMouseLeave do: [ :n |
| nodes |
nodes := view raw elementsFromModels: n element model
allSubclasses.
ROUnhighlightElements on: nodes ].
view shape rectangle size: 10.
view nodes: (Collection withAllSubclasses).
view edgesFrom: #superclass.
view layout: ROForceBasedLayout_N.
view applyLayout.
-------------
Enjoy
Mathieu