We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › treemap class Ben Fry
Page Index Toggle Pages: 1
treemap class Ben Fry (Read 1998 times)
treemap class Ben Fry
May 23rd, 2010, 1:51am
 
I read the chapter about treemaps, but i cannot realize how to modify it for my tasks.
I want to represent income and expenses of four departements of our clinic (I am a handsurgeon, with minor experience in programming).
Data are simple: e.g kind of expense(personell), departement, amount
They are stored in a tab separated file.
How do I represent these data in a treemap ?
I read the chapter several times, but i do not understand how it works.
Any hints ?
Thanks a lot Peter    
Re: treemap class Ben Fry
Reply #1 - May 23rd, 2010, 3:37am
 
have you downloaded the source code?

http://benfry.com/writing/treemap/library.zip
Re: treemap class Ben Fry
Reply #2 - May 23rd, 2010, 4:13am
 
Looks more like a conceptual issue (how to use some kind of data in some kind of visual representation) than a coding issue (yet...).
Re: treemap class Ben Fry
Reply #3 - May 23rd, 2010, 11:40am
 
Rapatsk1 wrote on May 23rd, 2010, 3:37am:
have you downloaded the source code

http://benfry.com/writing/treemap/library.zip


Yes already tried a little bit, but i dont understand what to put where.
Have already finished a project mapping all my patients on a regional map including changes over time includin an extra program for data mining an prprocessing.
Thus i have some minimal basic knowledge
I tried to reuse the both treemap examples in the book:

class WertItem extends SimpleMapItem {
 String kostenart;
 String abteilung;
 float wert;
 WertItem(String kostenart,String abteilung,float wert) {
   this.kostenart =kostenart;
   this.abteilung = abteilung;
   this.wert = wert;
   }
   
    void draw() {
   fill (255);
   rect(x,y,w,h);
   
   fill(0);
   if (w >textWidth(kostenart) +6) {
     if (h >textAscent() +6) {
       textAlign(CENTER,CENTER);
       text(kostenart,x+w/2,y+h/2);
     }
   }
 }
wert is the value to be calculated
As I understand the first example an array of values have to be created.
Dont know if this is right, and how to create the SimpleMapModel
Peter

Re: treemap class Ben Fry
Reply #4 - May 25th, 2010, 5:43am
 
A very simple exemple about how to build squarified treemaps here, http://w3.win.tue.nl/nl/onderzoek/onderzoek_informatica/visualization/sequoiavie... .

An exhaustive page about treemaps here http://www.cs.umd.edu/hcil/treemap-history/index.shtml

I hope this can help you to have a better understanding of what a treemap is.
Page Index Toggle Pages: 1