Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this app that I want to have a family tree window and I made it work with my database. But my problem is that I cant getting it to look like This 2024-08-01-11-06-26-Application-Frame-Host hosted at ImgBB — ImgBB[^] The best I can get is 2024-08-01-11-05-50-The-Plumbobber hosted at ImgBB — ImgBB[^] I have searched the internet and cant find any info on how. Im pretty sure that My family tree app is using some form of QuickGraph. Im working in C# WPF GraphX Visual studio. Hope some have an idea and can point me in the right direction. And im not to take My family tree marked. My/Our hobby app is for a small amount of The Sims 4 players. And do not use Gedcom data but a simple SQL database.

What I have tried:

So far my Confic logicCore looks like this
private void ConfigureGraph(GraphExample graph)
{
    var logicCore = new GXLogicCoreExample() { Graph = graph };
    FamilyTreeGraph.LogicCore = logicCore;
    ConfigureGraphLayout(logicCore);

    FamilyTreeGraph.SetEdgesDashStyle(EdgeDashStyle.Solid);
    FamilyTreeGraph.ShowAllEdgesArrows(false);
    FamilyTreeGraph.GenerateGraph(true);
    FamilyTreeGraph.ShowAllEdgesLabels(false);




}


private void ConfigureGraphLayout(GXLogicCoreExample logicCore)
{
    logicCore.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.EfficientSugiyama;
    logicCore.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA;
    logicCore.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER;
    logicCore.EdgeCurvingEnabled = false;
    //logicCore.EdgeCurvingTolerance = 100;
    logicCore.EnableParallelEdges = true;
    logicCore.ParallelEdgeDistance = 25;
    


    logicCore.DefaultLayoutAlgorithmParams = new EfficientSugiyamaLayoutParameters
    {                
        Direction = LayoutDirection.TopToBottom,
        LayerDistance = 25,
        VertexDistance = 25,
        //Seed = 2,
        PositionMode = 2,
        WidthPerHeight = 5,
        MinimizeEdgeLength = true,
        OptimizeWidth = true,
        EdgeRouting = SugiyamaEdgeRoutings.Orthogonal
                        
    };
                
}
Posted
Comments
Dave Kreskowiak 8-Jan-24 9:29am    
You're using Visual Studio to build a WPF app written in C#, using the QuikGraph and GraphX libraries.

There doesn't appear to be any support for the GraphX library nor any documentation. It's going to be a case of experimenting and tinkering around in the library and figuring it out, which is typical for stuff you get off of GitHub.

Your question is specific to the GraphX library. It's going to be difficult to find anyone who has experience with that library.
Thomas Andersen 2022 8-Jan-24 10:11am    
Do you have a better option for a graph or something til build a family tree. I chose GraphX over MSAGL because I can make the visuel parts in XAML with binding ect. But i know there are other libraries like QUIKgraph and ither also based on QuickGraph. I was also thinking about making a dummy note/vertex between the parents, but wanted to get some input here before I try to tinker mere with taht idea. And thx for you comment.
[no name] 8-Jan-24 12:05pm    
Your only complaint seems to be it doesn't "look the same". You can only bend 3rd party software so far. You can do it all in pure WPF; but that requires some knowledge and a strategy: e.g. Grids, UserControls, Imge Controls, TextBlocks, Borders and / or Lines.
Thomas Andersen 2022 8-Jan-24 12:47pm    
Was looking for a way to get that dot or a way to make i look more like the kids is from both parents. Looks more like a family tree that way.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900