* How to place things differently in dot
@ 2015-03-26 12:14 Cecil Westerhof
2015-03-26 15:52 ` e.fraga
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Cecil Westerhof @ 2015-03-26 12:14 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1117 bytes --]
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:
#+BEGIN_SRC dot :file test.svg :cmdline -Kdot -Tsvg
graph {
utilities [label = "Utility's"]
A
B
C
D
E
F [shape = rectangle]
subgraph cluster_resources {
color=blue
resources [label = "Resources"]
}
G
H
I
K
subgraph cluster_ta {
color=blue
{rank = same; L, M}
L
M
}
{rank = same; D, E, F}
A -- F
B -- F
C -- F
A -- D
F -- E
F -- K
F -- G
F -- H
F -- I
K -- L
K -- M
L -- M
}
#+END_SRC
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
Are those things possible?
As attachment how it looks now.
--
Cecil Westerhof
[-- Attachment #1.2: Type: text/html, Size: 2240 bytes --]
[-- Attachment #2: test.png --]
[-- Type: image/png, Size: 30676 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
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 17:00 ` Thomas S. Dye
2015-03-26 20:27 ` Nick Dokos
2 siblings, 1 reply; 14+ messages in thread
From: e.fraga @ 2015-03-26 15:52 UTC (permalink / raw)
To: Cecil Westerhof; +Cc: emacs-orgmode
On Thursday, 26 Mar 2015 at 13:14, Cecil Westerhof wrote:
> I was asked to make a diagram and was thinking that dot in org-mode could
> be a good idea.
[...]
> This is a good deal in the right direction, but a few things should be
> different:
The graphviz tools are fantastic for quick and dirty graphs but the
layout algorithms are not easily controlled... I would highly recommend
tikz ...
If you do want to use dot, I have only ever managed to get what I want
by changing the order in which I specify the connections and/or more use
of sub-graphs.
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-790-gb719c1.dirty
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-26 12:14 How to place things differently in dot Cecil Westerhof
2015-03-26 15:52 ` e.fraga
@ 2015-03-26 17:00 ` Thomas S. Dye
2015-03-26 17:09 ` Cecil Westerhof
2015-03-26 20:27 ` Nick Dokos
2 siblings, 1 reply; 14+ messages in thread
From: Thomas S. Dye @ 2015-03-26 17:00 UTC (permalink / raw)
To: Cecil Westerhof; +Cc: emacs-orgmode
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:
> #+BEGIN_SRC dot :file test.svg :cmdline -Kdot -Tsvg
> graph {
> utilities [label = "Utility's"]
>
> A
> B
> C
>
> D
> E
> F [shape = rectangle]
>
>
> subgraph cluster_resources {
> color=blue
> resources [label = "Resources"]
> }
>
> G
> H
> I
>
> K
> subgraph cluster_ta {
> color=blue
> {rank = same; L, M}
> L
> M
> }
>
> {rank = same; D, E, F}
>
>
> A -- F
> B -- F
> C -- F
> A -- D
>
> F -- E
>
> F -- K
> F -- G
> F -- H
> F -- I
>
>
> K -- L
> K -- M
> L -- M
> }
> #+END_SRC
>
> 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
>
> Are those things possible?
As a last resort, you can edit the svg file.
hth,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-26 17:00 ` Thomas S. Dye
@ 2015-03-26 17:09 ` Cecil Westerhof
0 siblings, 0 replies; 14+ messages in thread
From: Cecil Westerhof @ 2015-03-26 17:09 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]
2015-03-26 18:00 GMT+01:00 Thomas S. Dye <tsd@tsdye.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:
> > #+BEGIN_SRC dot :file test.svg :cmdline -Kdot -Tsvg
> > graph {
> > utilities [label = "Utility's"]
> >
> > A
> > B
> > C
> >
> > D
> > E
> > F [shape = rectangle]
> >
> >
> > subgraph cluster_resources {
> > color=blue
> > resources [label = "Resources"]
> > }
> >
> > G
> > H
> > I
> >
> > K
> > subgraph cluster_ta {
> > color=blue
> > {rank = same; L, M}
> > L
> > M
> > }
> >
> > {rank = same; D, E, F}
> >
> >
> > A -- F
> > B -- F
> > C -- F
> > A -- D
> >
> > F -- E
> >
> > F -- K
> > F -- G
> > F -- H
> > F -- I
> >
> >
> > K -- L
> > K -- M
> > L -- M
> > }
> > #+END_SRC
> >
> > 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
> >
> > Are those things possible?
>
> As a last resort, you can edit the svg file.
>
It did cross my mind, but I am afraid it is not a real option (for me).
--
Cecil Westerhof
[-- Attachment #2: Type: text/html, Size: 2597 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-26 12:14 How to place things differently in dot Cecil Westerhof
2015-03-26 15:52 ` e.fraga
2015-03-26 17:00 ` Thomas S. Dye
@ 2015-03-26 20:27 ` Nick Dokos
2015-03-26 21:27 ` Cecil Westerhof
2 siblings, 1 reply; 14+ messages in thread
From: Nick Dokos @ 2015-03-26 20:27 UTC (permalink / raw)
To: emacs-orgmode
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---
HTH,
Nick
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-26 20:27 ` Nick Dokos
@ 2015-03-26 21:27 ` Cecil Westerhof
2015-03-26 21:49 ` Nick Dokos
2015-03-26 21:59 ` Nick Dokos
0 siblings, 2 replies; 14+ messages in thread
From: Cecil Westerhof @ 2015-03-26 21:27 UTC (permalink / raw)
To: emacs-orgmode
[-- 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 --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-26 21:27 ` Cecil Westerhof
@ 2015-03-26 21:49 ` Nick Dokos
2015-03-26 22:19 ` Cecil Westerhof
2015-03-26 21:59 ` Nick Dokos
1 sibling, 1 reply; 14+ messages in thread
From: Nick Dokos @ 2015-03-26 21:49 UTC (permalink / raw)
To: emacs-orgmode
Cecil Westerhof <cldwesterhof@gmail.com> writes:
> 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.
>
Just put I after K and the subgraph.
Nick
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-26 21:49 ` Nick Dokos
@ 2015-03-26 22:19 ` Cecil Westerhof
2015-03-27 6:57 ` Cecil Westerhof
0 siblings, 1 reply; 14+ messages in thread
From: Cecil Westerhof @ 2015-03-26 22:19 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1446 bytes --]
2015-03-26 22:49 GMT+01:00 Nick Dokos <ndokos@gmail.com>:
> Cecil Westerhof <cldwesterhof@gmail.com> writes:
>
> > 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.
> >
>
> Just put I after K and the subgraph.
>
That works. It is even better when I put both H and I after it.
I also found a way to get resources at the correct place.
It know becomes:
#+BEGIN_SRC dot :file test.png :cmdline -Kdot -Tpng
graph {
A
B
C
utilities [label = "Utility's"]
D
E
F [shape = rectangle]
subgraph cluster_resources {
color=blue
resources [label = "Resources"]
}
G
G_ [style="invisible"]
K
subgraph cluster_ta {
color=blue
{rank = same; L, M}
L
M
}
H
I
{rank = same; D, E, F}
{rank = same; G_, K}
A -- F
B -- F
C -- F
A -- D
utilities -- resources [style="invisible"]
E -- F
F -- K
F -- G
F -- H
F -- I
G -- G_ [style="invisible"]
K -- L
K -- M
L -- M
}
#+END_SRC
That looks very good indeed: I think I do not need to start working with
ditaa. :-)
Everyone thanks for the help.
--
Cecil Westerhof
[-- Attachment #1.2: Type: text/html, Size: 2811 bytes --]
[-- Attachment #2: test.png --]
[-- Type: image/png, Size: 34811 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-26 22:19 ` Cecil Westerhof
@ 2015-03-27 6:57 ` Cecil Westerhof
2015-03-27 9:29 ` Cecil Westerhof
0 siblings, 1 reply; 14+ messages in thread
From: Cecil Westerhof @ 2015-03-27 6:57 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1617 bytes --]
2015-03-26 23:19 GMT+01:00 Cecil Westerhof <cldwesterhof@gmail.com>:
> 2015-03-26 22:49 GMT+01:00 Nick Dokos <ndokos@gmail.com>:
>
>> Cecil Westerhof <cldwesterhof@gmail.com> writes:
>>
>> > 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.
>> >
>>
>> Just put I after K and the subgraph.
>>
>
> That works. It is even better when I put both H and I after it.
>
> I also found a way to get resources at the correct place.
>
I changed to a digraph:
#+BEGIN_SRC dot :file test.png :cmdline -Kdot -Tpng
digraph {
A
B
C
utilities [label = "Utility's"]
D
E
F [shape = rectangle]
subgraph cluster_resources {
color=blue
resources [label = "Resources"]
}
G
G_ [style="invisible"]
K
subgraph cluster_ta {
color=blue
{rank = same; L, M}
L
M
}
H
I
{rank = same; D, E, F}
{rank = same; G_, K}
A -> F
B -> F
C -> F
A -> D
utilities -> resources [style="invisible"]
E -> F
F -> K [dir = back]
F -> G [dir = back]
F -> H [dir = back]
F -> I [dir = back]
G -> G_ [style="invisible"]
K -> L
K -> M
L -> M
}
#+END_SRC
There is only one problem: I see the arrowhead with:
utilities -> resources
and:
'G -> G_'
Is there a way to get rid of those?
--
Cecil Westerhof
[-- Attachment #1.2: Type: text/html, Size: 3351 bytes --]
[-- Attachment #2: test.png --]
[-- Type: image/png, Size: 37219 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-27 6:57 ` Cecil Westerhof
@ 2015-03-27 9:29 ` Cecil Westerhof
0 siblings, 0 replies; 14+ messages in thread
From: Cecil Westerhof @ 2015-03-27 9:29 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]
2015-03-27 7:57 GMT+01:00 Cecil Westerhof <cldwesterhof@gmail.com>:
> 2015-03-26 23:19 GMT+01:00 Cecil Westerhof <cldwesterhof@gmail.com>:
>
>> 2015-03-26 22:49 GMT+01:00 Nick Dokos <ndokos@gmail.com>:
>>
>>> Cecil Westerhof <cldwesterhof@gmail.com> writes:
>>>
>>> > 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.
>>> >
>>>
>>> Just put I after K and the subgraph.
>>>
>>
>> That works. It is even better when I put both H and I after it.
>>
>> I also found a way to get resources at the correct place.
>>
>
> I changed to a digraph:
> #+BEGIN_SRC dot :file test.png :cmdline -Kdot -Tpng
> digraph {
> A
> B
> C
> utilities [label = "Utility's"]
>
> D
> E
> F [shape = rectangle]
>
>
> subgraph cluster_resources {
> color=blue
> resources [label = "Resources"]
> }
>
> G
> G_ [style="invisible"]
>
> K
> subgraph cluster_ta {
> color=blue
> {rank = same; L, M}
> L
> M
> }
> H
> I
>
> {rank = same; D, E, F}
> {rank = same; G_, K}
>
>
> A -> F
> B -> F
> C -> F
> A -> D
> utilities -> resources [style="invisible"]
>
> E -> F
>
> F -> K [dir = back]
> F -> G [dir = back]
> F -> H [dir = back]
> F -> I [dir = back]
>
> G -> G_ [style="invisible"]
>
> K -> L
> K -> M
> L -> M
> }
> #+END_SRC
>
> There is only one problem: I see the arrowhead with:
> utilities -> resources
> and:
> 'G -> G_'
>
> Is there a way to get rid of those?
>
I found that also:
[style="invisible", arrowhead = "none"]
--
Cecil Westerhof
[-- Attachment #2: Type: text/html, Size: 3964 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: How to place things differently in dot
2015-03-26 21:27 ` Cecil Westerhof
2015-03-26 21:49 ` Nick Dokos
@ 2015-03-26 21:59 ` Nick Dokos
1 sibling, 0 replies; 14+ messages in thread
From: Nick Dokos @ 2015-03-26 21:59 UTC (permalink / raw)
To: emacs-orgmode
Cecil Westerhof <cldwesterhof@gmail.com> writes:
>
> In this way I do not get an empty column.
You can make the rows be of size 0:
--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC dot :file test2.svg :cmdline -Kdot -Tsvg
graph foo {
row1--row2--row3--row4 [style="invis", fixedsize="true", width="0", height="0"];
row1, row2, row3, row4 [style="invis", fixedsize="true", width="0", height="0"];
...
--8<---------------cut here---------------end--------------->8---
Nick
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2015-03-27 9:29 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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).