On Feb 7, 2008 4:49 PM, Mark W Kimpel <mwkimpel@gmail.com> wrote:
> I'm doing some work on a potential patch to the Bioconductor package
> Rgraphviz and have some questions on code that is contained in engine.c.
> In particular, I am developing some custom shapes using polygon and need
> to make sure that, with rendering, the line connecting the centers of
> two polygons stops at the border of each polygon. The polygons can be
> transparent, so the option of just rendering the lines first won't
work.
>
> Is there some help for me with an R internal or perhaps a higher level
> function?
>
I have to admit I am not that familiar with R graphics, but a very common
way to achieve this in general is to use clipping. That is, you would set
the regions covered by your node polygons as the "clip" and then draw
your
edges. Anything drawn onto the clip region is discarded. You would then
reset the clip and continue drawing.
I'm pretty sure that base R does not support the complex clip regions you
would require. However, it would be possible to do this in R by rendering to
pixmaps in memory and then compositing the pixmaps. The first part is
supported by the cairoDevice package and the latter part by RGtk2 (in
particular its binding to GDK). I'm sure you'd rather not introduce such
a
dependency on Rgraphviz, but it's an option. I think the graphviz developers
are moving towards GTK+/Cairo in terms of plugins and other work.
I checked libgd (already a dependency of graphviz) but found that it only
supports a single rectangle for clipping.
Anyway, I hope this helps a little and good luck,
Michael
> Thanks,
> Mark
> --
>
> Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
> Indiana University School of Medicine
>
> 15032 Hunter Court, Westfield, IN 46074
>
> (317) 490-5129 Work, & Mobile & VoiceMail
> (317) 204-4202 Home (no voice mail please)
>
> mwkimpel<at>gmail<dot>com
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
[[alternative HTML version deleted]]