emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Cecil Westerhof <cldwesterhof@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: How to place things differently in dot
Date: Thu, 26 Mar 2015 22:27:28 +0100	[thread overview]
Message-ID: <CAG-LmmAZqLZmkgRS65yvhD9jfzy=xCjNZgp+WhrkBgCRLuYLZg@mail.gmail.com> (raw)
In-Reply-To: <877fu35wsm.fsf@alphaville.usersys.redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2931 bytes --]

2015-03-26 21:27 GMT+01:00 Nick Dokos <ndokos@gmail.com>:

> Cecil Westerhof <cldwesterhof@gmail.com> writes:
>
> > I was asked to make a diagram and was thinking that dot in org-mode
> could be a good idea.
> >
> > I got reasonably fast the following:
> > <snip
> > This is a good deal in the right direction, but a few things should be
> different:
> > ​- E should be left of F
> > - resource should go to the second 'line' without losing its border
> > - K should be a 'line' lower
> >
>
> Maybe this will help although it's not a complete implementation of
> what you have. The idea is to define rows and arrange your nodes into
> those rows by using rank=same. Then make the row nodes and edges
> invisible. It's also important to do the sequencing correctly, e.g.
> in your example, if you just switch F -- E to E -- F, E will be to the
> left of F as you want. But I don't know how to get the resources
> subgraph to be treated as a node and thereby place it on the same row as F.
>
> In any case, here's the current trial balloon:
>
> --8<---------------cut here---------------start------------->8---
> #+BEGIN_SRC dot :file test2.svg :cmdline -Kdot -Tsvg
> graph foo {
> row1--row2--row3--row4 [style="invisible"];
> row1, row2, row3, row4 [style="invisible"];
>
> utilities [label = "Utilities"]
>  A
>  B
>  C
>  D
>  E
>  F [shape="rectangle"]
>  G
>  H
>  I
>  K
>  subgraph cluster_ta {
>  color=blue
>  {rank = same; L, M;}
>  L
>  M
>  }
>
> {rank=same; row1 utilities A B C; }
> {rank=same; row2 D E F;}
> {rank=same; row3 G H I;}
> {rank=same; row4 K;}
>
> subgraph cluster_resources {
>   resources [label = "Resources"]
>   graph[color=red];
>  }
>
> A -- F
> B -- F
> C -- F
> A -- D
> E -- F
> F -- G
> F -- H
> F -- I
> F -- K
> K -- L
> K -- M
> L -- M
> }
> #+END_SRC
>
> --8<---------------cut here---------------end--------------->8---
>

​I did it a little differently:
    #+BEGIN_SRC dot :file test.png :cmdline -Kdot -Tpng
    graph {
      utilities [label = "Utility's"]

      A
      B
      C

      D
      E
      F [shape = rectangle]


      subgraph cluster_resources {
        color=blue
        resources [label = "Resources"]
      }

      G
      G_ [style="invisible"]
      H
      I

      K
      subgraph cluster_ta {
        color=blue
        {rank = same; L, M}
        L
        M
      }

      {rank = same; D,  E, F}
      {rank = same; G_, K}


      A -- F
      B -- F
      C -- F
      A -- D

      E -- F

      F -- K
      F -- G
      F -- H
      F -- I

      G -- G_ [style="invisible"]

      K -- L
      K -- M
      L -- M
    }
    #+END_SRC
​

​In this way I do not get an empty column. It would be better when K would
put between and below H and I, but I think I can live with it.​

-- 
Cecil Westerhof

[-- Attachment #1.2: Type: text/html, Size: 4367 bytes --]

[-- Attachment #2: test.png --]
[-- Type: image/png, Size: 32939 bytes --]

  reply	other threads:[~2015-03-26 21:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 12:14 How to place things differently in dot Cecil Westerhof
2015-03-26 15:52 ` e.fraga
2015-03-26 16:07   ` Ken Mankoff
2015-03-26 16:57     ` Cecil Westerhof
2015-03-26 17:32       ` Cecil Westerhof
2015-03-26 17:00 ` Thomas S. Dye
2015-03-26 17:09   ` Cecil Westerhof
2015-03-26 20:27 ` Nick Dokos
2015-03-26 21:27   ` Cecil Westerhof [this message]
2015-03-26 21:49     ` Nick Dokos
2015-03-26 22:19       ` Cecil Westerhof
2015-03-27  6:57         ` Cecil Westerhof
2015-03-27  9:29           ` Cecil Westerhof
2015-03-26 21:59     ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG-LmmAZqLZmkgRS65yvhD9jfzy=xCjNZgp+WhrkBgCRLuYLZg@mail.gmail.com' \
    --to=cldwesterhof@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).