Graph spacing
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- computer-graphics
Research direction
Start with the reproduced C# example, especially GraphRenderer.CalculateLayout and the assignments to NodeSeparation and LayerSeparation. Compare the calculated node positions and graph dimensions with the custom 150x80 node boundaries. The issue is done when those separation settings visibly affect the rendered layout, or their intended behavior is documented.
Written by the indexing model from the issue text.
Description
I use custom node size and the graph looks too dense. I tried to make more space between the nodes by setting the node separation and layer separation but they both do not seems to make any effect.
Microsoft.Msagl.Drawing.Graph graph = new Microsoft.Msagl.Drawing.Graph("");
graph.AddEdge("A", "B");
graph.AddEdge("B", "C");
graph.AddEdge("C", "D");
graph.AddEdge("C", "E");
graph.AddEdge("C", "F");
graph.AddEdge("C", "G");
graph.AddEdge("A", "H");
graph.AddEdge("E", "H");
graph.AddEdge("F", "H");
foreach (var node in graph.Nodes)
{
int w = 150;
int h = 80;
node.NodeBoundaryDelegate = new DelegateToSetNodeBoundary(p => CurveFactory.CreateRectangle(w, h, new Microsoft.Msagl.Core.Geometry.Point()));
}
graph.Attr.LayerDirection = LayerDirection.LR;
graph.Attr.NodeSeparation = 200;
graph.Attr.LayerSeparation = 200;
Microsoft.Msagl.GraphViewerGdi.GraphRenderer renderer = new Microsoft.Msagl.GraphViewerGdi.GraphRenderer(graph);
renderer.CalculateLayout();
int width = 1500;
Bitmap bitmap = new Bitmap(width, (int)(graph.Height * (width / graph.Width)), PixelFormat.Format32bppPArgb);
renderer.Render(bitmap);
bitmap.Save("c:\\temp\\test2.png");
- 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 ·