KeyNotFoundException with MDS layout
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- csharp
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
Tái hiện ngoại lệ trong GraphLayout/Samples/WpfApplicationSample/WpfApplicationSample.cs bằng MdsLayoutSettings và cấu hình subgraph được hiển thị. Bắt đầu tại phần xây dựng SimpleIntEdge, nơi nodeIndex[e.Source] và nodeIndex[e.Target] được truy cập, sau đó lần theo cách bố cục MDS xây dựng nodeIndex và xử lý subgraph2. Hoàn tất khi mẫu không còn ném KeyNotFoundException đối với bố cục này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi Lev,
I tried to modify WpfAplicationSample to show MDS layout, and it throws KeyNotFoundException.
Here are my modifications:
diff --git a/GraphLayout/Samples/WpfApplicationSample/WpfApplicationSample.cs b/GraphLayout/Samples/WpfApplicationSample/WpfApplicationSample.cs
index 5a6e6dd..f16ec58 100644
--- a/GraphLayout/Samples/WpfApplicationSample/WpfApplicationSample.cs
+++ b/GraphLayout/Samples/WpfApplicationSample/WpfApplicationSample.cs
@@ -291,6 +291,7 @@ namespace WpfApplicationSample
// //graph.LayoutAlgorithmSettings.EdgeRoutingSettings.EdgeRoutingMode = EdgeRoutingMode.SplineBundling;
// //layout the graph and draw it
Graph graph = new Graph();
+ graph.LayoutAlgorithmSettings=new Microsoft.Msagl.Layout.MDS.MdsLayoutSettings();
graph.AddEdge("47", "58");
graph.AddEdge("70", "71");
@@ -315,11 +316,11 @@ namespace WpfApplicationSample
graph.Attr.LayerDirection = LayerDirection.LR;
//graph.LayoutAlgorithmSettings.EdgeRoutingSettings.EdgeRoutingMode = EdgeRoutingMode.Rectilinear;
- var global = (SugiyamaLayoutSettings) graph.LayoutAlgorithmSettings;
- var local = (SugiyamaLayoutSettings) global.Clone();
- local.Transformation = PlaneTransformation.Rotation(-Math.PI / 2);
+ var global = (Microsoft.Msagl.Layout.MDS.MdsLayoutSettings) graph.LayoutAlgorithmSettings;
+ var local = (Microsoft.Msagl.Layout.MDS.MdsLayoutSettings) global.Clone();
+ //local.Transformation = PlaneTransformation.Rotation(-Math.PI / 2);
subgraph2.LayoutSettings = local; // for Collapsing\Expanding
- global.ClusterSettings.Add(subgraph2, local);
+ //global.ClusterSettings.Add(subgraph2, local);
graphViewer.Graph = graph;
}
The line, which throws exception is:
intEdges.Add(new SimpleIntEdge {Source = nodeIndex[e.Source], Target = nodeIndex[e.Target]});
Checking with debugger, I can see that subgraph2 is missing from nodeIndex dictionary.

I have no idea why it happens specifically with MDS, but doesn't happen with Sugiyama.
Am I doing something wrong, or is there a bug in MDS layout algorithm?
Here's the screenshot of the exception being thrown:

- Ngôn ngữ chính
- C#
- Star
- 1.5k
- Fork
- 317
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/automatic-graph-layout
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
microsoft/automatic-graph-layout#395 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Issue with framework reference in the GraphViewerGDI.nuspecCó thể làm lại được @levnach đã nhận 260 ngày trước và không có pull request nào đang mở. Đang mở
microsoft/automatic-graph-layout#390 · 6 bình luận · 2 reaction · 2 người được giao ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
microsoft/automatic-graph-layout#389 · 1 bình luận · 1 reaction ·
Tất cả issue của microsoft/automatic-graph-layout
Issue tương tự
-
[Doc Gap] Document new --enable-public-network-access breaking change for azurebackup vault createĐang mởcopilot documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area-dashboard
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
0 - Backlog Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
BrighterCommand/Brighter#4539 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-networking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
dotnet/aspnetcore#69671 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NethermindEth/nethermind#14274 ·
Maintainer thường phản hồi trong vòng 1 ngày