List Info

Thread: text beyond nodes & edge cut off




text beyond nodes & edge cut off
user name
2008-07-17 15:33:38
it turns out my workarounds for text extending beyond nodes
didn't
generalize, so i am back to square one and need help.  any
thoughts on
how to stop text from spilling beyond the node?

here is a png with a diamond node and text spilling over:
http://crumpleit.
com/graphs/496.png

here are the contents of the dot file:

graph thought_image {
  node [labelloc="t", fontsize=10,
fontname="Nimbus Sans L", width=0, height=0];
  edge [color="#999999"];
  graph [pad="0.25,0.25",
overlap="false"]

  "asdf asdf asdf asdf asdf asdfnasdf asdf asdf asdf
asdf asdfnasdf
asdf asdf asdf asdf asdfnasdf asdf asdf asdf asdf
asdfnasdf asdf
asdf asdf asdf asdfnasdf asdf asdf asdf asdf asdfnasdf
asdf asdf
asdf asdf asdfnasdf asdf asdf asdf asdf asdfnasdf asdf
asdf asdf
asdf asdfnasdf asdf asdf asdf asdf asdfnasdf asdf
asdn"
[color="#333333", style="filled",
fillcolor="#FFE500",
fontcolor="#000000", fontsize=15, shape=diamond ]
}

btw, thanks for creating such a great app.
_______________________________________________
graphviz-interestresearch.att.com
https://mailman.research.att.com/mailman/list
info/graphviz-interest

Re: text beyond nodes & edge cut off
user name
2008-07-17 18:30:06
i'm comparing the two revs now.  thanks, Emden.

On Thu, Jul 17, 2008 at 1:58 PM, Emden R. Gansner
<ergresearch.att.com> wrote:
> Stephen North wrote:
>>
>> Fortunately it is open source!
>>
>> Almost certainly the function that contains the
error is poly_init()
>> in graphviz2/lib/common/shapes.c  (starting around
line 829).
>>
>> There are some comments but there might still be
some
>> bushwhacking required.
>> .
>> But, really, it's pretty clear what has to happen
by the time you get to
>> this:
>>    /* at this point, bb is the minimum size of node
that can hold the
>> label */
>>    min_bb = bb;
>>
> To be fair, the sizing worked correctly in 2.12. At
some point since then,
> the code was changed to use
> a different test, which appears to be too tight unless
your shape is a box
> or an ellipse. The simplest thing
> for Brian to do would be to put the code back in from
2.12.
>
>   Emden
>
>
_______________________________________________
graphviz-interestresearch.att.com
https://mailman.research.att.com/mailman/list
info/graphviz-interest

Re: text beyond nodes & edge cut off
user name
2008-07-17 19:29:35
thanks, Emden & Stephen.

i made some changes in the source and it looks good so far:
http://crumpleit
.com/graphs/496.png.

what i did:

poking around in version 2.12, I found this code that looked
relevant:

shapes.c (2.12)
606	/* for all other polygon shapes, compute the inner
ellipse
607	   and then pad for that  */
608	temp = cos(PI / sides);
609	dimen.x /= temp;
610	dimen.y /= temp;

in version 2.20.2 the same logic was turned off.  so i just
comented
out the #if / #endif below.  not sure yet what other stuff I
might be
breaking as a result.  but so far so good.

shapes.c (2.20.2)
845	/* #if 0 */
846	if (sides > 2) {
847	    temp = cos(M_PI / sides);
848	    bb.x /= temp;
849	    bb.y /= temp;
850	    /* FIXME - for odd-sided polygons, e.g. triangles,
there
851	    would be a better fit with some vertical adjustment
of the shape */
852	}
853 /* #endif */

thanks again for the help.

-b
_______________________________________________
graphviz-interestresearch.att.com
https://mailman.research.att.com/mailman/list
info/graphviz-interest

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )