Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

distance between threads #9

Open
GoogleCodeExporter opened this issue May 7, 2015 · 11 comments
Open

distance between threads #9

GoogleCodeExporter opened this issue May 7, 2015 · 11 comments

Comments

@GoogleCodeExporter
Copy link

define the edge distance for threads too and not only for instances.

Original issue reported on code.google.com by [email protected] on 15 Sep 2011 at 5:38

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

% new an instance thread
% Example:
% \newthread[edge distance]{var}{thread name}
\newcommand{\newthread}[3][0.2]{
  \newinst[#1]{#2}{#3}
  \stepcounter{threadnum}
  \node[below of=inst\theinstnum,node distance=0.8cm] (thread\thethreadnum) {};
  \tikzstyle{threadcolor\thethreadnum}=[fill=gray!30]
  \tikzstyle{instcolor#2}=[fill=gray!30]
}

Original comment by [email protected] on 11 Apr 2012 at 1:28

@GoogleCodeExporter
Copy link
Author

If we could choose the distance AND the color it would be perfect.

Original comment by [email protected] on 14 Jul 2012 at 8:44

@ebousse
Copy link

ebousse commented Feb 11, 2017

This would be great to have! :)

@golvok
Copy link

golvok commented Feb 15, 2017

my workaround was this

\begin{sequencediagram}
\newthread{P1}{P1}
\tikzstyle{inststyle}+=[below right=-0.85cm and 2cm of P1]
\newthread{P2}{P2}
\tikzstyle{inststyle}+=[below right=-0.85cm and 2cm of P2]
\newthread{P3}{P3}
\end{sequencediagram}

which works, but isn't that great.

@muryoutaisuu
Copy link

muryoutaisuu commented Sep 30, 2018

my workaround was this

\begin{sequencediagram}
\newthread{P1}{P1}
\tikzstyle{inststyle}+=[below right=-0.85cm and 2cm of P1]
\newthread{P2}{P2}
\tikzstyle{inststyle}+=[below right=-0.85cm and 2cm of P2]
\newthread{P3}{P3}
\end{sequencediagram}

which works, but isn't that great.

for everyone else wondering about Unknown operator `a' or `an' errors: also add \usetikzlibrary{positioning} to your document

@white-gecko
Copy link

% new an instance thread
% Example:
% \newthread[edge distance]{var}{thread name}
\newcommand{\newthread}[3][0.2]{
  \newinst[#1]{#2}{#3}
  \stepcounter{threadnum}
  \node[below of=inst\theinstnum,node distance=0.8cm] (thread\thethreadnum) {};
  \tikzstyle{threadcolor\thethreadnum}=[fill=gray!30]
  \tikzstyle{instcolor#2}=[fill=gray!30]
}

Original comment by [email protected] on 11 Apr 2012 at 1:28

Derived from this I've also added a color option:

% new command for adding a distance option for threads as well
% \newthread[color][distance]{id}{title}
\RequirePackage{xargs}
\renewcommandx{\newthread}[4][1=gray!30, 2=0.2]{
  \newinst[#2]{#3}{#4}
  \stepcounter{threadnum}
  \node[below of=inst\theinstnum,node distance=0.8cm] (thread\thethreadnum) {};
  \tikzstyle{threadcolor\thethreadnum}=[fill=#1]
  \tikzstyle{instcolor#3}=[fill=#1]
}

@Tvde1
Copy link

Tvde1 commented Nov 12, 2018

I'm also wondering why this isn't possible yet

@yegor256
Copy link

yegor256 commented May 3, 2020

would be great to have it!

@debasish-raychawdhuri
Copy link

Surely, it seems quite essential.

joneppie added a commit to joneppie/pgf-umlsd that referenced this issue Dec 6, 2020
@timothyt87
Copy link

#33 I've tried this, and this is working, thank you :D you just made my day

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants