Re: [guppi-list] piechart component project




On Thu, 11 Mar 1999, Bernhard Reiter wrote:
> 
> To: miguel@roxanne.nuclecu.unam.mx, guppi@gnome.org

Ah yes, guppi-list rather than just guppi.

> The guppi project seems to be the one most closely related.
> I am subscribed to the mailing list now and we hope to further discuss
> the issue with you. It looks as we should integrate our piecharts
> facilities in guppi and therefore GNOME in some way.
> 

Let me describe what adding this to Guppi would involve and what it would
achieve, and you can decide for yourself whether you want to do it.
In short Guppi is intended to provide plot/chart capabilities to Gnumeric,
so our intent was to eventually have a pie chart component as a part of
it.

Guppi consists of several components:

 - "Plot state" objects, which contain information like the data to 
    be plotted, what range the axes cover, etc. All the parameters 
    for the plot.

 - A Gnome frontend; this is a way to represent plot state objects 
   via a canvas item, first, and second a bunch of container glue
   that is used only when Guppi is standalone (in "component"
   mode, only the canvas item is used and the container application
   will provide the glue).

 - Guile scripting; there are two levels of this, Guile scripting 
   for the backend "plot state" objects and Guile scripting for 
   the Gnome frontend in particular.

 - The Goose statistical library; Goose provides a bunch of statistical 
   operations, and is available from within Guppi. It also has 
   Guile bindings.

 - A "data pool" which can store numeric data and lets you keep 
   track of it and browse it in various ways.

The above components are all implemented to some extent for bar charts and
scatter plots. No pie chart so far. :-)

For printing, I (or we, perhaps :-) will be using the gnome-print library
to render each "plot state" object. We could add libplot support too, as
yet another way to represent the plot state objects (PostScript, Gnome,
Guile, ...). 

For saving to a file, I'm using Daniel Veillard's gnome-xml package. Right
now Guppi only saves its numeric data, but once the plots are more stable
they will be able to save in XML format as well.

The plot state objects are the core of Guppi. The benefit to the plot
state object is that Guile scripting and algorithms to do things like
label axes are implemented only once; then printing, GUI frontends, 
etc. are a relatively simple matter to implement. We will also be able to
have a command-line version, probably written in Guile, and any other
versions people want (web interface?).

Different kinds of plots are reasonably unrelated in Guppi, so you could
work on a pie chart independently of the other types. Eventually plot
types will probably be dynamically loaded plugins via gmodule, but for now
there's no real point so I'm just linking them all.

Guppi's Gnome frontend is GnomeCanvas-based, the antialiasing of
GnomeCanvas would make the pie chart look very nice. I would anticipate
having to write a GnomeCanvasArc and/or GuppiPie canvas items, however.

So to do a pie chart you would need to create PieState, the
GnomeCanvasItem for representing the pie chart, to start.  Then Guile
bindings for your PieState, and the ability to convert to XML and to
render via gnome-print or libplot. I would also start by playing with the
Excel pie chart and making a list of its features.

Unfortunately the Guppi source code is not very well organized right now;
it actually consists of a bunch of very distinct modules, but they are all
dumped into a couple of directories. I've been meaning to ask Miguel to
move them around on the CVS server for me so it's easier for others to
figure out what's going on.

Still, if you want to examine it and decide whether you'd like to work
with it, it's in the 'guppi2' module on Gnome CVS. To compile you need the
gnome-xml module and goose module in addition to gnome-libs.

The bar plot module basically consists of barplotstate.h, barplotstate.cc
(plot state object), barplot.h, barplot.cc (bar plot Gnome frontend),
plot.h, plot.cc (generic interface to Gnome frontend plot components,
this is what any new plot type implements). 

Let me know what you think.

Thanks!

Havoc


 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]