<TR><TD><A NAME=a:imagescale HREF=#d:imagescale>imagescale</A>
</TD><TD>N</TD><TD><A HREF=#k:bool>bool</A>
<BR>string</TD><TD ALIGN="CENTER">false</TD><TD></TD><TD></TD> </TR>
+ <TR><TD><A NAME=a:inputscale HREF=#d:inputscale>inputscale</A>
+</TD><TD>G</TD><TD>double</TD><TD ALIGN="CENTER"><none></TD><TD></TD><TD>fdp, neato only</TD> </TR>
<TR><TD><A NAME=a:label HREF=#d:label>label</A>
</TD><TD>ENGC</TD><TD><A HREF=#k:lblString>lblString</A>
</TD><TD ALIGN="CENTER">"\N" (nodes)<BR>"" (otherwise)</TD><TD></TD><TD></TD> </TR>
expansion, if <TT>imagescale=true</TT>, width and height are
scaled uniformly.
+<DT><A NAME=d:inputscale HREF=#a:inputscale><STRONG>inputscale</STRONG></A>
+<DD> For layout algorithms that support initial input positions (specified by the <A HREF=#d:pos><B>pos</B></A> attribute),
+ this attribute can be used to appropriately scale the values. By default, fdp and neato interpret
+ the x and y values of pos as being in inches. (<B>NOTE</B>: neato -n(2) treats the coordinates as
+ being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if
+ the graph has pos attributes in points, one should set <TT>inputscale=72</TT>.
+ This can also be set on the command line using the <A HREF=command.html#minusK><TT>-s</TT> flag</A> flag.
+ <P>
+ If not set, no scaling is done and the units on input are treated as inches.
+ A value of 0 is equivalent to <TT>inputscale=72</TT>.
+
<DT><A NAME=d:label HREF=#a:label><STRONG>label</STRONG></A>
<DD> Text label attached to objects.
If a node's <A HREF=#d:shape>shape</A> is record, then the label can
image is scaled down to fit the node. As with the case of
expansion, if <TT>imagescale=true</TT>, width and height are
scaled uniformly.
+:inputscale:G:double:<none>; neato,fdp
+For layout algorithms that support initial input positions (specified by the <A HREF=#d:pos><B>pos</B></A> attribute),
+this attribute can be used to appropriately scale the values. By default, fdp and neato interpret
+the x and y values of pos as being in inches. (<B>NOTE</B>: neato -n(2) treats the coordinates as
+being in points, being the unit used by the layout algorithms for the pos attribute.) Thus, if
+the graph has pos attributes in points, one should set <TT>inputscale=72</TT>.
+This can also be set on the command line using the <A HREF=command.html#minusK><TT>-s</TT> flag</A> flag.
+<P>
+If not set, no scaling is done and the units on input are treated as inches.
+A value of 0 is equivalent to <TT>inputscale=72</TT>.
:K:GC:double:0.3:0; fdp,sfdp
Spring constant used in virtual physical model. It roughly corresponds
to an ideal edge length (in inches), in that increasing K tends to
else return rv;
}
+/* get_inputscale:
+ * Return value for PSinputscale. If this is > 0, it has been set on the
+ * command line and this value is used.
+ * Otherwise, we check the graph's inputscale attribute. If this is not set
+ * or has a bad value, we return -1.
+ * If the value is 0, we return the default. Otherwise, we return the value.
+ * Set but negative values are treated like 0.
+ */
+double get_inputscale (graph_t* g)
+{
+ double d;
+
+ if (PSinputscale > 0) return PSinputscale; /* command line flag prevails */
+ d = late_double(g, agfindgraphattr(g, "inputscale"), -1, 0);
+ if (d == 0) return POINTS_PER_INCH;
+ else return d;
+}
+
char *late_string(void *obj, attrsym_t * attr, char *def)
{
if (!attr || !obj)
extern double late_double(void *, Agsym_t *, double, double);
extern char *late_nnstring(void *, Agsym_t *, char *);
extern char *late_string(void *, Agsym_t *, char *);
- extern boolean late_bool(void *, Agsym_t *, int);
+ extern boolean late_bool(void *, Agsym_t *, int);
+ extern double get_inputscale (graph_t* g);
extern Agnode_t *UF_find(Agnode_t *);
extern Agnode_t *UF_union(Agnode_t *, Agnode_t *);
{
/* Agnode_t* n; */
+ double save_scale = PSinputscale;
+
+ PSinputscale = get_inputscale (g);
fdp_init_graph(g);
if (setjmp(jbuf)) {
return;
if (EDGE_TYPE(g) != ET_NONE) fdpSplines (g);
dotneato_postprocess(g);
+ PSinputscale = save_scale;
}
getPack
getPackMode
getsplinepoints
+get_inputscale
gmalloc
graph_cleanup
graph_init
pack_mode mode;
pack_info pinfo;
adjust_data am;
+ double save_scale = PSinputscale;
if (Nop) {
- int save = PSinputscale;
int ret;
PSinputscale = POINTS_PER_INCH;
neato_init_graph(g);
addZ (g);
ret = init_nop(g, 1);
- PSinputscale = save;
if (ret < 0) {
agerr(AGPREV, "as required by the -n flag\n");
return;
}
else gv_postprocess(g, !ret);
} else {
+ PSinputscale = get_inputscale (g);
neato_init_graph(g);
layoutMode = neatoMode(g);
graphAdjustMode (g, &am, 0);
}
dotneato_postprocess(g);
}
+ PSinputscale = save_scale;
}