Welcome to MSDN Blogs Sign in | Join | Help

What is taking up the space on your hard disk? TreeMap it!

Several years ago, I saw a presentation from Microsoft Research about online communication in communities . In particular, a group was studying online communities based on NewsGroup message traffic volume. One of the results was a graphical view of the newsgroups called Netscan.

I didn’t think much of it til I received a comment on my blog Running out of space ? What's on your disk? in which I showed some code to put into a table the folders and their sizes on your hard disk. The comment pointed to a web site showing a Treemap to display disk space usage.

So, it was fairly easy to make a program that shows a map of my hard disk in a treemap. This is a sample treemap of my “c:\Program Files\” folder.

 

The treemap shows rectangles for each folder. Each rectangle is divided alternately horizontally or vertically, into subrectangles for each subfolder proportional in size to the folder. Hovering the mouse over a rectangle shows the folder path and size in a tooltip. The leftmost large block that takes the entire height shows that almost 1/3rd  is taken up by Visual Studio 2003. The top left light blue large block is “Visual Studio 2003\vc7\atlmfc\lib” The next large vertical band is “Program Files\Common Files” with a couple speech engines and the one after is “Program Files\Microsoft Office”

A folder can contain files and folders. If a folder contains 5 subfolders and 10 files, it will have 6 subrectangles: 1 for each subfolder and 1 for the files (labeled with “*\” at the end)

Each folder is a MyRect object subclassed from Shape and added to the form, so there could be thousands of objects.

Try clicking on a folder: the MyRect Click event creates a new instance of the form drilling down one level deeper into that Rectangle.

The code to generate the Treemap (about 100 lines)  in HTML is here and the raw prg is here. You can modify the code to add features delete folders that are right clicked on, use colors to show last used dates, show folder names on the rectangles, etc.

 

 

(Thanks to John Koziol for feedback on this code)

 

 

67877

Published Friday, June 17, 2005 7:36 PM by Calvin_Hsia

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: What is taking up the space on your hard disk? TreeMap it!

Friday, June 17, 2005 8:23 PM by senkwe
hmm, not sure what to do with the .PRG file

# re: What is taking up the space on your hard disk? TreeMap it!

Saturday, June 18, 2005 2:27 AM by Steven Holt
I'm getting an error messasge running this that I suspect is related to the method of parameter passage that is not backwards compatile to the visual version I'm using. What version is it written for?

PROCEDURE init(cPath as String, fSubDir as Boolean)

Error location

_tooltiptimeout=0 && don't timeout til user moves mouse

# re: What is taking up the space on your hard disk? TreeMap it!

Saturday, June 18, 2005 2:43 AM by Calvin_Hsia
PRG is a program file that requires Visual Foxpro.

I am always using the latest version of Visual Foxpro, and may use some features (i.e. _tooltipTimout) that aren't available in earlier versions. You're welcome to remove newer features from the code. It's just simple code that should run in older versions.

# re: What is taking up the space on your hard disk? TreeMap it!

Monday, June 20, 2005 2:05 AM by Vassilis Aggelakos
Great post Calvin and it works nicely!

Thank you

# re: What is taking up the space on your hard disk? TreeMap it!

Monday, June 20, 2005 10:25 AM by Jeff Pace
Cool. Reminds me of one of those Peter Max black light posters in the sixties.

# Watch out when you use another computer for a demo

Friday, June 24, 2005 12:51 PM by Calvin Hsia's WebLog
Wow…. I just had a nightmare of a time using a computer.
 
A colleague asked me if I could do...

# Is your Outlook mailbox overflowing? TreeMap it!

Friday, July 01, 2005 12:59 PM by Calvin Hsia's WebLog
In this post I published 100 lines of code that showed how to get a visual representation of your hard...

# re: What is taking up the space on your hard disk? TreeMap it!

Tuesday, July 26, 2005 4:21 PM by Daw Tsering
Calvin, it works great!

If you add a

MDIForm = .t.
ScrollBars = 3

Then I can maximum size of the screen and see all the shapes.

# re: What is taking up the space on your hard disk? TreeMap it!

Wednesday, November 30, 2005 6:06 AM by RichS
If you want a full ( free ) app, then try "windirstat".

# re: What is taking up the space on your hard disk? TreeMap it!

Wednesday, May 10, 2006 11:35 AM by Lutz
I think SequoiaView is a tad nicer. has been available since years.

http://www.win.tue.nl/sequoiaview/

# Add a slider control to your TreeMap to vary how much detail is shown

Wednesday, July 19, 2006 7:23 PM by Calvin Hsia's WebLog
I was running really low on disk space on one of my machines, so I ran my Treemap utility on it (see...

# re: What is taking up the space on your hard disk? TreeMap it!

Wednesday, April 11, 2007 12:25 PM by ...

Ich erklare meinen Freunden uber diese Seite. Interessieren!

# re: What is taking up the space on your hard disk? TreeMap it!

Friday, April 13, 2007 2:39 PM by ...

Stupore! Amo questo luogo!:)))))))

# re: What is taking up the space on your hard disk? TreeMap it!

Monday, April 16, 2007 8:09 AM by ...

Stupore! Amo questo luogo!:)))))))

# Enable people to run your programs without installing anything

Tuesday, June 19, 2007 7:51 PM by Calvin Hsia's WebLog

Sometimes friends or relatives might hear that you’re an expert with using computers, and might ask you

# It's easy to resize your disk volumes on Vista

Friday, August 10, 2007 3:45 PM by Calvin Hsia's WebLog

On one of my Vista machines, I have a 140G hard drive partitioned into C (20g), D (80G) and E (40g).

# It's easy to resize your disk volumes on Vista

Friday, August 10, 2007 3:57 PM by Noticias externas

On one of my Vista machines, I have a 140G hard drive partitioned into C (20g), D (80G) and E (40g).

# Uninstall VB6 causes error message: You do not have a license to use this control

Monday, January 07, 2008 4:36 PM by Calvin Hsia's WebLog

I was running out of disk space on one of my machines, so I used my TreeMap program to see where I could

# Uninstall VB6 causes error message: You do not have a license to use this control

Monday, January 07, 2008 5:05 PM by Noticias externas

I was running out of disk space on one of my machines, so I used my TreeMap program to see where I could

# MSDN Blog Postings » Uninstall VB6 causes error message: You do not have a license to use this control

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker