レナート   Wunschkonzert, Ponyhof und Abenteuerspielplatz   ﻟﻴﻨﺎﺭﺕ

Wed, 13 Sep 2006

Playing with Cairo

Play around with Cairo: Check!

One thing that has been sitting on my TODO list for a very long time was playing around with Cairo. No longer! Yesterday I spent a little time on hacking a Cairo based equivalent of KDE's Filelight (Which BTW is one of the two programs that KDE has but GNOME really lacks, the other being KCacheGrind). The result after two hours is this:

Fring Screenshot

This screenshot shows the development tree of my Syrep tool.

This tool has definitely nicer anti-aliased graphics than Filelight, doesn't it? The source code is here: fring.py. Anyone interested in turning this into a proper GNOME application?

posted at: 16:43 | path: /projects | permanent link to this entry | 15 comments


Posted by Justin at Wed Sep 13 17:45:26 2006
http://www.marzocca.net/linux/baobab.html

Posted by Lennart at Wed Sep 13 17:57:51 2006
Justin: The graphical map of Baobab is not nearly as useful as the radial map of Filelight and fring.py. In fact I find the baobab map more confusing than enlightening.

Posted by Emmanuele Bassi at Wed Sep 13 17:58:08 2006
actually, gnome 2.16 has a disk analysis tool called baobab inside gnome-utils.  and in the next release it'll create graphs like the above (right now it only has treemaps).

Posted by Mike at Wed Sep 13 18:09:44 2006
There have been two previous attempts at this.  One is really difficult to track down, called gnome-space-chart.  It's very old but still works fine.  The other was a very small python program I wrote quite a while ago called gfilelight (original huh) based upon the then gtk canvas component (which I think has since been deprecated by the cairo components).  It was horrendously inefficient since it basically read the stats of every file off the disk and then drew the picture, but it was similarly anti-aliased.  If you think you can salvage anything of the code base, it's all available from http://www.sf.net/projects/gfilelight.  Hope it's of some use...

Posted by Chris Murphy at Wed Sep 13 19:21:49 2006
This is awesome.  I played with a similar idea for a while, but mine was just a boring Pie Chart.  This would be really helpful as a nautilus extension, so that you could have a tab in each folder's "Properties" dialog that showed the chart for that folder's contents.  I started to do that with mine, but realized that unless you run the image generation in another thread, it makes the dialog take forever -eventually  got distracted by other things.

Posted by Bill Weepie at Wed Sep 13 19:38:34 2006
Wow, this is neat.  I spent some time a while back writing a program with exactly the same goal, in exactly the same language.  I called mine "File Pie."  It looks like you got a bit farther than I did, though.

I would be very interested in helping to turn this into a proper GNOME application.

Posted by nega at Wed Sep 13 19:42:21 2006
pretty snappy in the directories i've run it on. some labels get cut off when using your default image size though.

please keep it 'g' and 'k' free! :)

Posted by Jeff Schroeder at Wed Sep 13 21:13:04 2006
Here is a very small patch adding a --help command line option. This is an AWESOME little tool, thanks for posting it.
==================================================
--- fring.py  2006-09-13 15:10:06.000000000 -0400
+++ fring2.py  2006-09-13 15:06:58.000000000 -0400
@@ -224,6 +224,9 @@
  last = end
  i += 1

+if (sys.argv[1]) == "--help":
+  print "Usage: fring.py [TARGETDIRECTORY] [FILE.png]"
+  sys.exit(1)

if len(sys.argv) >= 2:
  tree_path = sys.argv[1]
==================================================

Posted by Daniel Borgmann at Wed Sep 13 21:31:34 2006
Maybe this could serve as a model for a baobab view? Integration into Nautilus would be interesting as well (as long as it's only generated when the tab is accessed), but the file properties are getting a little crowded already... Maybe a button on the basic tab. In any case I'd rather see this integrated than turned into a stand-alone application. :-)

Posted by Matt Philmon at Thu Sep 14 02:52:10 2006
I think I'll just reiterate alot of what I'm already seeing in the comments... I think this might be better served as an enhancement to Baobab who's current "Tree View" is more than just a little difficult to understand. This is nice work.

Posted by Davyd at Thu Sep 14 04:42:40 2006
Yeah, as Emmanuele said, the next Baobab will have this sort of graphic. Hopefully as the default view. It seems that everyone is intent on recreating the wheel with respect to this particular functionality.

Posted by Emmanuele at Thu Sep 14 09:29:36 2006
By the way, I'm told by baobab maintainers that the ring chart view has hit the cvs, so you can already play with it.

Posted by Sergio Villar at Thu Sep 14 11:20:01 2006
As some others said above there are people developing a widget that looks like yours that will be added to baobab soon. You can see it here: http://blogs.igalia.com/mario/2006/07/19/the-new-baobab-widget/

There are even another people playing with a 3-D version of the same widget:
http://blogs.igalia.com/apinheiro/2006/08/03/a-3d-view-for-baobab-widget/

Posted by Andrew Kerr at Thu Sep 14 13:08:28 2006
While I hope Baobab improves (usability-wise), I think that sort of functionality would be more useful to have integrated with the file manager (which would then rearrange/delete/etc files that are found). Search is an example of a feature that does not necessarily have to be integrated but has been now done quite well, to the benefit of many. How about just adding a "Disk usage" column to Nautilus?

See here for example code: http://drewkerr.googlepages.com/disk-usage-column.py

Now, back to the fring... Here's some ideas on turning this code into a 'proper' application:
- use gnomevfs (take advantage of built-in caching etc)
- convert fring.py code to resizable cairo widget:
  http://pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm
  http://pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets2.htm
- path buttons along top (is this available as a widget?)
- open button (in nautilus) and spinner on far top right
- make segments clickable to recentre ring
- status bar along bottom showing details of segment of mouseover

Like I said, this would be handy to have in nautilus - I do like the property page idea, above.

Posted by Emmanuele Bassi at Tue Sep 19 15:46:19 2006
Andrew: integration in nautilus is possible just by having a 'Show Folder Usage...' button inside the properties dialog, which launches "baobab <uri>". since the window would be called "disk usage" or something like that you would not know if you are using nautilus or another utility; also, it avoids making nautilus the kitchen sink.  this is also what has been done in other operating systems.

Leave a Comment:

Your Name:


Your E-mail (optional):


Comment:


As a protection against comment spam, please type the following number into the field on the right:
Secret Number Image

Please note that this is neither a support forum nor a bug tracker! Support questions or bug reports posted here will be ignored and not responded to!


It should be obvious but in case it isn't: the opinions reflected here are my own. They are not the views of my employer, or Ronald McDonald, or anyone else.

Please note that I take the liberty to delete any comments posted here that I deem inappropriate, off-topic, or insulting. And I excercise this liberty quite agressively. So yes, if you comment here, I might censor you. If you don't want to be censored your are welcome to comment on your own blog instead.


Lennart Poettering <mzoybt (at) 0pointer (dot) net>
Syndicated on Planet GNOME, Planet Fedora, planet.freedesktop.org, Planet Debian Upstream. feed RSS 0.91, RSS 2.0
Archives: 2005, 2006, 2007, 2008, 2009, 2010, 2011

Valid XHTML 1.0 Strict!   Valid CSS!