Le 15/01/2014 17:07, Tudor Girba a écrit :
If you pass userDefinedEdges: to a graph layout, it will only consider those edges. This is what happens for example in the Meta Browser: the red arrows are not taken into account.
I'll keep track of that gem. Thierry
Doru On Wed, Jan 15, 2014 at 3:32 PM, Usman Bhatti <[email protected] <mailto:[email protected]>> wrote: Alex, I remember to have talked to Mathieu about the making layouts ignore some edges when drawing visualizations and I think he gave it a try as well. I think that can be helpful in Clement's case (back jumps are ignored in the layout). Do you remember to have integrated something in Roassal on these lines from Mathieu's work? Usman On Tue, Jan 14, 2014 at 6:20 PM, Alexandre Bergel <[email protected] <mailto:[email protected]>> wrote: Hi Clément, Thanks for your nice words. Layouts provided by Roassal are well known generic algorithm. Creating a new layout is not complicated at all. Just subclass ROLayout and override the hook methods. Creating a layout for your need is not easy. Have you tried to google for a layout? If you find one, it should be rather easy to implement it. Alexandre On Jan 14, 2014, at 12:50 PM, Clément Bera <[email protected] <mailto:[email protected]>> wrote: > Hello Roassal developers, > > A few time ago Usman Bhatti showed me Roassal. Today I decided to use it for my daily work on a project that aims to optimize Pharo's methods. > > Firstly I am quite impressed by the quality of Roassal, I am currently using the Roassal + Mondrian builder and I have a visual representation which is very close to what I want after 1 hour of work with the help of Usman. Good job guys. > > Here are 2 examples of what I use: > > exampleIfTrueIfFalse2 > | a b | > a := true. > a > ifTrue: [ > false ifTrue: [ ^ b := 1 ] ifFalse: [ b := 2 ] ] > ifFalse: [ > true ifTrue: [ b := 4 ] ifFalse: [ b := 5 ] ]. > ^ b > > <Screen Shot 2014-01-14 at 4.14.49 PM.png> > > Here there's one rectangle for each basic block, entrance/exits are basic blocks with bigger borders, and borders in red represents the "hot path", which the path the execution flow most frequently uses (based on native code counters added at some spots in the method by Cogit). > > Another example: > > exampleToDo > > 1 to: 10 do: [ :i | > self kick: i ] > > <Screen Shot 2014-01-14 at 4.36.47 PM.png> > > Now I have a few issues with the layout. I am currently using the narrowTreeLayout which seems to be the best for my visualisation. > > issue 1: When branches merges, which is in a tree when a node has 2 or more parents, or when I have a #ifTrue:ifFalse:, the child is not well aligned horizontally. Here in the first visualisation I showed, BasicBlock 5 is below but not in the middle of Basic block 8,7 and 4 (horizontally). I put a minimal width for each basic block to make it better but it's still not perfect. > issue 2: (most important issue) I cannot display back jumps because then all the graph is missdrawn, therefore I need to remember where they are instead of visualizing them all the time (I cannot display the back jump from basic block 3 to basic block 2 in the second representation. In addition, the back jump edge, when well displayed, overlaps the basic blocks visualizations. > > Here is an example of what I would like for the edges and basic block positions: > > <Screen Shot 2014-01-14 at 4.27.32 PM.png> > > As you can see, here exit is in the middle of B2 and B5 horizontally, which is not the case in my roassal visualization. > In addition, there's a back jump from B6 to B4 that I cannot display (or all the visual representation goes nuts). The edge for the back jump does not overlap with the basic blocks. In this graph, arrows follow a grid. I don't care that arrows are diagonals instead of a mix of horizontal and vertical lines but I would like to be able to see nicely the back jumps as in this graph. > > Do you have an idea on what layout/view options I could use with Roassal +Mondrian to have a better result ? > > I tried to create my own layout but after 2 hours I understood this cost too much time for my planning (or perhaps I'm just too dumb to do it fast :-( ). > > Anyway, the representation I have now is good enough for me to use it. But a better one would be better, especially for back jumps :-). > > Thanks for any help. > > Clement -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. -- www.tudorgirba.com <http://www.tudorgirba.com> "Every thing has its own flow"
-- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
