tikz 节点内的节点

tikz 节点内的节点

我不确定如何将这三个节点定位在其他“受托人特征”内。尝试过矩形,但我认为这不是正确的方法。此外,箭头应该在“外部节点”的外部结束/开始。整个图形偏离中心,宽度为两倍。我怎样才能让它正确居中?

this it what it looks like

it should more look like this

 \documentclass{article}
\usepackage{tikz}
\usepackage{enumitem}
\usetikzlibrary{shapes.geometric, arrows, calc, fit, positioning, chains, arrows.meta}

%%% styles for Figure: Structure of the paper %%%
\tikzset{arrow/.style = {thick,->,>=stealth,}}
\tikzset{arrow2/.style = {thick,dotted,->,>=stealth,}}
\tikzset{nearnodes/.style={node distance=0.8cm,}}
\tikzset{farnodes/.style={node distance=4.5cm}}

\tikzset{model1/.style = {rectangle, text width=3cm, minimum height=1cm,text centered, draw=black, fill=white!30,}}
\tikzset{model2/.style = {rectangle, text width=3cm, minimum height=1cm,text centered, draw=black, fill=white!30,}}

\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}

%%% nodes %%%
\node[farnodes] (DLE) [model1] {
\textbf{Digital Leadership Environment (DLE)}
\begin{itemize}[leftmargin=.19in]
\item Agile management and leadership
\item Hierarchies and networks
\item Dual system
\item Leadership on all levels
\item Project teams
\item Distributed and virtual team resources
\end{itemize}
};

\node[nearnodes] (benevolence) [model1, right =of DLE] {
\textbf{Benevolence} 
\begin{itemize}[leftmargin=.19in]
  \item Create/Sustain supportive context
  \item Transformative leadership
  \item Coaching behaviour
\end{itemize}
};

\node[nearnodes] (ability) [model1, above =of benevolence] {
\textbf{Ability} 
\begin{itemize}[leftmargin=.19in]
  \item Social capital/virtual impression
  \item Compelling direction
  \item Enabling Structure 
\end{itemize}
};

\node[nearnodes] (integrity) [model1, below =of benevolence] {
\textbf{Integrity} 
\begin{itemize}[leftmargin=.19in]
  \item Self organization and reliance
  \item Accountability
  \item Value congruence
\end{itemize}
};

\node[nearnodes] (trust) [model2, right =of benevolence] {
\textbf{Leadership trust}
};

\node[nearnodes] (individual) [model1, above =of trust] {
\textbf{Individual factors} 
\begin{itemize}[leftmargin=.19in]
  \item Leader reputation (trustee)
  \item Propensity and intention to trust (trustor)
  \item Perceived risk (trustor)
\end{itemize}
};

\node[nearnodes] (other) [model1, below =of trust] {
\textbf{Other factors} 
\begin{itemize}[leftmargin=.19in]
  \item Swift trust
  \item Cultural factors
  \item Trust violation
  \item Emotions
\end{itemize}
};

\node[nearnodes] (outcomes) [model1, right =of trust] {
\textbf{Outcomes} 
\begin{itemize}[leftmargin=.19in]
  \item Employee and team performance
  \item Organizational citizenship behaviour
  \item Willingness to follow
  \item Communication
  \item Learning and knowledge sharing 
\end{itemize}
};

%%%% ARROWS %%%
\draw [arrow2] (DLE) -- (benevolence);
\draw [arrow] (benevolence) -- (trust);
\draw [arrow] (individual) -- (trust);
\draw [arrow] (other) -- (trust);
\draw [arrow] (trust) -- (outcomes);

%%%% RECTANGLES %%%
\node[draw, thick, inner xsep=1em, inner ysep=1em, fit=(ability) (benevolence) (integrity)] (box) {};
\node[fill=white] at (box.north) {Trustee characteristics};

\end{tikzpicture}
\caption{Integrated trust model} \label{fig:model}
\end{figure}
\end{document}

答案1

您在找这个吗?

\documentclass{article}
\usepackage{tikz}
\usepackage{enumitem}
\usetikzlibrary{shapes.geometric, arrows, calc, fit, positioning, chains, arrows.meta}

%%% styles for Figure: Structure of the paper %%%
\tikzset{arrow/.style = {thick,->,>=stealth,}}
\tikzset{arrow2/.style = {thick,dotted,->,>=stealth,}}
\tikzset{nearnodes/.style={node distance=0.8cm,}}
\tikzset{farnodes/.style={node distance=4.5cm}}

\tikzset{model1/.style = {rectangle, text width=3cm, minimum height=1cm,text centered, draw=black, fill=white!30,}}
\tikzset{model2/.style = {rectangle, text width=3cm, minimum height=1cm,text centered, draw=black, fill=white!30,}}

\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}

%%% nodes %%%
\node[farnodes] (DLE) [model1] {
\textbf{Digital Leadership Environment (DLE)}
\begin{itemize}[leftmargin=.19in]
\item Agile management and leadership
\item Hierarchies and networks
\item Dual system
\item Leadership on all levels
\item Project teams
\item Distributed and virtual team resources
\end{itemize}
};

\node[nearnodes] (benevolence) [model1, right =of DLE] {
\textbf{Benevolence} 
\begin{itemize}[leftmargin=.19in]
  \item Create/Sustain supportive context
  \item Transformative leadership
  \item Coaching behaviour
\end{itemize}
};

\node[nearnodes] (ability) [model1, above =of benevolence] {
\textbf{Ability} 
\begin{itemize}[leftmargin=.19in]
  \item Social capital/virtual impression
  \item Compelling direction
  \item Enabling Structure 
\end{itemize}
};

\node[nearnodes] (integrity) [model1, below =of benevolence] {
\textbf{Integrity} 
\begin{itemize}[leftmargin=.19in]
  \item Self organization and reliance
  \item Accountability
  \item Value congruence
\end{itemize}
};

\node[nearnodes] (trust) [model2, right =of benevolence] {
\textbf{Leadership trust}
};

\node[nearnodes] (individual) [model1, above =of trust] {
\textbf{Individual factors} 
\begin{itemize}[leftmargin=.19in]
  \item Leader reputation (trustee)
  \item Propensity and intention to trust (trustor)
  \item Perceived risk (trustor)
\end{itemize}
};

\node[nearnodes] (other) [model1, below =of trust] {
\textbf{Other factors} 
\begin{itemize}[leftmargin=.19in]
  \item Swift trust
  \item Cultural factors
  \item Trust violation
  \item Emotions
\end{itemize}
};

\node[nearnodes] (outcomes) [model1, right =of trust] {
\textbf{Outcomes} 
\begin{itemize}[leftmargin=.19in]
  \item Employee and team performance
  \item Organizational citizenship behaviour
  \item Willingness to follow
  \item Communication
  \item Learning and knowledge sharing 
\end{itemize}
};

%%%% ARROWS %%%
\draw [arrow] (individual) -- (trust);
\draw [arrow] (other) -- (trust);
\draw [arrow] (trust) -- (outcomes);

%%%% RECTANGLES %%%
\node[draw, thick, inner xsep=1em, inner ysep=1em, fit=(ability) (benevolence) (integrity)] (box) {};
\draw [arrow2] (DLE) -- (benevolence-|box.west);
\draw [arrow] (benevolence-|box.east) -- (trust);
\node[fill=white] at (box.north) {Trustee characteristics};

\end{tikzpicture}
\caption{Integrated trust model} \label{fig:model}
\end{figure}
\end{document}

enter image description here

相关内容