[BioC] Rgraphviz: Edge attributes not displaying

Li.Long at isb-sib.ch Li.Long at isb-sib.ch
Mon Feb 5 11:13:30 CET 2007


On my linux (R2.4 + graphviz 2.8/2.12), the edge labels DO show up...

I don't have Mac on hand...  On the other hand, I don't see any codes that
are Mac-ed or Apple-ed in either Rgraphviz or graphviz.

You can do (in R):  g1 <- layoutGraph(g), then look at g1's AgEdge info to
see if the label info are available.  If they are, then the problem is
likely to be in rendering on Mac, other wise, it's more to do with
retrieving label info.

In case of the latter, I would try to change the following line (in
doLayout.c) from
        if ( edge->u.label != NULL )
to
        if ( agget(edge, "label") )
just to see what happens...

Li




> As Jarrett says, this does not explain why the labels don't show up.
>
> Jarrett: could you do a
> R> graphvizVersion()
> for me. And are you on an Intel or PPC machine?
>
> I have spent some time in GDB and I am stuck for the moment.
>
> Notes for Li and me:
>    R> library(Rgraphviz)
>    gdb> break getEdgeLocs
> run Jarrett's example
>    gdb> break 124
>    gdb> cont
> (continue 5 times I think). Now we should be at the first edge with a
> label, it has the attribute set correctly:
>
> (gdb) p agget(edge, "label")
> $19 = 0x2113cac "Label 1"
>
> But the label is not reflected in the laidout structure, instead of a
> textlabel we get a pointer to NULL:
>
> (gdb) p edge->u.label
> $20 = (textlabel_t *) 0x0
>
> I am at a loss here, running Graphviz 2.12 on Mac PPC. Do you see the
> same Li? Perhaps there have been some changes in how to read the
> labels? Anyway, bedtime.
>
> Kasper
>
>
>
>
>
> On Feb 2, 2007, at 11:52 AM, Jarrett Byrnes wrote:
>
>> I see.  So, lty (aka style in the Rgraphviz documentataion - or
>> should one use $lty) just doesn't work yet?  That still does not
>> explain why labels are not showing up.
>>
>> On Feb 2, 2007, at 1:43 AM, Li.Long at isb-sib.ch wrote:
>>
>>> Hi,
>>>
>>> Some attributes affect layout, while others don't.  For edges,
>>> "label"-attribute does affect layout, as documented by graphviz.
>>> That's
>>> why you see the edges are plotted differently after adding labels.
>>>
>>> The attribute for line type, "lty" in Ragraph-class, is not
>>> retrieved from
>>> graphviz at present, so it does not have any effect.
>>>
>>> Some newly added functions (in devel branch) allow you to see a
>>> nicely
>>> rendered graph by using "toFile" function to output the graph to a
>>> file
>>> (.svg, .ps, etc.).  This function invokes the renderer from
>>> graphviz and
>>> honors many more attributes nicely.
>>>
>>> The work is underway to render the graphs (laid out by graphviz)
>>> better:
>>> to honor more attributes, to honor them better.
>>>
>>> Li
>>>
>>>
>>>> I can confirm the problem. I'll have a look at the source code
>>>> today or
>>> (more likely) tomorrow.
>>>>
>>>> Kasper
>>>>
>>>> On Feb 1, 2007, at 11:36 AM, Jarrett Byrnes wrote:
>>>>
>>>>> Hey, all.  I'm working on some methods with Rgraphviz to plot sem
>>> objects (structrual equation models from the sem library) and have
>>> run
>>> into a problem.  It would seem that Rgraphviz is not dealing with
>>> edge
>>> properties correctly.  I've tried the following sample code:
>>> set.seed(123)
>>>>> V <- letters[1:10]
>>>>> M <- 1:4
>>>>> g1 <- randomGraph(V, M, 0.2)
>>>>> nAttrs <- list()
>>>>> eAttrs <- list()
>>>>> z <- strsplit(packageDescription("Rgraphviz")$Description, " ")
>>>>> [[1]] z
>>> <- z[1:numNodes(g1)]
>>>>> names(z) = nodes(g1)
>>>>> nAttrs$label <- z
>>>>> eAttrs$label <- c("a~h" = "Label 1", "c~h" = "Label 2")
>>>>> attrs <- list(node = list(shape = "ellipse", fixedsize = FALSE))
>>> plot(g1, nodeAttrs = nAttrs, edgeAttrs = eAttrs, attrs = attrs) And
>>> instead of labeling the edges, they become more angled/straight and
>>> less curved.  I've had similar problems with my own functions that
>>> I'm
>>> coding.  Similarly, when I specify "solid" or "dashed" nothing
>>> happens.
>>>  I'd be happy to send a picture, if you would like. Although making
>>> solid or dashed a label instead of a style tends to again straighten
>>> the edges.
>>>>> FYI, I'm running R 2.4.1 and Rgraphviz 1.12.3 (the most current)
>>>>> and
>>> the proper version of xgvis that's needed to install this version of
>>> Rgraphviz.  All of this is on a mac running OSX 10.4.8.
>>>>> Any clue why this might be happening/is there a fix?
>>>>> -Jarrett
>>>>> ----------------------------------------
>>>>> Jarrett Byrnes
>>>>> Population Biology Graduate Group, UC Davis
>>>>> Bodega Marine Lab
>>>>> 707-875-1969
>>>>> http://www-eve.ucdavis.edu/stachowicz/byrnes.shtml
>>>>> 	[[alternative HTML version deleted]]
>>>>> _______________________________________________
>>>>> Bioconductor mailing list
>>>>> Bioconductor at stat.math.ethz.ch
>>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>>> Search the archives: http://news.gmane.org/
>>>>> gmane.science.biology.informatics.conductor
>>>>
>>>> _______________________________________________
>>>> Bioconductor mailing list
>>>> Bioconductor at stat.math.ethz.ch
>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>> Search the archives:
>>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>>
>>>
>>>
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/
>> gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list