Re: A patch to support creating network diagrams using programs



On Sat, 2005-05-21 at 09:27 -0700, Lars Clausen wrote:
On Fri, 2005-05-20 at 08:49 +0100, Aaron Trevena wrote:
On 5/19/05, Lars Clausen <lars raeder dk> wrote:
On Mon, 2005-05-16 at 08:25 -0400, Michael Tiemann wrote:
I'm writing some scripts to extract data from spreadsheets and build
network flow diagrams.  I assumed that if I created a line that
connected handle A to handle B that dia would figure out where to put
the line and display it.  It did not (instead defaulting to position 0,0
and bounding box 0,0,0,0).  Here's a patch so that locations and bb's
can be inferred by what they connect.

A nice idea, but not quite that easy.  You implementation has a couple
problems (assuming that all objects have handles, assuming that
connectionpoint 0 is always connected on the objects we want to fix),
but also a more serious problem:  When you do move_handle, you're not
guaranteed that the connection will go to the connection point it was
originally on, but rather on the connection point that is on top at that
place.  Hopefully a generated diagram would not have many overlaps like
that, though.

Those problems are minimal compared to the current situation. I had to
give up connecting shapes in Autodia because it was near impossible to
work out the positions of the connectors, so now it has a trimmed
sprout of lines from each shape that connect only when the shape they
connect to moves. This is far from satisfactory.

I guess only doing this for connectors at 0,0 with BB 0x0 would prevent
most problems.  However, this patch is still a kludge.  It may be the
necessary kludge, but I'd like to think a bit about alternatives.

Excellent--thanks!  That's what open source is all about.  I read the
dia sources for the first time about 12 hours before writing that patch.
I spent 10 hours looking at two completely wrong alternatives, then
decided that this looked like the path of least resistance.  It's been
working like a charm for me.  Obviously you know the code better than I
do.

M




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