Esempio n. 1
0
 static string Encode(RankDirection dir)
 {
     switch(dir)
     {
         case RankDirection.LeftRight: return "LR";
         default: return "TB";
     }
 }
Esempio n. 2
0
 internal AutomaticLayout(RankDirection rankDirection, int rankSeparation, int nodeSeparation,
                          int edgeSeparation, bool vertices)
 {
     RankDirection  = rankDirection;
     RankSeparation = rankSeparation;
     NodeSeparation = nodeSeparation;
     EdgeSeparation = edgeSeparation;
     Vertices       = vertices;
 }
Esempio n. 3
0
        public static GraphAttribute RankDirection(RankDirection rankDir)
        {
            if (!rankDir.IsValid())
            {
                throw new ArgumentException($"The { nameof(RankDirection) } provided must be a valid enum.", nameof(rankDir));
            }

            var rankDirStr = rankDir.AsString();

            return(new GraphAttribute("rankdir", rankDirStr));
        }
Esempio n. 4
0
 /// <summary>
 /// Enables the automatic layout for this view, with the specified settings.
 /// </summary>
 /// <param name="rankDirection">the rank direction</param>
 /// <param name="rankSeparation">the separation between ranks (in pixels, a positive integer)</param>
 /// <param name="nodeSeparation">the separation between nodes within the same rank (in pixels, a positive integer)</param>
 /// <param name="edgeSeparation">the separation between edges (in pixels, a positive integer)</param>
 /// <param name="vertices">whether vertices should be created during automatic layout</param>
 public void EnableAutomaticLayout(RankDirection rankDirection, int rankSeparation, int nodeSeparation, int edgeSeparation, bool vertices)
 {
     AutomaticLayout = new AutomaticLayout(rankDirection, rankSeparation, nodeSeparation, edgeSeparation, vertices);
 }