FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Topics & Contributions
   Information Visualization
(Moderators: forkinsocket, REAS)
   Program Architecture
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Program Architecture  (Read 2290 times)
umesh

WWW
Program Architecture
« on: Oct 22nd, 2004, 12:05am »

Hi everyone,
 I've got a simple question .. possibly even too simplistic. In any event, I would like to ask it to make sure I start off on the right footing.
 
I have a fairly large data set (more than 7000 cases) that I am using for research purposes (in excel and SPSS and the like), and I would like to use Processing to try out various different ways of visualising the data and showing relationships. Now I am wondering how I should set up the architecture of the program to do this? For example, what sort of data structure should I store the data in? I would want to be able to sort cases by various variables and extract information based on some criteria. I want to be able to develop many diferent visualisations based on the same data in an exploratory fashion.
 
Eventually I might want to export the visualisations to illustrator format to add some text etc. (I've found the illustrator export library on this site to do that).
 
I guess I am seeking advice on how best to set this up to allow for maximum flexibility. Are there any libraries to handle data processing side of things so that I could just focus on the visuals? Unfortunately, my main research focus is not on information visualisation, but it is an interest of mine and I think it would allow me to present my research data in much better ways that the traditional acdemic formats.
 
Thank you very for much any ideas.
 
Umesh
« Last Edit: Oct 22nd, 2004, 12:06am by umesh »  
bsr

WWW Email
Re: Program Architecture
« Reply #1 on: Oct 22nd, 2004, 4:04pm »

i wrote a while ago: http://www.hippocamp.net/misc/portfolio/hippo50/default.htm
 
it does some of the things you're talking about, i read the data from a txt file with different fields seperated by a space, i also got a postscript version working fine which looked good when printed. the new illustrator library is much more comlpete though. can't offer any technical advice but the link might give you some pointers,
cheers,
jon
« Last Edit: Oct 22nd, 2004, 4:04pm by bsr »  

http://hippocamp.net
forkinsocket


forkinsockt WWW
Re: Program Architecture
« Reply #2 on: Nov 21st, 2004, 10:49am »

hi umesh,
 
as a designer whose work is creating custom software, part of your job is designing the architecture, the data containers, and how things work behind the scenes. it's an important task, actually, because it forces you to think about and live in the data, and design an appropriate and elegant solution for describing the data.
 
having said that, one generic model i've used as a starting point for working with spreadsheet-based data is to treat every column as an attribute of an object, and every row as an instance of same object. this may or may not make sense for your data.
 
in the end, you have a collection of object instances, which can be sorted as needed. if the data is not updated frequently while the program is running, you might consider pre-sorting the collection, to avoid costly computation. if you need to pre-sort by many different attributes, you may decide to keep many pre-sorted lists of objects (or, technically, pointers to objects).
 
one more thing: try to be fearless about writing code. i know where you're coming from and have been there myself. just know that it's rewarding to architect things yourself; you will have a more elegant solution in the end, not having used something off-the-shelf.
« Last Edit: Nov 21st, 2004, 10:50am by forkinsocket »  
_C


Re: Program Architecture
« Reply #3 on: Nov 21st, 2004, 12:59pm »

concerning processing, i wrote something like  
this to import a textfile and cut it into  
several pieces into an array. just modify it:
 
Code:

class Loadata
{
 
  String name;  
  int[][] data;
 
  Loadata(String _name)
  {
    name=_name;
    loadString();
  }
 
  void loadString()
  {
 
    data = new int[7][7];
    String[]t=loadStrings(name+".txt");
    for(int i=0; i<t.length; i++)
    {
 String[]rawData=split(t[i], ",");
 for(int j=0; j<rawData.length; j++)
 {
   data[i][j] = Integer.parseInt(rawData[j]);
 }
    }
  }
 
  int[] getData(int where)
  {
    return data[where];  
  }
 
}

 
this loads something like this:
 
 
2,2,8,17,21,26,6
3,3,6,20,24,33,7
3,5,8,25,27,39,8
3,7,12,30,33,44,10
4,10,15,35,40,50,12
4,14,17,40,47,55,14
5,18,22,43,54,61,17
 
into a matrix, so you can handle it.  
 
cheers
 
umesh

WWW
Re: Program Architecture
« Reply #4 on: Nov 23rd, 2004, 4:40pm »

Thank you all for your help and advice. It is much appreciated. I will get cracking on this.
 
crib

WWW
Re: Program Architecture
« Reply #5 on: Dec 3rd, 2004, 5:54am »

is there is a way to access a database with processing? if there is you could just write sql querys and let the database to the sorting for you.
 
Pages: 1 

« Previous topic | Next topic »