Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with sloped in grow cyclic tree. #770

Closed
CodingComputing opened this issue Nov 7, 2019 · 0 comments
Closed

Problem with sloped in grow cyclic tree. #770

CodingComputing opened this issue Nov 7, 2019 · 0 comments
Milestone

Comments

@CodingComputing
Copy link

CodingComputing commented Nov 7, 2019

Stack Exchange link (https://tex.stackexchange.com/questions/515386/tikz-problem-with-sloped-in-cyclic-tree/).

In a grow cyclic tree, using sloped does not affect the sloping of a node on edge from parent.

Code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{trees}
\usetikzlibrary{graphs}
\usetikzlibrary{positioning}
\renewcommand{\baselinestretch}{1.3}
\begin{document}
\begin{tikzpicture}[
sloped,
minimum size=6mm,
align=flush center,
concept/.style={
    draw=#1!80!black,
    very thick,
    fill=#1!25,
    rounded corners
},
concept/.default=white,
description/.style={
    font=\footnotesize,
    draw,
    dashed
},
]
\node [concept=black] {EQUITY\\MARKETS} [
grow cyclic,
sibling angle=120,
level distance=5em
]
child {
child {
    node [concept={red}] {Private} [sibling angle=90]
    child {node [description]   {Not listed on\\Stock Exchange} }
    child {
        node [concept={orange}] {Private\\Equity Fund}
        child{ node [description={above}] {Organization} }
        child { [level distance=3em, sibling angle=60]
            child{ [sibling angle=60, level distance=5em]
                child {node {Venture\\Capital} }
                child {node {Growth\\Capital} }
                child {node {Leverage\\Buyout} }
            }
            edge from parent
            node [midway, sloped] {Strategies} 
        }
    }
}
child {
    node [concept={blue}] {Public}
    child {node [description] {Listed on\\Stock Exchange} }
}
edge from parent
node [midway,sloped] {Types} 
}
child { node[description={right}] {Ownership\\of Entity} }
;
\end{tikzpicture}
\end{document}

Gives this output: https://i.stack.imgur.com/pDf2z.png
The words Types and Strategies are not being sloped.
They are rendered as horizontal text.


Credits to tex.stackexchange user Schrodinger's Cat [link to answer] for having identified the hack to make the required text sloped.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{trees,scopes}
\begin{document}
\begin{tikzpicture}[
minimum size=6mm,
align=flush center,
concept/.style={
    draw=#1!80!black,
    very thick,
    fill=#1!25,
    rounded corners
},
concept/.default=white,
description/.style={
    font=\footnotesize,
    draw,
    dashed
},
edge from parent macro=\mymacro
]
\def\mymacro#1#2{[style=edge from parent, #1]
{[/utils/exec=\pgftransformreset](\tikzparentnode\tikzparentanchor) -- #2
(\tikzchildnode\tikzchildanchor)} }
\node [concept=black] {EQUITY\\MARKETS} [
grow cyclic,
sibling angle=120,
level distance=5em
]
child {
child {
    node [concept={red}] {Private} [sibling angle=90]
    child {node [description]   {Not listed on\\Stock Exchange} }
    child {
        node [concept={orange}] {Private\\Equity Fund}
        child{ node [description={above}] {Organization} }
        child { [level distance=3em, sibling angle=60]
            child{ [sibling angle=60, level distance=5em]
                child {node {Venture\\Capital} }
                child {node {Growth\\Capital} }
                child {node {Leverage\\Buyout} }
            }
            edge from parent
            node [pos=1.2,sloped,above] {Strategies} 
        }
    }
}
child {
    node [concept={blue}] {Public}
    child {node [description] {Listed on\\Stock Exchange} }
}
edge from parent
node [pos=0.6,sloped,above] {Types} 
}
child { node[description={right}] {Ownership\\of Entity} };
\end{tikzpicture}
\end{document}

Request to the authors to either fix the unexpected behaviour, or mentioning in the manual about this caveat.

Thanks.

hmenke added a commit to hmenke/pgf that referenced this issue Nov 8, 2019
hmenke added a commit to hmenke/pgf that referenced this issue Nov 8, 2019
@hmenke hmenke added this to the 3.1.5 milestone Nov 10, 2019
@hmenke hmenke closed this as completed Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants