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

Treemap Improvements #236

Closed
shundhammer opened this issue Dec 24, 2023 · 1 comment
Closed

Treemap Improvements #236

shundhammer opened this issue Dec 24, 2023 · 1 comment
Labels

Comments

@shundhammer
Copy link
Owner

shundhammer commented Dec 24, 2023

Treemap Improvements

See also issues #223 and #224 and PRs #225 and #235 by @Lithopsian.

Layout Algorithm

@Lithopsian noticed that the treemap layout algorithm and the shading of treemap tiles were somewhat different in QDirStat from the original papers by the TU Eindhoven from 1999-2000. He observed that QDirStat was more prone to produce thin, elongated rectangles than necessary, instead of squares which are much better to compare relative sizes: The area of a treemap tile directly corresponds to the file or directory that it represents, and it's very hard to compare a long, thin rectangle to a square. Is it larger? Is it smaller? Or is it the same size? That's hard to tell when the shapes are very different.

Subdivisions

Building a treemap from a tree means subdividing a given area into rectangles to fit treemap tiles into that area; sometimes horizontally (left to right), sometimes vertically (top to bottom). The order in which that was done was different in QDirStat than what the papers proposed. @Lithopsian fixed that with the pull requests that he contributed; now it uses the smaller side so the resulting tiles are more squarish and less elongated and thin.

Directory Grouping

The result is not only much more square tiles, but also a very visible grouping on each directory level: You can now clearly see larger squares on the top left and increasingly smaller squares down to the bottom right. As usual, as they become so small that you couldn't make them out anymore anyway, they are not rendered anymore, so in large trees, the bottom right tends to be a a flat grey area of "leftover tiny stuff" on many directory levels.

You can use the mouse wheel to zoom in and see more details.

Ridges and Lighting

During each subdivision, a small visual "ridge" is added to give some more visual cues which tiles belong together, i.e. the lighting changes a little bit. This is another area that @Lithopsian improved in his pull requests; now the light source is no longer outside of a directory anymore, but in its geometric center.

Treemap Parameters Tuning

This was all a good start on the way to improved treemaps, but the old treemap parameters for lighting, ridge heights and some more didn't fit very well anymore, so they needed some tuning - and simplification, because some of them were quite redundant and sometimes cancelled each other out.

Even in the old QDirStat (and KDirStat) treemaps those parameters sometimes didn't quite fit: Some treemaps had very dull colors, sometimes much too dark in some areas, sometimes too washed out and too light. That is now much improved; the colors are now much brighter and cleaner.

It might still get some more fine-tuning in the future, though.

Examples

src/qdirstat

Old

Treemap-src-qdirstat-old

New

Treemap-src-qdirstat-new

My Home Directory with Full Browser Caches

Old

Treemap-home-full-old

New

Treemap-home-full-new

My Home Directory after Cleaning Browser Caches etc.

You'd be amazed how much cruft is still left over after cleaning caches in the Internet browsers (Opera, Chrome, FireFox). I did some more manual cleaning here, too, using the new "Find" function, searching for "cache", "thumbnails" and similar.

Old

Treemap-home-clean-old

New

Treemap-home-clean-new

The Whole Root Filesystem (openSUSE Leap 15.5)

Old

Treemap-root-old

New

Treemap-root-new

Don't get confused with the bold font in red for /var: This couldn't be read completely because of permissions (hence the red color), but still it's one of the largest directories on that level (hence the bold font).

All Installed Packages (openSUSE Leap 15.5)

Old

Treemap-all-pkg-old

Notice the blue strip at the bottom which was the result of another minor bug; this is now also fixed.

New

Treemap-all-pkg-new

The sort order between packages is now slightly different because it now takes the allocated size into account.

All YaST Packages (openSUSE Leap 15.5)

Old

Treemap-yast-pkg-old

New

Treemap-yast-pkg-new

Doesn't that already qualify as computer art? ;-)

Conclusion

  • Observe how the directory grouping is now much more obvious.

  • Observe how much cleaner and brighter and much less washed out the colors now are.

@shundhammer
Copy link
Owner Author

Moved @Lithopsian's post to a new issue #237 to keep the user documentation (here) and the developer discussions separate.

Repository owner deleted a comment from Lithopsian Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant