Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some Roassal layouts broken when nested #845

Closed
seandenigris opened this issue Aug 3, 2015 · 9 comments
Closed

some Roassal layouts broken when nested #845

seandenigris opened this issue Aug 3, 2015 · 9 comments

Comments

@seandenigris
Copy link
Contributor

Originally reported on Google Code with ID 845

The application I am developing needs to apply layouts to nested elements.  I noticed
that some layouts did not work when nested - so I've done a full review of the layout
listed in ROMondrianExample>>chooseLayoutOn: as per the attached image.  On the left
is the non-nested-result and on the right is the nested-result.  I have attached the
mcz with a slightly modified #chooseLayoutOn: as well as #chooseLayoutNestedOn: for
comparison.





Reported by benjamin.t.coman on 2012-09-24 14:02:32


- _Attachment: [Roassal-BenComan.313.mcz](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-845/comment-0/Roassal-BenComan.313.mcz)_ - _Attachment: ROMondrianExample-chooseLayoutNestedOn.png
![ROMondrianExample-chooseLayoutNestedOn.png](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-845/comment-0/ROMondrianExample-chooseLayoutNestedOn.png)_
@seandenigris
Copy link
Contributor Author

Just one side point - when modifying the original example to add nesting, there was
a problem with the line...
   view circleLayout executeOnElements: (view raw elementsFromModels: (1 to: 5)).

which I don't know understand why #executeOnElements was required since just...
   view circleLayout

seemed to work just as well.

Reported by benjamin.t.coman on 2012-09-24 14:02:43

@seandenigris
Copy link
Contributor Author

To summarize results shown in the graphic, for nested elements, the following are broken:
RORadialTreeLayout
ROSugiyamaLayout
ROHorizontalTreeLayout 
ROForceBasedLayout
ROScatterplotLayout
ROTreeLayout

The following appear to work fine nested:
ROGridLayout
ROVerticalLineLayout 
ROHorizontalLineLayout 
ROBottomFlowLayout 
ROFlowLayout 
ROCircleLayout

In addition, I guess it gets a bit tricky when edges cross the boundary of parent elements
- particularly with the force based layouts.  I remember bumping into an issue with
Mondrian where the nested elements were dragging the parent elements over the top of
each other.  A brief thought on this is that edges that cross parent boundaries should
be handled in two parts.

1. Outside the parent - the edge should "act" in the layout of the parent that is common
to the child-elements at each end of the edge.    

2. Inside the parent - the point where edge crosses to the border of parent becomes
a proxy for the other end of the edge.  This way the "distance" that multiplies the
force has less impact on the local layout within the parent.

So in the attached image, for the edge between B & G, the force layout will try to
bring point 10 & 11 together, but not point 9 & 12.  When 10 & 11 are close, the repulsion
between C & H should dominate rather than still trying to bring B & G together.  

Similarly, for the edges between I & A and I & B, once A & B are up against the bottom
edge of C, the small distance between 1 & 2 and 5 & 6 should allow  repulsion between
A & B as well as the bottom edge to dominate - rather than the greater distance between
1 & 4 and 5 & 8 forcing A & B to overlap.  In addition, the position of I within K
should not be affected since K does not have a circle layout.

This brings me to another passing thought... I think it is a little undefined what
happens if you apply one layout to some child elements of parentA, and a different
layout to other child elements of parentA. Perhaps rather than applying layouts to
a group of elements (eg ROGridLayout on: el elements), a layout should just be applied
to a single element, which arranges all elements contained there-in (eg ROGridLayout
on: el). For the case above, this would require the two sets of elements to be part
of subParentB and subParentC, each having different layouts.

btw, I can't remember seeing any cases where I haven't applied a layout to all child
elements of a node.   

!So there are likely lots of complications I haven't considered and more than can be
dealt with in a single issue, I'm just brain dumping in proximity to the topic that
sparked these thoughts. 

Reported by benjamin.t.coman on 2012-09-24 15:07:33


- _Attachment: Interparent force layouts.png
![Interparent force layouts.png](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-845/comment-2/Interparent force layouts.png)_

@seandenigris
Copy link
Contributor Author

We will work on this thread as soon as we close the one of translation shape.
Thanks for pushing!

Reported by alexandre.bergel on 2012-09-26 22:17:38

@seandenigris
Copy link
Contributor Author

I am not sure to fully understand this issue.
TreeLayout works well when embedded.

try the following:
-=-=-=-=-=-=-=-=-=-=-=-=
    outterNode := ROElement new + ROBorder blue.
    elements := ROElement spritesOn: (1 to: 5).
    outterNode addAll: elements.

    rawView add: outterNode.
    rawView addAll: (edges := ROEdge linesFor: (Array with: elements first -> elements
second with: elements second -> elements fifth with: elements second -> elements third
)).

    ROTreeLayout on: elements.
-=-=-=-=-=-=-=-=-=-=-=-=

I've added this example in ROExample>>nestedLayoutOn: it is therefore accessible from
the example section in Roassal

Reported by alexandre.bergel on 2012-10-07 16:48:07

  • Labels added: Component-Roassal

@seandenigris
Copy link
Contributor Author

Is this still an issue?

Reported by tudor@tudorgirba.com on 2012-12-02 21:35:05

@seandenigris
Copy link
Contributor Author

I think it is still an issue but I don't have time to explore it fully this month. 
 Can it rolled over to version 4.8?

Reported by benjamin.t.coman on 2012-12-02 22:20:03

@seandenigris
Copy link
Contributor Author

Please take a look at this. Otherwise, we close it.

Reported by tudor@tudorgirba.com on 2013-03-24 10:01:05

@seandenigris
Copy link
Contributor Author

I don't have time right now, so close it.  Later if it turns out to be a problem longer
term I will get more data before I would ask for it to re-opened. 

Reported by benjamin.t.coman on 2013-03-24 13:47:59

@seandenigris
Copy link
Contributor Author

Reported by tudor@tudorgirba.com on 2013-03-24 19:22:39

  • Status changed: Fixed
  • Labels added: Milestone-4.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant