1

I’ve been struggling for awhile on how to keep subgraph within rectangle instead of “Tetris” shapes when edge is being added and layout becomes more complex.

on Layer 2 in the codes below you’ll clearly notice “C”-shaped subgraph. Is it possible to fix the subgraph’s shape ratio to rectangle as an ascii or any attribute to handle this?

digraph G {
  subgraph cluster_0 {

    subgraph cluster_3 {
      label="Layer 3";
      "3-1" -> "3-2" -> "3-3";
    }

    subgraph cluster_2 {
      label="Layer 2";
      "2-1" -> "2-2" -> "2-3";
    }

    subgraph cluster_1 {
      label="Layer 1";
      "1-1" -> "1-2" -> "1-3";
    }
  }

 "1-1" -> "2-1";
 "1-3" -> "2-1";

 "1-1" -> "2-2";
 "1-2" -> "2-2";

  "1-2" -> "2-3";
  "1-3" -> "2-3";

  "2-1" -> {"3-1" "3-2"};
  "2-3" -> {"3-1" "3-3"};
}

here is an img explanation:

here is an img explanation.

albert
  • 8,285
  • 3
  • 19
  • 32
  • It is not clear what your try to archive, do yo want an ascii drawing? or is the ascii just an example? Also clusters will always be rectangular there are no way to create the C form – Jens Jan 16 '20 at 21:59

0 Answers0