Apple Tree Program Logo

Apple Tree

- A squarified tree map for the Apple Macintosh

Here is a little application i've written. It is inspired by the win32 tool Sequoia View. The tool displays the size of a directory and its subdirectories in the form of a squarified tree map.

The key goal is to find the data which uses the the most disk space. The big advantage with this approach is that in spite of the usual disk browsing tools, the whole structure is displayed in a single view. This makes it very easy to find the directories or files which are taking up the most space.

General Description

Screenshot 1 Screenshot 2
Screenshot 1 Screenshot 2

Screenshot 1 shows an example of my fink "/sw" directory. The view seems a little confusing at first sight, but becomes very handy once you get used to it. Each file is displayed as a rectangle. The size of the rectangle corresponds to the size of each file. The active file is displayed in green. Additionally the name of the file including its path and size are printed at the bottom of the window. To support the user, the orange rectangles are marking the active path. All files in a single directory are drawn in a different color. The biggest file is shown in a dark grey and the smallest in white.

Let's do a simple analyzation of what is shown in the first Screenshot. The active file is "tetex-texmfsrc-3.0.tar.gz". The size of the file rectangle indicates, that it is one of the biggest in the whole directory structure, probably the third biggest in "/sw" and all of its subdirectories. The path shows the file is placed in the src subdirectory. The size of this directory is indicated with the bigger orange rectangle. This makes it easy to see, that there are a lot of other files in here. The bigger orange rectangle also indicates the size of this directory. We can see it takes about a third of the whole size analyzed.

Screenshot 2 is another example, but this time the active file is smaller and located in a deeper subdirectory. Through the highlighted rectangles we see the size of each parent directory corresponding to its surounding data and the directory structure. The size of the "sw/share" dir uses approximately a fith to sixth of all displayed data.

Inner Details

This is my first application for the Apple Macintosh platform, so please be patient with my code. I'm sure it it has some errors and/or design flaws. At work am developing code for Windows with C++ and C#. Developing applications with Xcode and Cocoa is quite different, as another memory model, application framework, language, etc. is used. But all in all I think I've done a solid job with this app. If you find any bugs or have have suggestions please drop an email.

The code is written in Objective-C++ using the Apple Cocoa framework. Xcode IDE is used to design and develop the project, which is shipped with Mac OS X or available for free at the Apple Developer Connection.

I have developed the app under OS X Tiger, but it should work under 10.3 too, don't know about 10.2 though. After pressing the button "Analyze" the program iterates through the specified directory and all subdirectories. The size of all files is read and summarized for each directory.
After scanning the directory the view is constructed. This may take some time. The program has to calculate position and size of all the rectangles which may easily be thousands of elements. For example, on my 1GHz G4 Powerbook it took about one minute and 20 seconds to scan my /Application directory and display the view containing about 70.000 files and directories. Processing my complete harddisk took about 5 Minutes. If the window is resized the positions are recalculated.


Below are two files. One is an apple disk image containing a precombiled version, the other the source code of the program.

Disk image: Apple
Source code:

The source code is published under the GNU GPL.

Valid XHTML 1.1