You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current, hack-y way isn't great -- it just tiles the components vertically. Ideally we want to pack tiny components (e.g. just one or two nodes) that have relatively smaller bounding boxes horizontally, as well as vertically.
Figuring out an optimal way to do this sounds like a pain, but there are probably some heuristics we can set up.
In most graphs, there will be one (or two idk) huge hairball components. We can detect this by seeing if the largest component has, say, at least N% of all nodes in the graph (where N = 20 or something, idk; for massive graphs this will be deceptively small). Anyway, if we make the decision that this largest component is a hairball, tile components in a grid pattern in such a way that the maximum width of any row of the grid is always ≤ the width of this largest component's width. This is analogous to how Bandage handles this.
In some small graphs, there won't be a hairball. In this case, maybe just tile components in a grid pattern (starting again with the largest component [determining "largest" by # nodes]), and move on to a new row when the first row contains at least N% of all nodes in the graph. Then set this first row's width as the effective "maximum width" and tile the following rows as before.
Really shouldn't be too bad, at least once #198 is addressed and we can rely on bounding boxes being correct. This doesn't need to be perfect, but it should be at least decent for most graphs.
Once this is done, it might be nice to make some of these settings customizable (e.g. do we tile components from top to bottom or bottom to top? what is N?, etc.). But if we pick good defaults then that's not super important.
The text was updated successfully, but these errors were encountered:
The current, hack-y way isn't great -- it just tiles the components vertically. Ideally we want to pack tiny components (e.g. just one or two nodes) that have relatively smaller bounding boxes horizontally, as well as vertically.
Figuring out an optimal way to do this sounds like a pain, but there are probably some heuristics we can set up.
In most graphs, there will be one (or two idk) huge hairball components. We can detect this by seeing if the largest component has, say, at least N% of all nodes in the graph (where N = 20 or something, idk; for massive graphs this will be deceptively small). Anyway, if we make the decision that this largest component is a hairball, tile components in a grid pattern in such a way that the maximum width of any row of the grid is always ≤ the width of this largest component's width. This is analogous to how Bandage handles this.
In some small graphs, there won't be a hairball. In this case, maybe just tile components in a grid pattern (starting again with the largest component [determining "largest" by # nodes]), and move on to a new row when the first row contains at least N% of all nodes in the graph. Then set this first row's width as the effective "maximum width" and tile the following rows as before.
Really shouldn't be too bad, at least once #198 is addressed and we can rely on bounding boxes being correct. This doesn't need to be perfect, but it should be at least decent for most graphs.
Once this is done, it might be nice to make some of these settings customizable (e.g. do we tile components from top to bottom or bottom to top? what is N?, etc.). But if we pick good defaults then that's not super important.
The text was updated successfully, but these errors were encountered: