Exemplo n.º 1
0
    public void PopulateFrom(string jsonPath)
    {
        var jsonRoot = JsonLoader.Deserialize(jsonPath);

        _forceDirectedGraph = new Springy.ForceDirectedGraph {
            Stiffness         = jsonRoot.parameters.stiffness,
            Repulsion         = jsonRoot.parameters.repulsion,
            Convergence       = jsonRoot.parameters.convergence,
            Damping           = jsonRoot.parameters.damping,
            EnergyThreshold   = -1f,
            SimulationEnabled = true
        };

        AddNodes(jsonRoot);
        AddEdges(jsonRoot);

        AdjustNodesSize();
    }
Exemplo n.º 2
0
    public void PopulateFrom(string jsonPath)
    {
        var jsonRoot = JsonLoader.Deserialize(jsonPath);

        _forceDirectedGraph = new Springy.ForceDirectedGraph {
            Stiffness = jsonRoot.parameters.stiffness,
            Repulsion = jsonRoot.parameters.repulsion,
            Convergence = jsonRoot.parameters.convergence,
            Damping = jsonRoot.parameters.damping,
            EnergyThreshold = -1f,
            SimulationEnabled = true
        };

        AddNodes(jsonRoot);
        AddEdges(jsonRoot);

        AdjustNodesSize();
    }