Number: 2115
Title: Implement horizontal/vertical scaling (starting with twopi)
Submitter: Pander
Date: Sat Jan 22 08:29:40 2011
Subsys: Twopi
Version: 2.27.0 (20110122.1251)
System: *-*-
Severity: minor
Problem:
Especially twopi can cause shapes and labels to overlap. Because it is not yet possible to (auto)rotate shapes and labels in twopi, I would like to propose the following additional solution. Als to simply have more control over teh resulting shape.

Please implement a setting on graph called


  scale
which is a double with default value

  1.0

For the moment only twopi will be influenced by it.

Implementing this will offers greater control of results, especially preventing shape and label overlapping.
Input:

digraph G {
  layout="twopi"
  scale="1.5"
  root -> {aaaaaaaaaaaaaaa baaaaaaaaaaaaaa caaaaaaaaaaaaaa daaaaaaaaaaaaaa eaaaaaaaaaaaaaa faaaaaaaaaaaaaa }
}
Comments:
If one of the core developers is willing to mentor me, I would like to do the implementation and him step by step the patches so he can commit the changes in CVS.

The implementation only influence the x-coordinates. For scaling in the y-direction, use a value below 0.0 and increase ranksep. so scaling is possible in both directions.

However, scaling can be implemented for both x and y-direction via


  scale="1.5:1.25"
  scale=":1.25"
  scale="1.5:"
  scale=":" == scale="1.0:1.0"

Benefit is easier scaling in all directions in twopi, disadvantage is a little more complex implementation. But keeping scaling in mind for other renderers than twopi (which I cannot oversee) I will leave this decision up to the core developers.

Please response as soon as is convenient since now I have the time to work on this.
Fix:


/graphviz2/lib/twopigen# diff circle.c.orig circle.c
313c313
< 	ND_pos(n)[0] = hyp * cos(THETA(n));
---
> > 	ND_pos(n)[0] = scale * hyp * cos(THETA(n));

Owner: *
Status: Request