jamesscottbrown / pyyed

A simple Python library to export networks to yEd
BSD 3-Clause "New" or "Revised" License
82 stars 38 forks source link

Position of edge label #27

Closed laimaretto closed 3 years ago

laimaretto commented 4 years ago

Hi! This is a grate library! Thanks for doing it...

Do you think is possible to add new arguments to ...

def __init__(self, node1, node2, label="", arrowhead="standard", arrowfoot="none",
                 color="#000000", line_type="line", width="1.0", edge_id=""):

... so as to be able to control label position (ie: center) for the edge label?

Thanks!

Lucas

jamesscottbrown commented 4 years ago

This is definitely something that would be possible to do.

However, there are quite a few label positions supported by yEd (in the graphml it generates there are several different possibilities for the modelName, some with several compatible choices of modelPosition).

Unfortunately I don't currently have time to investigate further and implement this.

jamesscottbrown commented 4 years ago

Note that if you just want to control whether a label is at the source-end/middle/target-end of an edge, you can now achieve this by using the appropriate argument (one of label/label_source/label_target) to add_edge()

jamesscottbrown commented 3 years ago

I've just merged a PR (https://github.com/jamesscottbrown/pyyed/pull/44) from @Martinus-Maximus that provides a way to add node/edge labels at specific positions; this feature should now be available in pyyed v 1.5.0.