Re: drawing graphs with dia



On Sat, 2005-03-12 at 20:11 +0100, Grégoire Dooms wrote:
Lars Clausen wrote:

First option is exactly what I had in mind for after 0.95.  We have code
that does line-gap well for almost all objects, but only with lines.  The
various straight lines would work well with it, but getting arcs and
beziers to do the right thing would be tricky.
 

For arc and bezier, I'm not sure what the right thing to do is.
I can suggest two things:
- Connect the endpoint to the central connection point,
  trim the curve at the edge of the connected object
  and draw the arrow like if the endpoint was there
- Preserve the slope the user set when the endpoint was connected to the
  central CP,
  connect the curve at the edge such that it aims at the central CP 
(with the
  same slope).

Let's not worry about the arc yet.

For the line, the gap is perfect for my intended use, why did you 
comment out the GUI ?

It was a rather clunky half-solution to a number of problems, and only
implemented for line.  I wanted something more complete.  I know,
perfectionist syndrome.  

In a general setting with an auto-gap, what do you think about this:
instead of absolute-gap and fractional_gap we could use gap_offset and 
gap_proportion (liner factor) where this latter could apply to either 
the line/curve length or the autogap length.

To sum up:
offset / prop / target
.10 / 0 / self : constant gap of .10
0 / .1 / self : gap is 10% of length
.10 / .1 / self : gap is 10% of length + .10
0 / 0 /auto : arrow touches edge
.10 / 0 / auto : arrow is 10 away from edge
0 / -.5 / auto : arrow is halfway inside the object

positive values always increase the gap, negative decrease the gap.

The main thing that's been holding me off is that I wanted to let all
objects have the virtual central CP.  Some objects have a dynamic number
of CPs, which makes it trickier.  We have some notes on this problem on
the TWiki.

 

Why does it need to be virtual ?  ie. Why not a real central CP and 
multiple
lines connected to it like with the ellipse object ?

The idea is to not have it be a normal CP, but a 'default' CP.  When a
line end is dragged onto the object, but not onto one of the line ends,
it connects to the virtual CP in the center, and the line ends at the
edge of the object.  This would make it possible to make many diagrams
without having to worry about CPs or having to rearrange connections.

Maybe I've been overengineering it in my plans, and it really should
just be that CP 0 for elements is special, and all the element objects
just need updating to place it in the middle.

I would love it if you started looking at this.  I'd want to keep it
entirely #ifdef'ed until 0.95 is out (unless you code well and fast), but
I'm very interested in seeing some action on that front.  I do feel,
though, that it would be unfair not to mention the Graphviz package, which
is made for making graphs.  Doesn't have the editing abilities of Dia, but
is really good at autolayout.
 

Yeah I use it a lot too. The layout engines allow to output the graph in 
xdot
format (dot format with positions and parmaters for the curves). But 
there is
one awkward thing: if you modify the xdot file there is no way/option  
to use
the graphviz renderer to display the modified graph as it always 
re-autolayout
it (AFAIK).

Have you noticed that recent versions support Dia format?  Haven't tried
it out yet.

PS: I tried to compile CVS HEAD on 2005-03-11 and got this error:
widgets.c:30:27: dia-lib-icons.h: No such file or directory
(I did cvs up -d to update my cvs tree) should I check-out from scratch ?
   


Is that from today?  There's something about how automake doesn't quite
force the creation of it, but if you 'make dia-list-icons.h' in lib it's
created.
 

Works fine, I also had to autogen.sh in order to rebuild the configure 
script.

Have to investigate a little further.  You're not the only one to notice
this.

-Lars

-- 
Lars Clausen <lars raeder dk>




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