Search code examples
graphviz

How can I enlarge space between top node and bottom


I want to make more space between node comm and other nodes. How can I do that? Here's the code:

digraph H {
    overlap="false"
    splines="polyline"
    nodesep=2;
    
 comm [
   shape=plaintext
  
   label=< 
     <table border='1' cellborder='1'>
       <tr><td colspan="3">Коммутатор</td><td port='34'>34</td><td port='36'>36</td><td port='38'>38</td><td port='37'>37</td><td port='40'>40</td><td port='39'>39</td><td port='47'>47</td><td port='48'>48</td><td port='49'>49</td><td port='51'>51</td></tr>
     </table>
  >]; 
con1 [
   shape=plaintext
   
   label=<
     <table border='1' cellborder='1'>
      
       <tr><td colspan="3">Континент 1 </td><td port='In1'>In1</td><td port='8'>8</td></tr>
     </table>
  >];
  con2 [
   shape=plaintext
   
   label=<
     <table border='1' cellborder='1'>
      
       <tr><td colspan="3">Континент 2 </td><td port='In1'>In1</td><td port='8'>8</td></tr>
     </table>
  >];

 comm:34 -> con1:in1;
 comm:36 -> con2:In1;
 comm:49 -> con1:8;
 comm:51 -> con2:8;
}

And it looks like that:scheme

I need to make more space because there will be much more nodes later and they'll placed in the horizontal line on same rank.


Solution

  • ranksep will alter the distance between ranks.

    digraph H {
        overlap="false"
        splines="polyline"
        nodesep=2;
        ranksep=1.6  // spread the ranks
        
     comm [
       shape=plaintext
      
       label=< 
         <table border='1' cellborder='1'>
           <tr><td colspan="3">Коммутатор</td><td port='34'>34</td><td port='36'>36</td><td port='38'>38</td><td port='37'>37</td><td port='40'>40</td><td port='39'>39</td><td port='47'>47</td><td port='48'>48</td><td port='49'>49</td><td port='51'>51</td></tr>
         </table>
      >]; 
    con1 [
       shape=plaintext
       
       label=<
         <table border='1' cellborder='1'>
          
           <tr><td colspan="3">Континент 1 </td><td port='In1'>In1</td><td port='8'>8</td></tr>
         </table>
      >];
      con2 [
       shape=plaintext
       
       label=<
         <table border='1' cellborder='1'>
          
           <tr><td colspan="3">Континент 2 </td><td port='In1'>In1</td><td port='8'>8</td></tr>
         </table>
      >];
    
     comm:34 -> con1:in1;
     comm:36 -> con2:In1;
     comm:49 -> con1:8;
     comm:51 -> con2:8;
    }
    

    Giving:
    enter image description here