Beispiel #1
0
        public SharpGraph(IRenderer <TNode, TEdge> renderer)
        {
            _renderer = renderer ?? throw new ArgumentNullException(nameof(renderer));

            _nodes = new List <PointEntity <TNode> >();
            _edges = new List <EntityLink <TNode, TEdge> >();

            _renderer.SetNodes(_nodes);
            _renderer.SetEdges(_edges);

            _interactions = new InteractionsHandler();
            _interactions
            .Add(new RepulsiveNodeForce <TNode>(2, 6), _nodes)
            .Add(new AttractiveEdgeForce <TNode, TEdge>(1, 6), _edges)
            .Add(new ApplyLimitedForce <TNode>(0.01, 0.5), _nodes);
        }