0

I am trying to typeset the following kind of diagram :

Interaction diagram-Word

This is an interaction diagram I would use in functional requirements analysis (drawn with MS Word). I tried to use the smartdiagram package, this is a MWE of what I did :

\documentclass{article}

\usepackage[french]{babel}

\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}
\usetikzlibrary{babel}

\RenewDocumentCommand{\smartdiagramconnect}{m m}{%
    \begin{tikzpicture}[remember picture,overlay]
    \foreach \start/\end in {#2}
    \draw[additional item arrow type,#1]
    (\start) to (\end);
    \end{tikzpicture}
}

\begin{document}
    \smartdiagramset{/tikz/connection planet satellite/.append style={<->}}
    \smartdiagramadd[constellation diagram]{System,E1,E2,E3,E4,E5,E6}{}
    \smartdiagramconnect{->, bend right=15}{satellite3/satellite7}
\end{document}

Which gives :

Draft diagram with smartdiagram

To come closer to the original, here are a few points I would like to improve :

  • Add text/label near arrows
  • Change satellites shape to ellipse could be useful if text is larger (but I've seen there are workarounds to fit the text in modules)
  • Individually change arrow types (->, <- or <->)

What I like in smartdiagram is that it cares of the formatting and it is easy to add nodes, even if some links need to be added by hand.

Is this achievable with this package (if so, any clue ?), or is plain tikZ a better way to go ?

By the way, if I activate babel package, \smartdiagramconnect does not work anymore.

EDIT: The babel issue is solved by adding \usetikzlibrary{babel}in the preamble.

2
  • 1
    Welcome to TeX.SE! Does adding \usetikzlibrary{babel} to the preamble help? I do get a reasonably nice output with the preamble \usepackage[french]{babel} \usepackage{smartdiagram} \usetikzlibrary{babel} \usesmartdiagramlibrary{additions}.
    – user121799
    Commented Aug 8, 2018 at 16:33
  • Thanks for your answer ! Yes, with \usetikzlibrary{babel}, it solves the babel-related error. I can edit this part of the question.
    – Yann
    Commented Aug 8, 2018 at 17:20

2 Answers 2

4

The conflict can be resolved by loading \usetikzlibrary{babel}. You can modify the shapes of the satellites by loading \usetikzlibrary{shapes.geometric} and then just append the shape to the style. The individual arrows can also be done. I am just afraid to modify the nice smartdiagram layout too much, but anyway, here we go.

\documentclass{article}
\usepackage[french]{babel}
\usepackage{smartdiagram}
\usetikzlibrary{babel,quotes,shapes.geometric}
\usesmartdiagramlibrary{additions}

\RenewDocumentCommand{\smartdiagramconnect}{m m}{%
    \begin{tikzpicture}[remember picture,overlay]
    \foreach \start/\end in {#2}
    \draw
    (\start) edge[additional item arrow type,#1] (\end);
    \end{tikzpicture}
}

\NewDocumentCommand{\smartdiagramindividualconnect}{m}{%
    \begin{tikzpicture}[remember picture,overlay]
    \foreach \Y/\Z [count=\X starting from 2] in {#1}
    {
    \draw[additional item arrow type,\Y] (planet) to 
    node[midway,sloped,above]{\Z}
    (satellite\X) ;}
    \end{tikzpicture}

}

\tikzset{satellite/.append style={shape=ellipse}}
\begin{document}
    \smartdiagramset{/tikz/connection planet satellite/.append style={draw=none}}
    \smartdiagramadd[constellation diagram]{System,E1,E2,E3,E4,E5,E6}{}
    \smartdiagramconnect{->, bend right=15,"hello" near end,sloped}{satellite3/satellite7}
    \smartdiagramindividualconnect{{<->/A},{->/B},{>-/C}}
\end{document}

enter image description here

2
  • Thanks for your help! Now I can see which small hacks could be used to achieve the 3 goals I mentioned, but as you said we are shifting from the original automated diagram approach.
    – Yann
    Commented Aug 9, 2018 at 8:21
  • @Yann It is not necessarily a "bad" thing to modify these diagrams so drastically. I only want to argue that, if you are able to modify this diagram in that way, you will perhaps also be able to do the whole diagram from scratch. On the other hand the smartdiagram manual is superb. All things are written very explicitly there such that you can modify it rather easily, provided you are somewhat familiar with TikZ.
    – user121799
    Commented Aug 9, 2018 at 14:14
3

Just for fun an option usign basic tikz commands to obtain the example graph...

RESULT: enter image description here

MWE:

\documentclass[border=10pt,tikz]{standalone}
\usetikzlibrary{shapes.geometric,arrows.meta,shadows.blur}
\renewcommand*\familydefault{\sfdefault} % Set font to serif family
\begin{document}

\begin{tikzpicture}[
    %Environment config
    %Environment Styles
    Node/.style={draw=#1, bottom color=#1!40, top color=#1!5, align=center,blur shadow},
    MyArrow/.style={draw,line width=2.5pt,>={Stealth[inset=0pt,length=7pt]},blue!60!black,font=\bf\scriptsize,text width=1.5cm }
    ]

    %Drawing the nodes
    %\node[tikzstyle, label=angle_orientation:Text](Node_coordinate_Identifier) at (position_in_polar_coordinates){Text_none};
    \node[Node=violet, circle, font=\bf](MSGE) at (0,0){MGSE\\ validation \\ Intégration\\FWA };
    \node[Node=blue!80!cyan, circle, minimum width=2.3cm](OUT) at (30:3.2){Outils};
    \node[Node=blue!80!cyan, ellipse, minimum height=2.3cm](OP-IN) at (90:3.5){Opérateur \\ intégrateur};
    \node[Node=blue!80!cyan, ellipse, minimum height=2.3cm](ENV) at (150:3.8){Environnement};
    \node[Node=blue!80!cyan, circle, minimum width=2.3cm](OPVP) at (-150:3.5){Outillage \\ poste \\ vertical P2};
    \node[Node=blue!80!cyan, circle, minimum width=2.3cm](MP) at (-90:3.2){Mousses \\ de \\ protection};
    \node[Node=blue!80!cyan, ellipse, minimum height=2.8cm,minimum width=3.7cm](OMI) at (-30:4.2){Outillage de \\ manutention \\ intégration};


    %Drawing the arrows
    \draw[MyArrow,<-] (MSGE) --(OUT) node [midway, anchor=west,rotate=-60,black,font=\bf\scriptsize ]{FSA6.9};
    \draw[MyArrow,<->] (MSGE) --(OP-IN) node [midway](Aux1){};
    \draw[MyArrow,<-,thick,blue!50](Aux1.center) -- ++(1,0.3) node [anchor=west,rotate=60,black]{FSA6.11'};
    \draw[MyArrow,<->] (MSGE) --(ENV) node [midway, anchor=west,rotate=60,black]{FSA6.3' FSA6.4'};
    \draw[MyArrow,<->] (MSGE) --(OPVP) node [midway, anchor=west,rotate=-60,black]{FSA6.7' FSA6.8'};
    \draw[MyArrow,<-] (MSGE) --(MP) node [pos=0.8, anchor=west,rotate=0,black,inner sep=0pt]{FSA6.10'};
    \draw[MyArrow,<->] (MSGE) --(OMI) node [midway, anchor=east,rotate=60,black,text width=1cm,inner sep=-2pt]{FSA6.5' FSA6.6'};
    \draw[MyArrow,->] (OP-IN) to [bend left=20] node [pos=0.7, anchor=east,inner sep=0pt]{FSU6.21} (OPVP) ;
    \draw[MyArrow,->] (OP-IN) to [bend right=20] node [pos=0.8, anchor=west,inner sep=10pt]{FSU6.11} (OMI);

    \end{tikzpicture}
\end{document}
2
  • I agree with you that this is better than customizing the nice smartdiagram style beyond recognition. +1, as usual.
    – user121799
    Commented Aug 8, 2018 at 22:53
  • Thanks! Yes, it seems more straightforward and cleaner to get the original result (not that the original diagram is an example of graphical aesthetics...). But from the ergonomic point of view, everything is manual. I guess a specialised package (or smartdiagram style ?) would be necessary if we wanted TeX to take care of the formatting (in a document, one could easily get 5-10 diagrams like this one).
    – Yann
    Commented Aug 9, 2018 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .