示例#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();
    }
示例#2
0
文件: Graph.cs 项目: xire-/graphulus
    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();
    }