Node BoundaryCurve has no effect
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- computer-graphics
Research direction
Start with the sample code in the issue, especially the BoundaryCurve assignment and the later GraphRenderer.CalculateLayout call. Run the example and inspect whether the explicit label and node dimensions survive layout; done means the rendered node reflects the requested size or the issue explains which step overrides it.
Written by the indexing model from the issue text.
Description
I'm trying to define the size of a node explicitly. I've tried setting the label width/height as well as setting the node's boundarycurve. Both does to seem to make any effect of the node size.
Below is my sample code.
What am I missing?
Microsoft.Msagl.Drawing.Graph graph = new Microsoft.Msagl.Drawing.Graph("");
graph.AddEdge("A", "B");
graph.AddEdge("B", "C");
int nwidth = 100;
int nheight = 100;
var geometryGraph = graph.CreateGeometryGraph();
var n = graph.FindNode("A");
n.Label.GeometryLabel = new Microsoft.Msagl.Core.Layout.Label();
n.Label.GeometryLabel.Width = nwidth;
n.Label.GeometryLabel.Height = nwidth;
n.Label.Width = nwidth;
n.Label.Height = nheight;
int r = n.Attr.LabelMargin;
n.GeometryNode.BoundaryCurve = CurveFactory.CreateRectangleWithRoundedCorners(nwidth + r * 2, nheight + r * 2, r, r, new Point());
graph.Attr.LayerDirection = LayerDirection.LR;
geometryGraph.UpdateBoundingBox();
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\\test.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
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nightscout/nocturne#1379 ·
-
priority-0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
StackExchange/StackExchange.Redis#3249 ·
-
[Feat] 조합 영역 구분선 개선 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100