<commit_before>﻿using GraphX;
using GraphX.Controls;
using GraphX.GraphSharp.Algorithms.EdgeRouting;
using GraphX.GraphSharp.Algorithms.Layout.Simple.FDP;
using GraphX.Models;
using SolutionDependencyScanner;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DependencyVisualizerGraphX
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {

        private DependencyGraph graph = new DependencyGraph();
        private ObservableCollection<SolutionSerializableToNameAndPath> slns = new ObservableCollection<SolutionSerializableToNameAndPath>();


        private GraphFactory factory;

        private Color c1 = Color.FromRgb(0x33, 0x33, 0x33);
        private Color c2 = Color.FromRgb(0x66, 0x22, 0x22);
        private Color c3 = Color.FromRgb(0x99, 0x11, 0x11);

        private Color c4 = Color.FromRgb(0x33, 0x33, 0x33);
        private Color c5 = Color.FromRgb(0x22, 0x22, 0x66);
        private Color c6 = Color.FromRgb(0x11, 0x11, 0x99);

        public MainWindow()
        {
            DataContext = this;
            InitializeComponent();
            GraphArea_Setup();
            SolutionList.ItemsSource = slns;
            Loaded += MainWindow_Loaded;
            Area.VertexDoubleClick += Area_VertexDoubleClick;
        }

        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Area.GenerateGraph(true, true);
            zoomctrl.ZoomToFill();
        }

        private DependencyGraph GraphExample_Setup()
        {
            //Lets make new data graph instance
            var dataGraph = new DependencyGraph();
            //Now we need to create edges and vertices to fill data graph
            //This edges and vertices will represent graph structure and connections
            //Lets make some vertices
            for (int i = 1; i < 10; i++)
            {
                //Create new vertex with specified Text. Also we will assign custom unique ID.
                //This ID is needed for several features such as serialization and edge routing algorithms.
                //If you don't need any custom IDs and you are using automatic Area.GenerateGraph() method then you can skip ID assignment
                //because specified method automaticaly assigns missing data ids (this behavior controlled by method param).
                var dataVertex = new DependencyVertex("MyVertex " + i) { ID = i };
                //Add vertex to data graph
                dataGraph.AddVertex(dataVertex);
            }

            //Now lets make some edges that will connect our vertices
            //get the indexed list of graph vertices we have already added
            var vlist = dataGraph.Vertices.ToList();
            //Then create two edges optionaly defining Text property to show who are connected
            var dataEdge = new DependencyEdge(vlist[0], vlist[1]) { Text = string.Format("{0} -> {1}", vlist[0], vlist[1]) };
            dataGraph.AddEdge(dataEdge);
            dataEdge = new DependencyEdge(vlist[2], vlist[3]) { Text = string.Format("{0} -> {1}", vlist[2], vlist[3]) };
            dataGraph.AddEdge(dataEdge);

            return dataGraph;
        }

        private void GraphArea_Setup()
        {
            //Lets create logic core and filled data graph with edges and vertices
            var logicCore = new DependencyGraphLogicCore() { Graph = GraphExample_Setup() };
            //This property sets layout algorithm that will be used to calculate vertices positions
            //Different algorithms uses different values and some of them uses edge Weight property.
            logicCore.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.FR;
            //Now we can set parameters for selected algorithm using AlgorithmFactory property. This property provides methods for
            //creating all available algorithms and algo parameters.
            logicCore.DefaultLayoutAlgorithmParams = logicCore.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.FR);
            //Unfortunately to change algo parameters you need to specify params type which is different for every algorithm.
            //            ((LinLogLayoutParameters)logicCore.DefaultLayoutAlgorithmParams).IterationCount = 15;

            //This property sets vertex overlap removal algorithm.
            //Such algorithms help to arrange vertices in the layout so no one overlaps each other.
            logicCore.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA;<commit_msg>removed unnecessary initial fake graph<commit_after>﻿using GraphX;
using GraphX.Controls;
using GraphX.GraphSharp.Algorithms.EdgeRouting;
using GraphX.GraphSharp.Algorithms.Layout.Simple.FDP;
using GraphX.Models;
using SolutionDependencyScanner;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DependencyVisualizerGraphX
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {

        private DependencyGraph graph = new DependencyGraph();
        private ObservableCollection<SolutionSerializableToNameAndPath> slns = new ObservableCollection<SolutionSerializableToNameAndPath>();


        private GraphFactory factory;

        private Color c1 = Color.FromRgb(0x33, 0x33, 0x33);
        private Color c2 = Color.FromRgb(0x66, 0x22, 0x22);
        private Color c3 = Color.FromRgb(0x99, 0x11, 0x11);

        private Color c4 = Color.FromRgb(0x33, 0x33, 0x33);
        private Color c5 = Color.FromRgb(0x22, 0x22, 0x66);
        private Color c6 = Color.FromRgb(0x11, 0x11, 0x99);

        public MainWindow()
        {
            DataContext = this;
            InitializeComponent();
            GraphArea_Setup();
            SolutionList.ItemsSource = slns;
            Loaded += MainWindow_Loaded;
            Area.VertexDoubleClick += Area_VertexDoubleClick;
        }

        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Area.GenerateGraph(true, true);
            zoomctrl.ZoomToFill();
        }


        private void GraphArea_Setup()
        {
            //Lets create logic core and filled data graph with edges and vertices
            var logicCore = new DependencyGraphLogicCore() { Graph = new DependencyGraph() };
            //This property sets layout algorithm that will be used to calculate vertices positions
            //Different algorithms uses different values and some of them uses edge Weight property.
            logicCore.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.FR;
            //Now we can set parameters for selected algorithm using AlgorithmFactory property. This property provides methods for
            //creating all available algorithms and algo parameters.
            logicCore.DefaultLayoutAlgorithmParams = logicCore.AlgorithmFactory.CreateLayoutParameters(LayoutAlgorithmTypeEnum.FR);
            //Unfortunately to change algo parameters you need to specify params type which is different for every algorithm.
            //            ((LinLogLayoutParameters)logicCore.DefaultLayoutAlgorithmParams).IterationCount = 15;

            //This property sets vertex overlap removal algorithm.
            //Such algorithms help to arrange vertices in the layout so no one overlaps each other.
            logicCore.DefaultOverlapRemovalAlgorithm = OverlapRemovalAlgorithmTypeEnum.FSA;
{'fraction_non_alphanumeric': 0.07336000970049715, 'fraction_numerical': 0.016854613798957196, 'mean_word_length': 2.7765567765567765, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6977483', 'n_tokens_mistral': 2145, 'n_tokens_neox': 2011, 'n_words': 670}