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
Integration of Streetlayout as an optional layout algorithm #904
Comments
I love this PR. Been looking forward to this for a looong time. Ever since testville implemented a three-layer deep street layout but it was not able to render deeper structures. A couple of suggestions:
Suppose we have the following structure: root
For x=2 We could show a treemap for |
A short side note to the points 1. The compact folders should be implemented, as they are generated before we decide which layout algorithm to use. I am also voting for your other suggestions 👍 Though, I would suggest to merge small portions of acceptable (maybe partially disabled) features (MVPs) in order to have smaller separate PRs. This will reduce reviewing time and the chance for merge conflicts. Also every CC developer will be more involved in smaller feature decisions through each small readable PR (: |
You put the new layout in the settings right? Mark it as experimental and merge the PR. I also like smaller PRs because I get to try the feature sooner :) Some things like my layout suggestions are a lot more experimental in nature. What are the optimal settings for the street layout? How can we make it better than the classical treemap algorithm? This might create a very small PR but require lots of tinkering. |
Another question: does the streetmap use a good old hand-written treemap algo or the library one? Because in another PR I'd love for us to have our own treemap algorithm where we can place large margins between folders of more than 100 files and small margins inside folders of only 10 files. |
Hi @Richargh
TMStreet Layout with TreeMaps for folder nodes with <=50 filesTMStreet Layout with TreeMaps for folder nodes with <=100 filesTMStreet Layout with TreeMaps for folder nodes with <=150 |
The function looks good to me. But maybe the root should be double the size from the next, or maybe a different color to make it easier to find. Or elevated a bit. I think we should just leave it for now like this and experiment later in a different PR like Alex suggested. Don't investigate textures now :)
I think both.
Looks good in the images. I tried the branch "feature/street-map-layout" but couldn't see it in the commit log.
|
Yes, I think the folders should be compacted before the algorithms happen. But @Richargh is right, I added a function I used in my initial implementation of the layout to skip folders with a child node of the same size and concat their names divide by '/'. I forgot to put it into CodeCharta it seems.
Should there be an option for treeMaps to be generated by depth or by the number of files? The option for depth already exists while for number of files I would have to add it in.
Currently the TMStreet layout uses a "hand-written" one. Actually there are three different TreeMap implementations already added in but there is no option in the ui to choose one yet. The TreeMaps are Squarified, SliceAndDice and Strip.
Okay, I'll leave it for now.
I added a fixed margin for buildings.
Sounds like a very good idea for another pull request :)
Sorry, my bad. I did not push the changes. Now you should see the changes.
The root street is created at the "center" and all descendants from that node are added to both sides of the street. If there are not enough descendants from a street node, there might be only nodes on one side of the street making it seem that the root street is not always centered.
Yes you are right! I "fixed" it by adding the function I was missing for compacting the folders. Here's a picture of the current layout with margins for buildings and treemap root nodes, compacted diretories and treemaps for folders with <= 100 files. |
I think number of files makes the most sense. I'd skip the depth option and make number of files the default criteria. How did you implement it: does it make a treemap for a single folder or even for folders inside folders like in my example above? --> "checks if a folder and subfolders has less than x files, and then shows a treemap. We'd show a treemap for
Perfect, then we can modify the hand-written layout as well.
If the code is already in the code-base then please also make it selectable.
I don't get it. You mean if the subfolder only has 5 descendants it will only show up as a mini-street? I think we should experiment a bit more with the street-placement in future PRs to better render "unbalanced" file trees.
Cool thank you. |
I removed the TreeMap Start Depth option and replaced it with a slider for a maximum number of files for a TreeMap. Folder nodes are created as streets unless they have less file descendants than that number. I set the default value to 100 and let the user input values between 1 and 1000.
In my implementation a folder node is tested whether its subtree contains more file node descendants than the specified number. It counts all direct and indirect descendants.
I guess that would also be part of another pull request then?
No, street creation is not depending on the number of its children. To place a street inside the street layout, you must first know the size of its child nodes. This is why streets, buildings and treemaps need a boundingbox. When you know the dimensions of its child nodes, they have to be split to two rows (each side of the street). This happens by first calculating their boundingboxes' summed side lengths and then putting nodes into the first row until half of this length is exceeded. All remaining nodes are placed in the second row. The problem with that can be that a folder's children may only contain one large folder and several smaller files. In this case the small files do not exceed half the summed side lengths of all children and is placed in the first row aswell. The other row remains empty and unbalanced streets happen. Sorry if that's still not clear. Maybe these images help: This is the way child nodes are placed at streets: These are all child nodes side by side with their metric values. The line shows the summed side lengths and the marker shows its center: |
👍
👍
That depends. If the code is in the code base it should be selectable in this PR. Otherwise it's just dead code. If it's not selectable the code should not be part of this PR but added with a new PR :)
I might just understand that. ;) I still we think we should play with this in future PRs. |
Remove unreachable TreeMap algorithms MaibornWolff#904
Okay, to keep the PR smaller, I removed the alternative treemap algorithms for now. We can add them in a future PR.
We absolutely should. I think there is room for a lot of optimizations! |
Feature request
Description
Referring to issue #788
The user should have the possibility to switch the layout between the standard Squarified TreeMap and a street layout, where file nodes are displayed as buildings and directories are displayed as streets. A street layout has the advantage of a more apparent directory structure and stable positioning of nodes after metric changes.
A layout algorithm only influences the position and shape of a node's base area. Therefore the following 2D representations show the concepts of both proposed layouts algorithms.
Squarified TreeMap representations use less space, but nodes overlap each other, resulting in a less obvious directory structure representation. With this approach nodes are layed out to be "square-like" e.g. have aspect ratios near 1. This comes at the cost of the nodes' initial order, which has to be altered for the algorithm to produce good results. By sorting nodes by their size, a node's position inside the TreeMap is rather unstable for new images after metric changes.
Street Layouts tend to produce results that are larger in size than TreeMap layouts. A leaf nodes base area can have any form, but the most obvious is a square. This is for city metaphor reasons and node comparability. By streets branching from each other, all linked to a main "root street", the projects directory structure can be followed through when looking for a specific node. This results in stable results for the nodes' positions.
To compare 2D layouts side by side, this tool can be used.
Acceptance criteria
Open questions
This would result in a layout like this in CodeCharta-Visualization 03/2020 with a custom Squarified TreeMap implementation and TreeMaps for direcotries with a depth > 3:
TreeMap required, if zooming in and out is a subjectively more intuitive approach to look at smaller structures?
The text was updated successfully, but these errors were encountered: