microsoft / microsoft/automatic-graph-layout

Render graph to image and resize bondingbox

Open
#386 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.5k
Forks
319
Avg merge
38m
Merged PRs (30d)
1

Description

Hi!
I'm trying to make image of the calculated graph and that works well.

If I manually move the Nodes to get more space in the normal GraphView the bondingbox get bigger and that works well.

But in Render mode is this not possible..., see code example below.

        // Create a new renderer and set its layout algorithm
        var renderer = new Microsoft.Msagl.GraphViewerGdi.GraphRenderer(temp_graph);

        renderer.CalculateLayout();

        UpdateNodePositions(ref temp_graph, PLC_Objects); // move nodes to absolute new center position

        // this is missing !!!
        renderer.Graph.GeometryGraph.UpdateBoundingBox();
       // this is missing !!!

         // Faulty Result.
        // the produced image seize is = the calculated bondingbox,
        // the nodes moved outside the calculated bondingbox is missing.

        // original
        //gViewer1.Graph.GeometryGraph.UpdateBoundingBox();

best regards

Undertaker911

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GraphRenderer and GeometryGraph flow shown in the issue, including CalculateLayout, UpdateNodePositions, and image rendering. Determine how the rendering bounds are calculated after nodes move; done means the produced image includes every moved node rather than clipping nodes outside the original bounding box.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.