# Development scripts/tips location?

**URL:** <https://forum.graphviz.org/t/development-scripts-tips-location/3320>\
**Category:** Dev\
**Created:** [March 9, 2026, 6:37pm UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320 "2026-03-09T18:37:12Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianrmurphy](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@brianrmurphy](https://forum.graphviz.org/u/brianrmurphy)\
**Post date:** [March 9, 2026, 6:37pm UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/1 "2026-03-09T18:37:12Z")

</div>

I’ve been debugging [Issue 1213 and friends](https://gitlab.com/graphviz/graphviz/-/work_items?sort=popularity&state=opened&label_name%5B%5D=trouble+in+init_rank&first_page_size=50&show=eyJpaWQiOiIyNzk2IiwiZnVsbF9wYXRoIjoiZ3JhcGh2aXovZ3JhcGh2aXoiLCJpZCI6MTc4NjUwNTc3fQ%3D%3D).

I’ve apparently fixed the immediate issue but have some funky intermediate output.

 ![1213-1](https://global.discourse-cdn.com/graphviz/original/2X/9/90484bcf5faf6c59ddf9d8c9784dc7fba1aa7a1a.png)

I incrementally worked with Claude to whip up some instrumentation output (gated by DEBUG) and a script to plot what’s happening in the “path” planning process. See the attached.

 ![1213-1_shortest_sy5](https://global.discourse-cdn.com/graphviz/original/2X/d/d4abfb76089180136a6a992e29e351ccd1e9b94e.png)

I’m working on getting visualization of some more stages of the layout algorithm, since the constraint on with V10-\>V7 is happening earlier on.

Obviously this will only be useful for debugging small graphs, but seems generally useful. Any chance there is an existing place to put useful debugging scripts and the like?

-Brian

---

<div class="post-metadata">

**Author:** ![mark](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/mark/32/84_2.png) [@mark](https://forum.graphviz.org/u/mark)\
**Post date:** [March 10, 2026, 12:35am UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/2 "2026-03-10T00:35:47Z")

</div>

This is really neat! Very powerful to visualise this IMO.

---

<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:** [March 10, 2026, 2:28am UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/3 "2026-03-10T02:28:30Z")

</div>

I believe the layout algorithm can be implemented as a general step-by-step iterative process, where each intermediate step can be directly exported as dot or xdot. This would be very helpful for visualizing the entire layout process and can be achieved.

---

<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:** [March 10, 2026, 3:21am UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/4 "2026-03-10T03:21:38Z")

</div>

Yes, you can easily “stop action” dot as it progresses through the _phases_.

- **dot -Gphase=1 myfile.gv** will show the result of the ranking algorithm (1st pass through network simplex). Note that a temporary attribute named **rank** will be set to each node’s rank.
- **dot -Gphase=2 myfile.gv** will add the ordering assigned by the _mincross_ algorithm. Each node will have a temporary **order** attribute added.
- **dot -Gphase=3 myfile.gv** will assign the final **pos** attribute to every node.
- **dot -Gphase=4 myfile.gv** will assign **pos** values to every edge.

Here is issue 1213 stepped through the phases with some artistic licence (nodes positioned with only 0 or 1 coordinates)

 ![issue1213_0.0](https://global.discourse-cdn.com/graphviz/original/2X/8/8b819df19b3e3f03068b868bb681a6bd1691fd6e.svg)  
 ![issue1213_0.1](https://global.discourse-cdn.com/graphviz/original/2X/b/b1aa0815e11b37e1100a9f0e3d91322dd1a3c1a3.svg)  
 ![issue1213_0.2](https://global.discourse-cdn.com/graphviz/original/2X/9/9704019b1ef773a8b0423092ba89821810d1cbd9.svg)  
 ![issue1213_0.3](https://global.discourse-cdn.com/graphviz/original/2X/b/bb0d31e0f17ac715b822116bc39fe11b0ffba6ef.svg)  
 ![issue1213_0.99](https://global.discourse-cdn.com/graphviz/original/2X/0/00b5a9766f70fd4b8e4617fc71aafb44b403cb29.svg)

---

<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:** [March 10, 2026, 3:24am UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/5 "2026-03-10T03:24:03Z")

</div>

> [@steveroush](#):
>
> Yes, you can easily “stop action” dot as it progresses through the _phases_.
> 
> - **dot -Gphase=1 myfile.gv** will show the result of the ranking algorithm (1st pass through network simplex). Note that a temporary attribute named **rank** will be set to each node’s rank.
> - **dot -Gphase=2 myfile.gv** will add the ordering assigned by the _mincross_ algorithm. Each node will have a temporary **order** attribute added.
> - **dot -Gphase=3 myfile.gv** will assign the final **pos** attribute to every node.
> - **dot -Gphase=4 myfile.gv** will assign **pos** values to every edge.
> 
> Here is issue 1213 stepped through the phases with some artistic licence (nodes positioned with only 0 or 1 coordinates)

This attribute seems to be undocumented?

---

<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:** [March 10, 2026, 3:55am UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/6 "2026-03-10T03:55:21Z")

</div>

I’d forgotten that **phase** is on a list of _discovered_ attributes that have not been officially documented (see [Document undocumented attributes (#75) · Issues · graphviz / graphviz.gitlab.io · GitLab](https://gitlab.com/graphviz/graphviz.gitlab.io/-/work_items/75)).  
That said, the **phase** attribute has worked for a long time.

p.s. if you use **phase** on the command line, know that it is then inserted into the source ( **dot** format) and must be edited out or commented out if you want to use the resulting output as input back into **dot** as I did for the images above. (sorry, a very convoluted sentence)

---

<div class="post-metadata">

**Author:** ![brianrmurphy](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@brianrmurphy](https://forum.graphviz.org/u/brianrmurphy)\
**Post date:** [March 10, 2026, 4:38am UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/7 "2026-03-10T04:38:33Z")

</div>

Can you please describe how exactly you generated those?

I notice that when I use -Tsvg I can generate -Gphase=3 and -Gphase=4 outputs which are usefully rendered as .svg (according to the layout algorithms I’m debugging), but -Gphase=1 and -Gphase=2 don’t seem to yield useful .svg files. (They have `viewbox="0.00 0.00 8.00 8.00"` and a bunch of circles with `cx="0" cy="0"` which doesn’t seem very promising. An SVG viewer shows them as 8x8 pixels with maybe a letter V or some curves.)

Outputting .gv files yield dot files which beg the question of how they should be displayed. Whichever version of dot I use to lay them out yields its favorite layout (after I remove the `phase=` line from the file).

So: -Gphase=3 and -Gphase=4 are useful with -Tsvg. I don’t see how others are useful.

---

<div class="post-metadata">

**Author:** ![brianrmurphy](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@brianrmurphy](https://forum.graphviz.org/u/brianrmurphy)\
**Post date:** [March 10, 2026, 7:31pm UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/8 "2026-03-10T19:31:38Z")

</div>

Also, is there any chance that there is a hidden feature to show spline regions on top of the final dot graph (as in Figure 5-1 in TSE93.pdf)?

---

<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:** [March 10, 2026, 8:38pm UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/9 "2026-03-10T20:38:53Z")

</div>

Here is a gist containing my shell script & gvpr program  
([illustrateDot - showing how dot (a Graphviz program) works · GitHub](https://gist.github.com/steveroush/5ff332e297bf6b98a89dbc02447925f4))

Phase 1 & 2 only “work” because the gvpr program adds the missing coordinates.

Is this ([bugs in current "showboxes" implementation (#2699) · Issues · graphviz / graphviz · GitLab](https://gitlab.com/graphviz/graphviz/-/work_items/2699)) what you are after regarding spline regions?

---

<div class="post-metadata">

**Author:** ![brianrmurphy](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@brianrmurphy](https://forum.graphviz.org/u/brianrmurphy)\
**Post date:** [March 11, 2026, 6:52am UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/10 "2026-03-11T06:52:19Z")

</div>

> Is this ([bugs in current “showboxes” implementation (#2699) · Issues · graphviz / graphviz · GitLab](https://gitlab.com/graphviz/graphviz/-/work_items/2699)) what you are after regarding spline regions?

Cool, thanks. I suspect that being able to apply it to a single edge at a time might be useful for debugging layout issues.

---

<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:** [March 11, 2026, 1:16pm UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/11 "2026-03-11T13:16:15Z")

</div>

> [@steveroush](#):
>
> phase

By the way, although the phase looks interesting, what I actually meant earlier was to display the step-by-step iteration process of each node reaching its final position during Phase 2 to 3.

---

<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:** [March 11, 2026, 7:36pm UTC](https://forum.graphviz.org/t/development-scripts-tips-location/3320/12 "2026-03-11T19:36:42Z")

</div>

Some _step-by-step_ thoughts & possibilities:

- _step-by-step_ might be too fine-grained for many graphs
- both mincross (phase 2) & ns (phase 3) can be terminated early
  - using **mclimit** ([mclimit | Graphviz](https://www.graphviz.org/docs/attrs/mclimit/)) for mincross
  - using **nslimit** ([nslimit | Graphviz](https://www.graphviz.org/docs/attrs/nslimit/)) for ns
  - the code for the above might have to be modified for the desired granularity
  - then use the appropriate value for **phase** to produce a dot-format output, as for **illustrateDot** (above)

- phase 2 would seem to present a set of images showing nodes hopping left & right on their appointed ranks
- phase 3 would show the nodes sliding left & right, but keeping their appointed order.
- the spline boxes only apply to phase 4 and can be applied via post-processing (similar to [Fun with edges!](https://forum.graphviz.org/t/fun-with-edges/888))
