Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

How to minimize Unnecessary White Space

0 votes
Hi Thomas:
I think I asked you this before; but, I can NOT find the answer.
You'll see a lot of Unnecessary White Space in this file: https://www.dropbox.com/s/xsv3mgbn72yo60i/Ontology%20yEd%20221127%20WITHOUT%20My%20Level%201%20Edges%20with%20ALL%20Text%20Visible.graphml?dl=0

I've tried a lot of the Options; but, I do NOT eliminate the White Space.

How do I do it?

This is the Excel File that I import: https://www.dropbox.com/s/1p23f7jp7pqaprt/Ontology%20yEd.xlsx?dl=0

Thanks, Bill
in Help by (400 points)
Hi Thomas:

I have No Idea which algorithm :(

I simply open the Excel File that I sent to you using whatever defaults are set.

Please suggest the Algorithm I should use AND how to see it :)?

Cheers, Bill

When importing data from an Excel file, there is an option "Layout" on tab "Presentation":

This "Layout" option tells you which algorithm was used to calculate the initial arrangement for your diagram.

For your diagram you probably want to use the "Hierarchical" algorithm. In that case, the Excel import will use the settings from "Layout" -> "Hierarchical".

You do not need to import your data again, though. You can run "Layout" -> "Hierarchical" on the existing diagram.
Before doing that, you should change the behavior of your group nodes, though. I think you will need option "Consider Label" to be enabled for all your group nodes. To enable that option, select all group nodes (but no other nodes), go to the properties view in yEd's lower right corner, scroll down to section "Open Group" and activate option "Consider Label". (You can use "Tools" -> Select Elements" to select all group nodes.)
After that, run "Layout" -> "Hierarchical". When the algorithm settings are displayed, first click "Reset", then go to tab "Grouping" and switch the value of option "Layering Strategy" from "Ignore Groups" to "Layout Groups". With these settings, all but your outermost group should be fairly compact.
Unfortunately, I do not think there is an automatic way to get the outermost group to be more compact as well. (You can always manually arrange your nodes for more compact placement, of course.)

Thomas:|

Thanks for the Clear Instructions.

"Consider Label" Helped Some.

But, the Minimum Distance Between some Nodes is taking precedence over Minimum White Space.

In this file https://www.dropbox.com/s/wd6vvfd8w5hrhib/Ontology%20yEd%20221127%20WITHOUT%20My%20Level%201%20Edges%20with%20ALL%20Text%20Visible%20Consider%20Label%20Enabled.graphml?dl=0

notice the closeness of Node 2.2 to 2.1 versus the length of 2.2 on the left side.

Then, notice the length of 7.5 and the total length of 7.

Yes, I can fix these manually.

But, as you know, I prefer NOT to change the yEd diagram itself.

Instead, I prefer to change settings and the Excel File so that the Excel File is the Digital Twin of the yEd diagram.

I regenerate the yEd diagrams OFTEN :)

Thanks again for your timely and helpful responses.

Cheers, Bill
Thomas:

One of the reasons I regenerate rather than edit is that I'm terrible at it :)

That said, I did some rearranging and significantly reduced the size of the drawing https://www.dropbox.com/s/sbze43w1fz7cmu3/Ontology%20yEd%20221127%20WITHOUT%20My%20Level%201%20Edges%20with%20ALL%20Text%20Visible%20Consider%20Label%20Enabled%20Manually%20Rearanged.graphml?dl=0

True, there is a lot more that can be done.

I'd like to know how to have yEd do it for me.

Hope you can help.

Cheers, Bill
Thomas:

If you look closely at the Graphs I sent, you'll notice that I did the Hierarchial Bottom to Top Layout.

However, Groups 2 & 10 are the reverse. One even does part correctly and then turns and goes the other way???

Re:

But, the Minimum Distance Between some Nodes is taking precedence over Minimum White Space.

In this file [snip]

notice the closeness of Node 2.2 to 2.1 versus the length of 2.2 on the left side.

Then, notice the length of 7.5 and the total length of 7

There is no guarantee for "Minimum White Space". It is simply impossible for any layout algorithm to make that guarantee. While the hierarchical layout algorithm tries to produce compact results, compactness is not top priority. This is why there are several minimum distance settings, but no maximum distance settings.

That said, node 2.2 and node 7.5 are very high because you did not set option "Layering Strategy" to value "Layout Groups".

To be honest, I have no idea what settings you did use for your diagram. You certainly did not use default settings as I advised, because your diagram has (a lot of) edges pointing from bottom-to-top and also some pointing from top-to-bottom. That is not a results that you would get with default settings.

Re:

I'd like to know how to have yEd do it for me.

Well, I think the best you can do for your type of diagrams is Hierarchical layout with default settings except option "Layering Strategy" set to "Layout Groups" (tab "Grouping") and option "Edge Labeling" set to "Hierarchic" (tab "Labeling").
The latter one is to ensure edges are long enough to place their labels between source and target node.

With the above setting, I get this result for your sample diagram.

Re:

If you look closely at the Graphs I sent, you'll notice that I did the Hierarchial Bottom to Top Layout.

However, Groups 2 & 10 are the reverse. One even does part correctly and then turns and goes the other way???

This is what I get when I use Hierarchical layout with default settings for your diagram. I have no idea what settings you did use, but I am very certain it was not default settings (in your diagram too many bottom-to-top edges for default settings).

Anyways, with default settings edges at group nodes really do not work well. Which is why I recommend setting "Layering Strategy" to "Layout Groups".

That said, even with "Layout Groups" you cannot entirely prevent bottom-to-top edges: if there is a circular edge path (e.g. node 2.1 is connected  to node 10, node 10 is connected to node 8, node 8 is connected to node 2 which contains node 2.1), the algorithm has to choose at least one edge in the path to point backwards.

1 Answer

0 votes

Unfortunately, there is no general answer to this question. Instead, it depends on the layout algorithm you used to arrange you diagram. And for some cases, the algorithms cannot produce compact results.

That said, which algorithm did you use?

Finally, the previous question you are referring to was probably this one. It does not have an answer, because that question does not say which algorithm you used either.

by [yWorks] (154k points)
Legal Disclosure | Privacy Policy
...