[prev in list] [next in list] [prev in thread] [next in thread] 

List:       graphviz-interest
Subject:    Re: [graphviz-interest] Grouping Styles (ala CSS?)
From:       "J. Bobby Lopez" <jbl () jbldata ! com>
Date:       2009-02-10 20:49:53
Message-ID: cda3eb110902101249x776a031cw168f9d5a15b2073d () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


This M4 macro solution works great, thanks Marc!

On Tue, Feb 10, 2009 at 2:45 PM, Marc Chantreux <khatar@phear.org> wrote:

> hello,
>
> On Tue, Feb 10, 2009 at 02:17:23PM -0500, J. Bobby Lopez wrote:
> > A better example would be the following:
> > -------- Snippet # 1
> > graph "people"
> > {
> >    label = "Two People"
> >
> >    subgraph "joe"
> >    {
> >         "clothes:shoes" [color=Blue, fontcolor=Red]
> >         "clothes:gloves" [color=Blue, fontcolor=Red]
> >         "body:hair" [color=Green, fontcolor=Brown]
> >         "body:eyes" [color=Green, fontcolor=Brown]
> >    }
> >
> >    subgraph "mary"
> >    {
> >         "clothes:shoes" [color=Blue, fontcolor=Red]
> >         "clothes:gloves" [color=Blue, fontcolor=Red]
> >         "body:hair" [color=Green, fontcolor=Brown]
> >         "body:eyes" [color=Green, fontcolor=Brown]
> >    }
> >
> > }
>
> i personnaly use M4 macros for that. I also write some scripts as
> wrapper. You can see a complete exemple here:
>
> http://oss.phear.org/merisedot/
>
> or the M4 rewrite of your script below.
>
> Regards
> mc
>
> define(CLOTHES,"clothes:$1" [color=Blue`,' fontcolor=Red])dnl
> define(BODY,"body:$1" [color=Blue`,' fontcolor=Red])dnl
>
> graph "people"
> {
>   label = "Two People"
>
>   subgraph "joe"
>   {
>         CLOTHES(shoes)
>        CLOTHES(gloves)
>        BODY(hair)
>        BODY(eyes)
>   }
>
>   subgraph "mary"
>   {
>        CLOTHES(shoes)
>        CLOTHES(gloves)
>        BODY(hair)
>        BODY(eyes)
>    }
>
> }
>
>
>
> _______________________________________________
> graphviz-interest@research.att.com
> https://mailman.research.att.com/mailman/listinfo/graphviz-interest
>



-- 
J. Bobby Lopez
Web: http://jbldata.com/
Twitter: http://www.twitter.com/jbobbylopez

[Attachment #5 (text/html)]

This M4 macro solution works great, thanks Marc!<br><br><div class="gmail_quote">On \
Tue, Feb 10, 2009 at 2:45 PM, Marc Chantreux <span dir="ltr">&lt;<a \
href="mailto:khatar@phear.org">khatar@phear.org</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;">hello,<br> <div class="Ih2E3d"><br>
On Tue, Feb 10, 2009 at 02:17:23PM -0500, J. Bobby Lopez wrote:<br>
&gt; A better example would be the following:<br>
&gt; -------- Snippet # 1<br>
&gt; graph &quot;people&quot;<br>
&gt; {<br>
&gt; &nbsp; &nbsp;label = &quot;Two People&quot;<br>
&gt;<br>
&gt; &nbsp; &nbsp;subgraph &quot;joe&quot;<br>
&gt; &nbsp; &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &quot;clothes:shoes&quot; [color=Blue, \
fontcolor=Red]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &quot;clothes:gloves&quot; \
[color=Blue, fontcolor=Red]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; \
&quot;body:hair&quot; [color=Green, fontcolor=Brown]<br> &gt; &nbsp; &nbsp; &nbsp; \
&nbsp; &quot;body:eyes&quot; [color=Green, fontcolor=Brown]<br> &gt; &nbsp; \
&nbsp;}<br> &gt;<br>
&gt; &nbsp; &nbsp;subgraph &quot;mary&quot;<br>
&gt; &nbsp; &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &quot;clothes:shoes&quot; [color=Blue, \
fontcolor=Red]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &quot;clothes:gloves&quot; \
[color=Blue, fontcolor=Red]<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; \
&quot;body:hair&quot; [color=Green, fontcolor=Brown]<br> &gt; &nbsp; &nbsp; &nbsp; \
&nbsp; &quot;body:eyes&quot; [color=Green, fontcolor=Brown]<br> &gt; &nbsp; \
&nbsp;}<br> &gt;<br>
&gt; }<br>
<br>
</div>i personnaly use M4 macros for that. I also write some scripts as<br>
wrapper. You can see a complete exemple here:<br>
<br>
<a href="http://oss.phear.org/merisedot/" \
target="_blank">http://oss.phear.org/merisedot/</a><br> <br>
or the M4 rewrite of your script below.<br>
<br>
Regards<br>
mc<br>
<br>
define(CLOTHES,&quot;clothes:$1&quot; [color=Blue`,&#39; fontcolor=Red])dnl<br>
define(BODY,&quot;body:$1&quot; [color=Blue`,&#39; fontcolor=Red])dnl<br>
<div class="Ih2E3d"><br>
graph &quot;people&quot;<br>
{<br>
 &nbsp; label = &quot;Two People&quot;<br>
<br>
 &nbsp; subgraph &quot;joe&quot;<br>
 &nbsp; {<br>
</div> &nbsp; &nbsp; &nbsp; &nbsp;CLOTHES(shoes)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;CLOTHES(gloves)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;BODY(hair)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;BODY(eyes)<br>
 &nbsp; }<br>
<br>
 &nbsp; subgraph &quot;mary&quot;<br>
 &nbsp; {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;CLOTHES(shoes)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;CLOTHES(gloves)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;BODY(hair)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;BODY(eyes)<br>
<div><div></div><div class="Wj3C7c"> &nbsp; }<br>
<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:graphviz-interest@research.att.com">graphviz-interest@research.att.com</a><br>
 <a href="https://mailman.research.att.com/mailman/listinfo/graphviz-interest" \
target="_blank">https://mailman.research.att.com/mailman/listinfo/graphviz-interest</a><br>
 </div></div></blockquote></div><br><br clear="all"><br>-- <br>J. Bobby Lopez<br>Web: \
<a href="http://jbldata.com/">http://jbldata.com/</a><br>Twitter: <a \
href="http://www.twitter.com/jbobbylopez">http://www.twitter.com/jbobbylopez</a><br> \
<br>



_______________________________________________
graphviz-interest@research.att.com
https://mailman.research.att.com/mailman/listinfo/graphviz-interest


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic