qref.experimental.rendering
Experimental visualization capabilities for QREF.
Currently, the visualizations are done with graphviz, which does not suport hierarchical structures. Therefore, we have to use a somewhat hacky representation of our routines:
- The leaf nodes are drawn as a single graphviz node (this is not surprising) with Mrecord shape. This allows to visually separate routine name from its ports.
- The non-leaf nodes are represented as clusters.
- Clusters can't use Mrecord shape, and so the ports are drawn as separate nodes.
- Input and output ports are grouped into subgraphs with the same rank, which forces all inputs / all outputs to be placed in a single column.
Because of the above dichotomy, care has to be taken when constructing edges. - If addressing port of a leaf, it must be specified as graphviz port, e.g: "root.child:in_0" - If addressing port of a non-leaf, you use normal node reference, e.g: "root.child.in_0"
GRAPH_ATTRS
module-attribute
LEAF_NODE_KWARGS
module-attribute
PORT_NODE_KWARGS
module-attribute
to_graphviz
Convert routine encoded with v1 schema to a graphviz DAG.