Graph.ReadGraphFromStream ignores subgraph
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- csharp
调研方向
首先使用 Graph.WriteToStream 和 Graph.ReadGraphFromStream 重现提供的示例,然后检查唯一的子图在将结果赋给 gViewer.Graph 之前是如何重建的。将其与临时子图的变通方案进行比较。当包含一个子图的图经过流往返后能在 gViewer 中渲染该子图时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
When only 1 subgraph is present in an XML stream the subgraph is not rendered in gviewer. The current workaround i've been using is to add a temporary subgraph before writing the graph to XML, then removing the temporary subgraph after reading the XML into a graph
See code for example
Graph graph = new Graph("graph");
var node1 = new Node("test1");
graph.AddNode(node1);
var subgraph = new Subgraph("subgraph1");
graph.RootSubgraph.AddSubgraph(subgraph);
subgraph.AddNode(node1);
//uncommenting the next 2 lines will make subgraph1 appear. If left uncommented, subgraph1 will not appear
//var subgraph2 = new Subgraph("delete") { IsVisible = false }; //IsVisible is not carried over in stream
//graph.RootSubgraph.AddSubgraph(subgraph2);
//write graph to xml
string xml;
using (var stream1 = new MemoryStream()) {
graph.WriteToStream(stream1);
stream1.Position = 0;
using (var streamReader = new StreamReader(stream1)) {
xml = streamReader.ReadToEnd();
}
}
//read graph from xml
using (var stream = new MemoryStream()) {
using (var streamWriter = new StreamWriter(stream)) {
streamWriter.Write(xml);
streamWriter.Flush();//otherwise you are risking empty stream
stream.Position = 0;
graph = Graph.ReadGraphFromStream(stream);
}
}
//graph.RootSubgraph.RemoveSubgraph(graph.RootSubgraph.Subgraphs.Where(x => x.Id == "delete").FirstOrDefault());
gViewer.Graph = graph;
- 主要语言
- C#
- 星标
- 1.5k
- 派生
- 318
- 平均合并
- 4 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/automatic-graph-layout 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 64/100
microsoft/automatic-graph-layout#395 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
Issue with framework reference in the GraphViewerGDI.nuspec可能重新可做 @levnach 于 273 天前认领,目前没有进行中的 PR。 未关闭
microsoft/automatic-graph-layout#390 · 6 条评论 · 2 个 reaction · 已指派 2 人 ·
-
难度 5/5 一周以上 新手友好度 25/100
microsoft/automatic-graph-layout#389 · 1 条评论 · 1 个 reaction ·
查看 microsoft/automatic-graph-layout 的全部 Issue
相似的 Issue
-
bug priority: P2
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
:watch: Not Triaged dotnet-csharp/svc fundamentals/subsvc
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
Wrong values of Kernel32.FileShare.Delete and Kernel32.FileAttributes.PosixSemantics可能已有人在做 @ElectLive 今天认领。 未关闭bug good first issue help wanted
难度 1/5 1 小时以内 新手友好度 83/100
ForNeVeR/TruePath#241 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
files-community/Files#19047 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复