Welcome to AddressOf.com Sign in | Join | Help

MS Research TreeMap.Net

Paschal L points out the Microsoft Research's TreeMap.Net.  It's an interested way to view information.  I saw it a while back as a map showing the newsgroup traffic.  However, I didn't even think of using this model to view your drive usage.  Now that's pretty cool.  I downloaded it and had to dig in and play around with it.  The code is pretty good, but could see a lot of improvement.  They are using FileSystemObject via COM Interop to get the drives, files and folder tree information.  And yes, I just couldn't leave well enough alone, it's written in C#.  I converted it to VB.NET and replace all of the FileSystemObject stuff with .NET FCL equivalents (IO.Directory and IO.File) and had to bring in some Win32 P/Invoke methods I put together for the FileSystemObject Replacement Project.  I also modified it so that it would cache the folder sizes so as you drill down, it's instantaneous.  The only hit is when you first drill into a drive.

[update] Ready for download. Made even a few more changes.  Went ahead and put back in the FileSystemObjects and allow you to specify which model to use by specify a member variable in Form1 (_useFSO = True/False).  The reason is that FSO seems to be a lot faster at calculating directory size than the other method I was trying to use.  Weird.  I wonder what Microsoft is doing to get directory size so fast.  Also, as a sort of experiment, I added a listview to show the files in the current views folder.  Kind of turns it into a little Explorer type application.  Anyways, here's a link to download TreeMap.Net Explorer with source.  Also, be sure to get the necessary TreeMap.Net controls directly from Microsoft.

[retraction] Although at first glance I thought the code wasn't really great.  After the fact, I was contacted by the original author and he pointed out that it was written in like a half an hour.  I would have known that if I read the article, but it was in French and Google just didn't want to seem to translate it; so all I had to go off was the source.  OK, so the code is pretty cool for a half hours worth of work ;-)  It can obviously use some improvements, but nonetheless, pretty cool so far.  So this is an official apologize to Richard Clark of c2i.fr for any comments that may have been harsh (and such comments have been removed).  Also, with further experimentation, using the FileSystemObject proves to actually be faster... who would of thunk?

Published Saturday, February 7, 2004 9:40 PM by CorySmith
Filed under: ,


# TreeMapping Your File System

Monday, February 9, 2004 4:45 AM by Code/Tea/Etc...

# re: MS Research TreeMap.Net

Monday, February 9, 2004 5:52 AM by Raymond Chen
Now if only someone wrote a version that accepted, say, XML of the form

<container name="baz">
<item name="foo" size="123" />
<container name="blatz">
<item name="bar" size="456" />

since there are things other than files that would benefit from treemapping. (I'm thinking, for example, of my Inbox and all its folders of messages.)

# re: MS Research TreeMap.Net

Monday, February 9, 2004 6:14 AM by Josh Carlson
Not sure which came first, but I've been using this piece of software for quite a while now: http://www.win.tue.nl/sequoiaview/

While it's not .NET, nor is the source available (IIRC), it does add a very neat visual effect of "Cushion Treemaps".

# re: MS Research TreeMap.Net

Monday, February 9, 2004 8:45 AM by Lars
Cool! Please make the VB.NET source available!

# re: MS Research TreeMap.Net

Monday, February 9, 2004 7:23 PM by Richard Clark
Well, thank's for your interest but as I said in my article, it was just a test of the treemapcontrol I did in 1/2h.
I'm actually searching improvement (if I have time) by with FindFirstFile & Co API (quite a funny job to test performances between fso, API & .NET functions).
What I see is first call to FSO is quite long but after, it's really fast (but informations are not right, argh's). I think FSO is caching infos.

# TreeMapping Your File System

Monday, February 9, 2004 9:56 PM by Code/Tea/Etc...

# re: MS Research TreeMap.Net

Wednesday, February 11, 2004 4:55 PM by Fred Beiderbecke
http://www.cs.umd.edu/hcil/treemap/ has some interesting information about treemaps and a java impelementation. In addition, SpaceMonger does a nice job www.werkema.com at the drive mapping stuff.

# re: MS Research TreeMap.Net

Thursday, February 12, 2004 7:47 PM by Learned
http://www.miclog.com has had a version of this for several years now that I think is excellent. I'd love to see this type of structure become popular.

# re: MS Research TreeMap.Net

Monday, December 6, 2004 9:35 PM by Hugh Brown
A couple of things:

(1) Changes to Microsoft control interface
(1.1) It seems there is no tree.ClearNodes() any longer. It is tree.Nodes.Clear().
(1.2) No tree.Draw() takes zero arguments. I just call tree.Invalidate() instead.

(2) Attempt to read unavailable drives
It seems that this line of code:
If drive.IsReady AndAlso
drive.DriveType = Scripting.DriveTypeConst.Fixed OrElse drive.DriveType = Scripting.DriveTypeConst.Removable Then

allows the code to access A: when there is no floppy disk inserted, and the app creashes on my machine. I changed it to this:

If drive.IsReady AndAlso
drive.DriveType = Scripting.DriveTypeConst.Fixed

I suppose if the OrElse were in parentheses it might work, too, but I am not a VB.Net expert.

# re: MS Research TreeMap.Net

Monday, February 20, 2006 2:33 AM by Nishanth
I downloaded treemap from the below link:
http://addressof.com/blog/archive/2004/02/07/369.aspx(here's a link to download TreeMap.Net Explorer with source. )

I have downloaded the treemap component and added to the application reference.. the problem is tree.draw()is expecting parameter(graphics obj ,rectangle obj).. so i am not getting what to pass as parameters.. please do solve this issue for me....

# re: MS Research TreeMap.Net

Tuesday, February 21, 2006 9:23 AM by Chethan
Hi could you please tell me where can i download the C# code for the "view your drive usage" which uses MicrosoftResearch Treemap components..

I have downloaded VB code of the above application i need the C# code Badly.. please do help me out as soon as possible
Anonymous comments are disabled