Pan and zoom to specific node via code
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, desktop
Research direction
Start by tracing the graphViewer.ZoomF, Pan(), Transform.Offset, and node.Pos APIs, then review the related issue 227. Done means documenting or correcting a way to zoom and pan programmatically to a specific node, including whether the zoom level affects the offset.
Written by the indexing model from the issue text.
Description
I'm trying to pan and zoom to a specific node.
For the zoom the issue is that when setting the ZoomF value, it is still 1 after the line with the assignment and nothing happens:
graphViewer.ZoomF = 2;
Regarding panning to a node I'm not sure how to calculate the values for the Pan() method.
First I'm getting the position of the node:
var node = graphViewer.Graph.FindNode(id);
Then using than node.Pos value I need somehow get the offset for the Pan() method. If I understand it correctly the Pan() method expects the difference, not the absolute position.
The current offset when panning seems to be available in graphViewer.Transform.Offset. Without any zooming and panning the X value is 0 and the Y value seems to be the height of the graphViewer control.
Does the zoom level also have to be taken into account? Can the Pan offset be calculated using Transform.Offset and the node position?
Similar question, but without an answer:
Zoom and pan programatically?
https://github.com/microsoft/automatic-graph-layout/issues/227
- 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 ·