chubbymaggie / synoptic

Automatically exported from code.google.com/p/synoptic
0 stars 0 forks source link

Constrain model layout to fit all elements on canvas #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The model layout sometimes places model nodes, edges, or edge labels outside of 
the canvas space. Often these elements are only partially occluded and can 
still be dragged into the visible space. It would be helpful, however, if the 
layout function was constrained to layout all elements within the canvas bounds.

Original issue reported on code.google.com by bestchai on 17 Dec 2011 at 3:30

GoogleCodeExporter commented 9 years ago
Taking ownership.

Original comment by kevin.a....@gmail.com on 6 Jan 2012 at 6:38

GoogleCodeExporter commented 9 years ago
I have tried parsing logs many times and I can't get an instance where an 
element is drawn outside the canvas bound, so I'm assuming the solution works. 
Solution in revision 97cd0abe27a4, please review.

Original comment by kevin.a....@gmail.com on 10 Jan 2012 at 6:56

GoogleCodeExporter commented 9 years ago
I'm still able to reproduce the problem. The model attached is for the 2PC 
example, with the browser window made into a smaller rectangle. The issue is 
that TERMINAL as well as the tx_abort nodes are outside the canvas. In 
addition, there is a loop on tx_abort which is completely invisible in this 
layout.

Also, two questions regarding revision 97cd0abe27a4:
1. The comment indicates that the fix is for the "terminal" node -- is that 
true, or does the fix attempt to fix all nodes in the model?

2. Is the fix independent of the node shape/size? We might (and probably will) 
end up changing node sizes/shapes, and it is a bad idea to make the 
functionality that keeps everything on the canvas dependent on either of these.

Original comment by bestchai on 11 Jan 2012 at 12:31

Attachments:

GoogleCodeExporter commented 9 years ago
I didn't consider how the model was displayed when the browser window is 
smaller, a mistake in my part. I'll have to search a different solution.

1. My comment indicated "terminal" node because that was the only thing that 
was being displayed outside the canvas when I was reproducing this problem. The 
fix itself though, attempts to fix all nodes. Either way, this doesn't seem 
like a valid solution.

2. I believe the fix is dependent on node shape/size because it is hard-coding 
a padding between nodes and side edges. If a node is very wide, the padding is 
potentially not sufficient. 

Original comment by kevin.a....@gmail.com on 11 Jan 2012 at 1:39

GoogleCodeExporter commented 9 years ago
Solution in revision 55684fad3705, please code review.

Original comment by kevin.a....@gmail.com on 14 Jan 2012 at 11:53

GoogleCodeExporter commented 9 years ago
Looks good. Merged with default with revision 316c0ecbaa33.

Original comment by bestchai on 15 Jan 2012 at 6:00

GoogleCodeExporter commented 9 years ago

Original comment by bestchai on 20 Jan 2012 at 7:03