Yes, there is a way to place labels close to the start or end node of an edge. Property "Placement" determines the position of a label. Instead of using the default value "SmartFree: Anywhere" use "6 Pos: Source Head" to place a label close to the start node or "6 Pos: Target Head" to place a label close to the end node.
If you plan to modify you python script to generate GraphML files with appropriate label definition right from the start, I suggest creating a trivial diagram with only two nodes, one edge, and two edge labels (one with placement "6 Pos: Source Head" and one with placement "6 Pos: Target Head"), saving the diagram as GraphML, and inspecting the resulting file for the required XML elements. Look for <y:EdgeLabel> elements, the important attributes are modelName and modelPosition:
<y:EdgeLabel ... modelName="six_pos" modelPosition="shead">
...
</y:EdgeLabel>
<y:EdgeLabel ... modelName="six_pos" modelPosition="thead">
...
</y:EdgeLabel>
If you prefer to stick to using properties mapper instead of modifying the script, you can use the following approach:
-
Create a user-defined palette section (see section Palette Manager in the yEd manual for documentation on creating palette sections).
-
Create an edge with two labels as mentioned above (i.e. one label with placement "6 Pos: Source Head" and another one with placement "6 Pos: Target Head").
-
Right-click the edge to open its context menu and choose "Add to Palette".
-
In your properties mapper edge configuration choose "Template: Single" and select the palette template corresponding to the edge from step 2.
-
Map your source and destination properties to labels #1 and #2.