TransWikia.com

Changing arrows to dashed line in smartdiagram

TeX - LaTeX Asked by mariabc on December 8, 2020

I am trying to customize a circular diagram using smartdiagram. I have two issues:

  1. I have added three additional arrows but would like these to be dashed or dotted.
  2. I have added code to show text above the arrow connecting module 7 and module 6, but it is not showing up.
    Here is the current code:
documentclass{article}
usepackage{smartdiagram}
usesmartdiagramlibrary{additions} 
begin{document}
begin{figure}[ht]
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}
}
    centering
smartdiagramset{uniform color list=teal!60 for 7 items,
                    module x sep=3.75,
                    back arrow distance=0.75,
                    sequence item border color=black,
                    uniform arrow color=true,
                    arrow color=gray!50!black,
                    circular distance=5cm,
                    font=large,
                    text width=2.5cm,
                    module minimum width=2.5cm,
                    module minimum height=1.5cm,
                    arrow line width=2.5pt,
                    arrow tip=to,
                additions={
                    additional arrow style=,
                    additional arrow color=black,               additional arrow line width=2pt,
                }
                    } 
smartdiagramadd[circular diagram:clockwise]{
    1-Define the construct,2-Identify and describe facets,3-Determine facet levels,4-Determine scenario structure,5-Develop mapping sentences and build scenarios,6-Select response options and survey instructions,7-Test (and retest)
    }
    {}
    smartdiagramconnect{->, shorten <=8pt, shorten >=8pt, bend left=30, "no"{midway,above right,text=black}}{module7/module6}
      smartdiagramconnect{->, shorten <=8pt, shorten >=8pt, bend left=30,}{module6/module5, module5/module4}
end{figure}
end{document}

One Answer

Adding dashed in the arrow style gives your first requirement

                additions={
                additional arrow style=dashed,
                additional arrow color=black,   
                additional arrow line width=2pt,
                          }

enter image description here

EDIT -- for the labels

I found it easier to apply TiKz which is a superset of smartdiagram -- deleting about 15 lines of smartdiagramconnect and additions and adding the decorations library the dashed arrows and labels are easily positioned

enter image description here

Using

        -stealth,
        line width=1mm,
        red!40,
        dashed,

the arrows are defined

With the help of decoration

                    postaction={decorate,
                    decoration={text along path,
                                text align=center,
                                text={Diatessaron},
                                raise=5pt}}

the labels are positioned and raised 5pt

With the help of

(module6.north east) to[out = 45, in = 85, looseness = 1.2] (module5.north 
west);

the anchors are provided to the corner of the module and the arrow angle of departure and arrival are added

With the help of xshift anchor position can be shifted to the left or right

([xshift=.5cm]module5.north) to[out = 90, in = 180, looseness = 1.2] 
(module4.west);

Complete MWE

documentclass{article}
usepackage{smartdiagram}
usesmartdiagramlibrary{additions} 
    usetikzlibrary{arrows,quotes,calc,decorations.text,positioning} 
begin{document}
    begin{figure}[ht]
        centering
        smartdiagramset{uniform color list=teal!60 for 7 items,
            module x sep=3.75,
            back arrow distance=0.75,
            sequence item border color=black,
            uniform arrow color=true,
            arrow color=gray!50!black,
            circular distance=5cm,
            font=large,
            text width=2.5cm,
            module minimum width=2.5cm,
            module minimum height=1.5cm,
            arrow line width=2.5pt,
            arrow tip=to,
        } 
        smartdiagramadd[circular diagram:clockwise]{
            1-Define the construct,2-Identify and describe facets,3-Determine facet levels,4-Determine scenario structure,5-Develop mapping sentences and build scenarios,6-Select response options and survey instructions,7-Test (and retest)
        }
        {}
        begin{tikzpicture}[overlay]
        draw[-stealth,
                line width=1mm,
                red!40,
                dashed,
                postaction={decorate,
                            decoration={text along path,
                                        text align=center,
                                        text={Diatessaron},
                                        raise=5pt}}] 
        (module7.south east) to[out = -45, in = 85, looseness = 1.2] (module6.north);
        
        draw[-stealth,
                line width=1mm,
                red!40,
                dashed,
                postaction={decorate,
                            decoration={text along path,
                                        text align=center,
                                        text={Diatessaron},
                                        raise=5pt}}] 
        (module6.north east) to[out = 45, in = 85, looseness = 1.2] (module5.north west);
        
        draw[-stealth,
                line width=1mm,
                red!40,
                dashed,
                postaction={decorate,
                            decoration={text along path,
                                        text align=center,
                                        text={Diatessaron},
                                        raise=5pt}}] 
        ([xshift=.5cm]module5.north) to[out = 90, in = 180, looseness = 1.2] (module4.west);
        end{tikzpicture}  
    end{figure}
end{document}

Correct answer by js bibra on December 8, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP