[Help wanted] How to properly add new Edge to GViewer programmatically
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- data-visualization
Research direction
No file or test is named. Start by tracing the GViewer Edge, RouteEdge, AddEdge, and LayoutEditor APIs shown in the example, then establish the supported sequence for adding an edge and why ports and layout-change handling are required. Done means documenting a working programmatic procedure and the relevant behavior.
Written by the indexing model from the issue text.
Description
Hello! Please, tell me how to create and add new Egde to GViewer programmatically?
I can't get this working without some hacks at the moment(
new_edge = gcnew Edge(ivn1->Node, ivn2->Node, ConnectionToGraph::Connected, gv->LayoutEditor->EdgeAttr->Clone());
new_edge->SourcePort = gcnew FloatingPort(new_edge->SourceNode->GeometryNode->BoundaryCurve, new_edge->SourceNode->GeometryNode->Center); // exception SourcePort is null in RouteEdge() without this
new_edge->TargetPort = gcnew FloatingPort(new_edge->TargetNode->GeometryNode->BoundaryCurve, new_edge->TargetNode->GeometryNode->Center); // exception TargetPort is null in RouteEdge() without this
IViewerEdge^ ive = gv->RouteEdge(new_edge);
gv->AddEdge(ive, false); // fails without RouteEdge()
gv->LayoutEditor->AttachLayoutChangeEvent(ive); // edge line is not moved together with nodes without this (why?)
setLabelForEdge(ive, weight);
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 319
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/automatic-graph-layout
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
microsoft/automatic-graph-layout#395 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Issue with framework reference in the GraphViewerGDI.nuspecMay be free again @levnach claimed this 251 days ago, and no pull request is open. Open
microsoft/automatic-graph-layout#390 · 6 comments · 2 reactions · 2 assignees ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/automatic-graph-layout#389 · 1 comment · 1 reaction ·
All issues in microsoft/automatic-graph-layout
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
fluentassertions/fluentassertions#3353 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 Half a day Newbie friendliness 78/100
unoplatform/uno#24769 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
AvaloniaUI/Avalonia#22323 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microsoft/onnxruntime-genai#2633 ·
Maintainers usually reply within 1 day