I'm trying to draw a curved arrow that passes through multiple nodes. This is for a beamer presentation. The idea of the frame is to pose the audience a question, tell them the answer, and then gradually go through a roadmap of the steps involved as follows:
I have three questions:
- How to draw the blue arrow (more aesthetically pleasing)? By this, I mean, smaller arrow head, arrow should be incident onto the 'Answer' node. And the nodes should be "above" the arrow, as in, the arrow should be "sent behind" the nodes.
- How to reveal a part of the arrow along with the stops along the roadmap. i.e, (part of arrow+Stop 1+Comment 1) appear on first click (slide 2).
- Reveal the 'question' and 'answer' first, then the roadmap. But currently the positioning of the 'answer' is relative to the roadmap and beamer doesn't reveal it until the end. What am I doing wrong here?
I am looking to move forward with minimum code-disruption. Thank you. A MWE is attached.
\documentclass[usenames, dvipsnames]{beamer}
\usepackage{tikz}
\usepackage{amsmath}
\usetikzlibrary{automata,fit, backgrounds,shapes,arrows,calc,positioning}
\begin{document}
% Define block styles
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{wideblock} = [rectangle, draw, fill=blue!20,
text width=8em, text centered, rounded corners, minimum height=4em]
\tikzstyle{greenblock} = [rectangle, draw, fill=ForestGreen!20,
text width=8em, text centered, rounded corners, minimum height=4em]
\tikzstyle{plainblock} = [rectangle, draw, fill=blue!05,
text width=8em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\begin{frame}{How we got to the answer}
\resizebox{0.8\linewidth}{!}{%
\begin{tikzpicture}[node distance = 7cm, auto]
\linespread{1}
\node[wideblock,text width=16em](main_ques){Question?};
%first stop along the road-map
\onslide<2->\node[plainblock, yshift=-1cm, right of = main_ques](map1){Stop 1};
\onslide<2->\node[plainblock, right of = map1](map1_comment){Comment 1};
\onslide<2->\path[line](map1) -- (map1_comment);
%second stop along the road-map
\onslide<3->\node[plainblock, yshift=-3cm, right of = map1, node distance = 2cm](map2){Stop 2};
\onslide<3->\node[plainblock, right of = map2](map2_comment){Comment 2};
\onslide<3->\path[line](map2) -- (map2_comment);
%third stop along the road-map
\onslide<4->\node[plainblock, yshift=-3cm, node distance = 2cm, right of = map2](map3){Stop 3};
\onslide<4->\node[plainblock, right of = map3](map3_comment){Comment 3};
\onslide<4->\path[line](map3) -- (map3_comment);
%fourth stop along the road-map
\onslide<5->\node[plainblock,yshift=-1cm, node distance = 2cm, below of = map3](map4){Stop 4};
\onslide<5->\node[plainblock, right of = map4](map4_comment){Comment 4};
\onslide<5->\path[line](map4) -- (map4_comment);
%fifth stop along the road-map
\onslide<6->\node[plainblock,yshift=-3cm, node distance = 2cm, left of = map4](map5){This is a really really long sentence};
\onslide<6->\node[plainblock, right of = map5](map5_comment){comment 5};
\onslide<6->\path[line](map5) -- (map5_comment);
%Sixth stop along the road-map
\onslide<7->\node[plainblock,yshift=-3cm, node distance = 2cm, left of = map5](map6){Stop 5};
\onslide<7->\node[plainblock, right of = map6, text width = 12em](map6_comment){This is a very long comment that requires a bigger text box};
\onslide<7->\path[line](map6) -- (map6_comment);
%This is the answer that should appear on the first slide itself.
\node[greenblock, yshift=-1cm, left of = map6](ans){Answer};
\path[line](main_ques) -- (ans);
\end{tikzpicture}}
\end{frame}
\end{document}
\tikzstyle
is deprecated.\onslide<7->{...}
rather than just\onslide<7->...
which affects everything following it, including your final node.