magjac / d3-graphviz

Graphviz DOT rendering and animated transitions using D3
BSD 3-Clause "New" or "Revised" License
1.68k stars 103 forks source link

Display edge-lables #172

Closed mayrmartin closed 4 years ago

mayrmartin commented 4 years ago

Pretty new to this library so I'm sure I'm overseeing something. I have a Digraph with edge labels like this generated by the python pydot library

digraph  {
    A [color=red, fillcolor=red];
    B;
    C;
    A -> B [weight=2,time=3]
    B -> C [weight=2,time=3]
}

When I try to render the dot file with your library, none of the edge labels are shown. Is there a possibility, to somehow access the labels or to display at least one of the labels?

magjac commented 4 years ago

Edge labels must be specified with the label attribute like so:

digraph  {
    A [color=red, fillcolor=red];
    B;
    C;
    A -> B [label="weight=2,time=3"]
    B -> C [label="weight=2,time=3"]
}

Try it yourself in the Graphviz Visual Editor.

If you have further questions about the DOT language, I recommend you to sign up to the Graphviz forum.