Controlling the convex / curvature of edges

Heya, is it possible to change the curve direction of an edge to be “outward in”?

For example the blue edge here, is there a way to tell dot, “make the curve convex to the right”.

image

I’m not concerned if the edges overlap, because I control each edge’s visibility.

Things I’ve tried:

  • Using edge ports
  • Using splines = curved
  • Looking for an attr that tells dot “don’t care if edges overlap!”, but couldn’t find one

The dot source is rather big, but you can play with it here, click on generated.dot – second tab on the top left, then Ctrl F for:

localhost_target_customer_app_v1_config_yaml__my_work_org_internal_customer_app_v1_config_yaml__response

Changes in the text box are rendered on the right.

Thanks in advance :man_bowing:!

[I will use the terms cw & ccw for clock-wise & counter-clock-wise]

Short answer: no, there is no simple way to specify cw or ccw for an edge. And note that this concept has little or no meaning for a edge that wanders all around a graph.

Long answer: yes, it can be done (see below), but it require DIY edge routing. Here is a gvpr program that does what you ask. You could also write an equivalent in python, C, or other languages that talk Graphviz.
To get the image below:

  • added these attributes edgeType=curved edgeDirection=cw edgeOffset=22 to the last edge
  • used this pipeline f=peace2.gv; T=png;F=${f%.*};dot $f |gvpr -cf alterSimpleEdge.gvpr | neato -n2 -T$T >$F.$T

Giving:

p.s. my gvlint program says:

Bad value for ((Root) graph) G (nodesep = 0.0). Should be >= "0.02".
"penwidth" is not a defined (Root) graph attribute for "dot". 
1 Like

Wow thanks!

It looks like to run that in WASM, gvpr needs to be compiled to WASM (as part of hpcc?), then use something like alterSimpleEdge.gvpr.

It’ll probably sit on the back burner for a while, since it’s at the level of “make it aestheticcally pleasing”, and I haven’t even gotten my main project hooked into this.

Also, having two lines, no ports, and increasing nodesep seems to achieve something good enough.