Interpreting edge label position
See original GitHub issueHi,
Please consider the following Klay JSON:
{
"id": "root",
"labels": [
{
"text": "root"
}
],
"edges": [
{
"id": "off_on",
"source": "off",
"target": "on",
"labels": [
{
"text": "touch",
"width": 10.140625,
"height": 5
}
]
},
{
"id": "on_off",
"source": "on",
"target": "off",
"labels": [
{
"text": "touch",
"width": 10.140625,
"height": 5
}
]
}
],
"width": 10,
"height": 10,
"children": [
{
"id": "off",
"labels": [
{
"text": "off"
}
],
"edges": [],
"width": 10,
"height": 10
},
{
"id": "on",
"labels": [
{
"text": "on"
}
],
"edges": [],
"width": 10,
"height": 10
}
]
}
When layout is applied, this yields the following kgraph:
{
"id": "root",
"labels": [
{
"text": "root"
}
],
"edges": [
{
"id": "off_on",
"source": "off",
"target": "on",
"labels": [
{
"text": "touch",
"width": 10.140625,
"height": 5,
"x": 37.99999952316284,
"y": 0
}
],
"sourcePoint": {
"x": 88.14062404632568,
"y": 24
},
"targetPoint": {
"x": 22,
"y": 24
},
"junctionPoints": []
},
{
"id": "on_off",
"source": "on",
"target": "off",
"labels": [
{
"text": "touch",
"width": 10.140625,
"height": 5,
"x": 37.99999952316284,
"y": 16
}
],
"sourcePoint": {
"x": 22,
"y": 27.333333333333332
},
"targetPoint": {
"x": 88.14062404632568,
"y": 27.333333333333336
},
"bendPoints": [
{
"x": 35.99999976158142,
"y": 27.333333333333332
},
{
"x": 35.99999976158142,
"y": 40
},
{
"x": 74.14062428474426,
"y": 40
},
{
"x": 74.14062428474426,
"y": 27.333333333333336
}
],
"junctionPoints": []
}
],
"width": 110.14062404632568,
"height": 53,
"children": [
{
"id": "off",
"labels": [
{
"text": "off"
}
],
"edges": [],
"width": 10,
"height": 10,
"x": 88.14062404632568,
"y": 20.666666666666668,
"$H": 26
},
{
"id": "on",
"labels": [
{
"text": "on"
}
],
"edges": [],
"width": 10,
"height": 10,
"x": 12,
"y": 20.666666666666664,
"$H": 27
}
],
"$H": 1
}
I was wondering if you could guide me as to how to interpret the x and y values of the edge labels.
When both edge labels are interpreted as being in the coordinate space (sharing the offset of) node “on”, then this renders beautifully:
![screen shot 2016-04-12 at 12 12 14 am](https://cloud.githubusercontent.com/assets/586962/14452396/45e39066-0043-11e6-8e00-24555d6a2856.png)
However it is unclear to me how to characterize the general relationship between these edge coordinates and node “on”. For example, edge “on_off” has a relationship with “on” such that “on” is the source of “on_off”. But this is not true of edge “off_on” - in this case node “on” is the target.
I would appreciate any guidance you can offer on how to interpret these coordinates. Thank you.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Edge Label Placement Demo - yFiles for HTML
This demo shows how to place edge labels at the preferred location with a labeling algorithm and the PreferredPlacementDescriptor type.
Read more >On the complexity of the Edge Label Placement problem
We consider the problem of positioning text or symbol labels corresponding to edges of G, called the Edge Label Placement (ELP) problem. The...
Read more >Edge Attributes | Graphviz
head_lp – Center position of an edge's head label. For write only. headclip – If true, the head of an edge is clipped...
Read more >Adjust edge label position in mediation diagram with ...
The bottom edge label is not centered and the two angled edge labels are positioned at different heights (see the red lines in...
Read more >EdgeLabels - Wolfram Language Documentation
EdgeLabels is an option and annotation for Graph and related functions that specifies what labels and label positions should be used for edges....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like a bug in the position application code. I’ll look into it. Thanks for mentioning the issue.
I opened a related issue here: #9. Thank you.