[pgf-tikz] Creating directed graphs with edge labels

Henri Menke henrimenke at gmail.com
Thu Mar 5 22:19:16 CET 2020


No, there are no such plan.  I don't have the time and more importantly
not the expertise to implement this.  The graphdrawing library was
implemented by Till and his students.  Unless he picks it up again, it's
unlikely that someone else will.

Cheers, Henri

On 05/03/20, 11:29, Eric Gorr wrote:
> I am surprised that I cannot find any graph generating solution that will
> take edge labels into account while positioning.
> 
> Are there any plans to add such a feature to this project?
> 
> 
> On Wed, Mar 4, 2020 at 5:46 PM Henri Menke <henrimenke at gmail.com> wrote:
> 
> > You can draw a similar graph in TikZ as well, but there edge labels also do
> > not take part in the positioning algorithm, so overlaps have to be avoided
> > manually.
> >
> > \documentclass{article}
> > \usepackage{tikz}
> > \usetikzlibrary{graphs,graphdrawing,quotes}
> > \usegdlibrary{layered}
> > \begin{document}
> > \begin{tikzpicture}
> >     \graph[layered layout, sibling distance=3cm, level distance=3cm] {
> >         A ->[loop,"a very long label"] A,
> >         A ->[loop,min distance=4cm,"a very long label"] A,
> >         A ->["a long label" sloped] B,
> >         A ->["a long label" sloped] C,
> >         A ->["a long label" sloped] D,
> >     };
> > \end{tikzpicture}
> > \end{document}
> >
> > I don't know much about graphdrawing (I'm only the maintainer, not the
> > implementer) but I think there are no algorithm that take the labels into
> > accout.
> >
> > Cheers, Henri
> >
> > On 3/5/20 10:05 AM, Eric Gorr wrote:
> > > I would like to create a directed graph with edge labels with the
> > following
> > > properties:
> > >
> > >    1. edge labels do not overlap with each other
> > >    2. edge labels do not overlap edges
> > >    3. edge labels are drawn along the edge.
> > >
> > > For example, I can use the following graphviz graph
> > >
> > > digraph G {    splines=line;    rankdir=LR;    A -> B [label="a long
> > > label"];    A -> C [label="a long label"];    A -> A [label="a very
> > > long label"];    A -> A [label="a very long label"];    A -> D
> > > [label="a long label"];}
> > >
> > > to generate https://i.stack.imgur.com/34uVM.png
> > >
> > > However, it does not seem possible to obtain a graph with edge labels
> > with
> > > the three properties.
> > >
> > > Is creating a graph like this using PGF TIKZ possible? If so, any
> > examples
> > > for how to do so would be helpful.
> > >
> > > Thank you.
> > >
> >


More information about the pgf-tikz mailing list.