Graph.Read ignores subgraph in Wpf
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the Graph.Write and Graph.Read calls in the supplied reproduction, then inspect how GraphViewer binds the reloaded graph to the WPF DockPanel. Compare the original graph's subgraph membership and attributes with the graph returned by Graph.Read; done means the reloaded graph displays the subgraph with its nodes and styling intact.
Written by the indexing model from the issue text.
Description
Hi! I am create a graph add nodes and edges, and put some nodes in a subgraph. Then I am write this graph to *.msagl file and open with Graph.Read from this file and bind it to DockPanel. It display graph with all nodes and edges, but without subgraph.
Code:
GraphViewer graphViewer = new GraphViewer();
Graph graph = new();
graphViewer.BindToPanel(graphViewerPanel);
var a =graph.AddNode("A");
var b = graph.AddNode("B");
var c = graph.AddNode("C");
var d = graph.AddNode("D");
var f = graph.AddNode("F");
b.Attr.Shape = Shape.Hexagon;
var ab = graph.AddEdge(a.Id, b.Id);
var fc = graph.AddEdge(f.Id, c.Id);
var da = graph.AddEdge(d.Id, a.Id);
var fa = graph.AddEdge(a.Id, f.Id);
var s = new Subgraph("sub_Id");
s.Attr.Color = Microsoft.Msagl.Drawing.Color.Red;
s.Attr.FillColor = Microsoft.Msagl.Drawing.Color.Green;
s.Attr.Shape = Shape.Box;
s.Label.FontColor=Microsoft.Msagl.Drawing.Color.Black;
s.Label.Text = "text subgraph";
s.AddNode(a);
s.AddNode(d);
s.AddNode(f);
graph.RootSubgraph.AddSubgraph(s);
graph.Write("test_graph_with_subgraph.msagl");
graph = Graph.Read("test_graph_with_subgraph.msagl");
graphViewer.Graph = graph;
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 319
- Avg merge
- 38m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
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
-
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
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·