How to overlay y position on node when using graphics to draw grids?

I use Graphviz to draw a grid.
Nodes are sets of numbers.

As a grid, I would like the height position (y) of node to represent the number of elements in the set represented by node. Then the x position must be determined by graphviz to make the image cleaner.

Is it possible?

According to the point documentation, there should be a pos attribute that should determine the position of the node. But although I tried many times in different ways, I could not get any graph where the node position was determined. Has anyone had success with this?

The following is a classic point file that I use:

digraph G { "528 544\n640 768" -> "768 528"; "528 536\n530 539" -> "539"; "528 536\n530 539" -> "528"; "800 896 548\n944 566 728\n539 704 768" -> "704 768\n539 548"; "800 896 548\n944 566 728\n539 704 768" -> "944 728\n539 566"; "800 896 548\n944 566 728\n539 704 768" -> "944 800\n896 768"; "768 539" -> "768"; "768 539" -> "539"; "768" -> "βˆ…"; "944" -> "βˆ…"; "944 528 536\n530 566 560\n728 656 539" -> "528 536\n530 539"; "944 528 536\n530 566 560\n728 656 539" -> "944 728\n539 566"; "944 528 536\n530 566 560\n728 656 539" -> "944 656\n528 560"; "704 768\n539 548" -> "768 539"; "944 728\n539 566" -> "944"; "944 728\n539 566" -> "539"; "800 896 640\n944 560 528\n544 656 768" -> "528 544\n640 768"; "800 896 640\n944 560 528\n544 656 768" -> "944 656\n528 560"; "800 896 640\n944 560 528\n544 656 768" -> "944 800\n896 768"; "539" -> "βˆ…"; "944 656\n528 560" -> "944"; "944 656\n528 560" -> "528"; "896 640 656 536\n530 728 539 704\n768 800 544 528\n548 944 566 560" -> "800 896 548\n944 566 728\n539 704 768"; "896 640 656 536\n530 728 539 704\n768 800 544 528\n548 944 566 560" -> "944 528 536\n530 566 560\n728 656 539"; "896 640 656 536\n530 728 539 704\n768 800 544 528\n548 944 566 560" -> "800 896 640\n944 560 528\n544 656 768"; "896 640 656 536\n530 728 539 704\n768 800 544 528\n548 944 566 560" -> "768 704 548\n528 530 544\n536 640 539"; "768 528" -> "768"; "768 528" -> "528"; "528" -> "βˆ…"; "768 704 548\n528 530 544\n536 640 539" -> "528 544\n640 768"; "768 704 548\n528 530 544\n536 640 539" -> "704 768\n539 548"; "768 704 548\n528 530 544\n536 640 539" -> "768 528 530\n539 536"; "944 800\n896 768" -> "768"; "944 800\n896 768" -> "944"; "768 528 530\n539 536" -> "528 536\n530 539"; "768 528 530\n539 536" -> "768 539"; "768 528 530\n539 536" -> "768 528"; } 

If someone could write an example file where the height of one node was determined, I would be very grateful.

+6
graph graphviz visualization
source share
1 answer

I have found the answer.

Here: http://www.linuxdevcenter.com/pub/a/linux/2004/05/06/graphviz_dot.html?page=2

Essentially, you can determine which sets of nodes should be at the same level. To get the nodes A and B in the same area, I need to add the line: {Rank = the same; AB};

So, here is an example similar to the previous one, but with the node settings:

 digraph G { {rank=same; "768" "944" "539" "528" }; {rank=same; "768 539" "768 528" }; {rank=same; "768 640\n528 544" "528 536\n530 539" "768 704\n539 548" "944 728\n539 566" "944 656\n528 560" "944 800\n896 768" }; {rank=same; "800 896 548\n944 566 728\n539 704 768" "528 944 536\n530 566 560\n728 656 539" "800 896 944\n656 560 528\n544 640 768" "768 640 548\n528 530 544\n536 539 704" }; "768 640\n528 544" -> "768 528"; "528 536\n530 539" -> "539"; "528 536\n530 539" -> "528"; "800 896 548\n944 566 728\n539 704 768" -> "768 704\n539 548"; "800 896 548\n944 566 728\n539 704 768" -> "944 728\n539 566"; "800 896 548\n944 566 728\n539 704 768" -> "944 800\n896 768"; "768 539" -> "768"; "768 539" -> "539"; "768" -> "βˆ…"; "944" -> "βˆ…"; "528 944 536\n530 566 560\n728 656 539" -> "528 536\n530 539"; "528 944 536\n530 566 560\n728 656 539" -> "944 728\n539 566"; "528 944 536\n530 566 560\n728 656 539" -> "944 656\n528 560"; "768 704\n539 548" -> "768 539"; "944 728\n539 566" -> "944"; "944 728\n539 566" -> "539"; "800 896 944\n656 560 528\n544 640 768" -> "768 640\n528 544"; "800 896 944\n656 560 528\n544 640 768" -> "944 656\n528 560"; "800 896 944\n656 560 528\n544 640 768" -> "944 800\n896 768"; "539" -> "βˆ…"; "944 656\n528 560" -> "944"; "944 656\n528 560" -> "528"; "896 640 656 536\n530 728 539 704\n768 800 544 528\n548 944 566 560" -> "800 896 548\n944 566 728\n539 704 768"; "896 640 656 536\n530 728 539 704\n768 800 544 528\n548 944 566 560" -> "528 944 536\n530 566 560\n728 656 539"; "896 640 656 536\n530 728 539 704\n768 800 544 528\n548 944 566 560" -> "800 896 944\n656 560 528\n544 640 768"; "896 640 656 536\n530 728 539 704\n768 800 544 528\n548 944 566 560" -> "768 640 548\n528 530 544\n536 539 704"; "768 528" -> "768"; "768 528" -> "528"; "528" -> "βˆ…"; "768 640 548\n528 530 544\n536 539 704" -> "768 640\n528 544"; "768 640 548\n528 530 544\n536 539 704" -> "768 704\n539 548"; "768 640 548\n528 530 544\n536 539 704" -> "528 768 530\n539 536"; "944 800\n896 768" -> "768"; "944 800\n896 768" -> "944"; "528 768 530\n539 536" -> "528 536\n530 539"; "528 768 530\n539 536" -> "768 539"; "528 768 530\n539 536" -> "768 528"; } 
+7
source share

All Articles