Esempio n. 1
0
        void CollapseCluster(Cluster cluster) {
            HideCollapsed(cluster);

            var center = cluster.RectangularBoundary.Rect.Center;
            var del = center - cluster.CollapsedBoundary.BoundingBox.Center;
            cluster.CollapsedBoundary.Translate(del);
            //todo: try to find a better method for collapsing, mst tree?
            var relayout = new Relayout(viewer.Graph.GeometryGraph, new[] {cluster}, null, cl => {
                var subgraph = cl.UserData as Subgraph;
                if (subgraph != null && subgraph.LayoutSettings != null) return subgraph.LayoutSettings;
                return viewer.Graph.LayoutAlgorithmSettings;
            });
            relayout.Run();
        }
Esempio n. 2
0
 void ExpandCluster(Cluster cluster) {
     //todo: try to find a better method for expanding, mst tree? Procrustes transofrm
     var relayout = new Relayout(viewer.Graph.GeometryGraph, new[] { cluster }, null, cl =>
     {
         var subgraph = cl.UserData as Subgraph;
         if (subgraph != null && subgraph.LayoutSettings != null) return subgraph.LayoutSettings;
         return viewer.Graph.LayoutAlgorithmSettings;
     });
     relayout.Run();
     MakeExpandedNodesVisible(cluster);
     MakeExpandedEdgesVisible(cluster);
 }