# Feature Request: Is it possible to support the rank attribute in the twopi layout?

**URL:** https://forum.graphviz.org/t/feature-request-is-it-possible-to-support-the-rank-attribute-in-the-twopi-layout/3252
**Category:** Help
**Created:** [December 30, 2025, 12:00pm UTC](https://forum.graphviz.org/t/feature-request-is-it-possible-to-support-the-rank-attribute-in-the-twopi-layout/3252 "2025-12-30T12:00:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![The\_book](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@The\_book](https://forum.graphviz.org/u/The_book)
#### Post date: [December 30, 2025, 12:00pm UTC](https://forum.graphviz.org/t/feature-request-is-it-possible-to-support-the-rank-attribute-in-the-twopi-layout/3252/1 "2025-12-30T12:00:15Z")

</div>

I have three layers of nodes arranged on three concentric rings, but some third-layer nodes are directly connected to the first layer, causing Graphviz to place them in the second layer.

Currently, I can work around this issue by adding an invisible node with zero size, but this results in polyline connections.

I hope to be able to specify the rank of nodes in the twopi layout.

---

<div class="post-metadata">

### Author: ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)
#### Post date: [December 30, 2025, 1:03pm UTC](https://forum.graphviz.org/t/feature-request-is-it-possible-to-support-the-rank-attribute-in-the-twopi-layout/3252/2 "2025-12-30T13:03:28Z")

</div>

There is no such feature, but I’m willing to try my hand at this when I can make time.

---

<div class="post-metadata">

### Author: ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)
#### Post date: [December 30, 2025, 4:45pm UTC](https://forum.graphviz.org/t/feature-request-is-it-possible-to-support-the-rank-attribute-in-the-twopi-layout/3252/3 "2025-12-30T16:45:49Z")

</div>

- **minlen** would also be a nice addition (to allow relative rank setting)
- here are two programs (pre-processors, written in **gvpr** ) that might might help in the interm:
  - [setTwopiRanks.gvpr](https://gist.github.com/steveroush/788d45ce9cfdb1f27d45b6e9b08e4242) - adds a **rank** attribute to **twopi**
  - [radialLayout.gvpr](https://forum.graphviz.org/t/a-radial-graphviz-engine-pre-processor/1271) - a general-purpose radial engine for Graphviz

- Here is an Issue for this request [[twopi] Allow user to explicitly specify a rank / distance from the root (enhancement) (#2412) · Issues · graphviz / graphviz · GitLab](https://gitlab.com/graphviz/graphviz/-/issues/2412)

---

<div class="post-metadata">

### Author: ![The\_book](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@The\_book](https://forum.graphviz.org/u/The_book)
#### Post date: [December 31, 2025, 3:19am UTC](https://forum.graphviz.org/t/feature-request-is-it-possible-to-support-the-rank-attribute-in-the-twopi-layout/3252/4 "2025-12-31T03:19:13Z")

</div>

Interesting. I didn’t even notice that there was such a tool as gvpr  
I will try to study it in depth  
As I understand it, this configuration of rank actually configures invisible intermediate nodes and intermediate connections? It seems that this logic can handle it directly without this gvpr. I’ll give it a try

---

<div class="post-metadata">

### Author: ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)
#### Post date: [January 1, 2026, 4:47pm UTC](https://forum.graphviz.org/t/feature-request-is-it-possible-to-support-the-rank-attribute-in-the-twopi-layout/3252/5 "2026-01-01T16:47:21Z")

</div>

I tried [this](https://gitlab.com/graphviz/graphviz/-/merge_requests/4701), but not sure it’s correct.
