Drawing (directed) graphs

Ionel Simionescu ionel at psy.uva.nl
Tue Nov 2 17:32:29 EST 1999


R.M.Everson <R.M.Everson at ex.ac.uk> wrote in message
news:ye1bt9das2p.fsf at ex.ac.uk...

| Does anyone know of Python code for drawing graphs of the
| graph-theoretic type? Ideally, I'd like to be able to interactively
| add nodes and edges etc and add data to structures associated with the
| nodes and edges.
|

The closest library I know is OGL - Object Graphics Library, which comes
with wxPython 2.1.5. ( http://alldunn.com/wxPython/ ).

You can draw  graphical objects of various shapes and connect them with
lines or splines.
You can derive new objects easily, define connection points, nest the
shapes, resize objects.

A problem is that you need to do some (maybe, much) of the layout yourself.

You get some support from composite shapes which are able to manage a given
layout, but there's still a lot of work to do for getting close to something
like graphviz.

ionel


------
extract from:
http://web.ukonline.co.uk/julian.smart/wxwin/contrib/ogl/ogl.htm

Features of OGL
A range of predefined shape classes, such as wxRectangleShape,
wxPolygonShape, wxEllipseShape.
Multiline and spline wxLineShape connecting node shapes: the arcs move with
the nodes.
Arcs join neatly at the perimeter of shapes.
Arcs can either join at attachment points or as if connected to the centre
of the node.
Resizing handles.
Multiple text regions for complex shapes.
Divided rectangles: rectangles with an arbitrary number of vertical
divisions.
Composite shapes.
Simple 'metafile' shapes which can be resized and rotated.
Bitmap shapes.
wxDiagram class manages a list of shapes, and implements input/output.

----------------------------------------------------------------------------
----

The relationship between OGL and Hardy
OGL is the core graphics code for Hardy, a meta-CASE tool written with
wxWindows.
There are various features that Hardy implements over and above the OGL
functionality, including a symbol library, node and arc symbol editors,
attachment point editor, junction node functionality, and various editing
facilities. It is possible that contributors could extend OGL to encompass
these areas in future.








More information about the Python-list mailing list