plotting and diagramming library

Erik Lechak prochak at netzero.net
Tue Oct 28 23:54:52 EST 2003


Hello All,

I am creating a visual programming environment for python (similar to
Matlab's simulink, but for python).  For several reasons I have
decided not to go with OGL.  I am writing a wxOGL replacement library
for wxPython.

My first thought was to create an exact drop in replacement for OGL,
but the more I look at the OGL api the more I hesitate to do it.

The current library/test application is here (need python2.3 and
wxPython):
  http://home.bellsouth.net/p/PWP-dande

Please try it out and look at the code.  You can connect pieces, zoom,
tab to different shapes, add shapes to container blocks, and add code
to code blocks.

Eventually I would like this library to be used for complex diagrams
as well as plotting.  This means the library will have primitive
shapes (no resize, no selection ...).  It will also have complex
shapes (resize, intelligent connections, selections).  OGL does not
really have this distinction.

While working on this library I also noticed that it would be possible
to make this library work with pygame.

Here are my questions:
1) Should I model my api on OGL or the Tk::Canvas (I think it's
Canvas).

2) Should I make it an exclusively wxPython library or should I put
the time in now to make it work with wxPython and the pygame library? 
Are there other graphics libraries it should work with?

3) Would there be any interest if it could load and save in SVG
format?

4) Should I go the OGL route and make the base class "Shape" fairly
heavyweight like OGL, or should I make it lightweight (like I want). 
Lightweight means that the primitive shapes will hold their x,y data
and know how to draw themselves and that's about it.  Lightweight
shapes would be great for plotting.  On the other hand there has to be
a reason why OGL and Tk give their basic shapes so much functionality.

5) wxDiagram is basically a list.  I want my "Diagram" to take
advantage of that fact and either have it inherit from list or
delegate list-methods to its main list member.  After all, this is
python, and it would be cool to be able to
insert,pop,append,extend,...,and iterate over a wxDiagram.  My problem
is wxPython/wxOGL api already has some naming conventions that don't
look like the python list functions.  Which one of these choices do
you like
    a) Only implement the python list functions (or inherit from list,
decorate when necessary)
    b) Only implement the wxDiagram api. (python list functionality
lost)
    c) Implement both.  (this kind of violates python's "one way to do
it")


Any one out there using (or wants to use) python for plotting or
diagramming?  I would like to hear from you.

Thanks,
Erik Lechak
prochak at netzero.net




More information about the Python-list mailing list