The draw() method currently fixes the layout method for the drawn diagram as Kamada-Kawai. This is laying out the nodes in a roughly circular pattern, with no orientation based on node depth.
As a feature request, this layout method could be exposed as a keyword argument for the draw() method, allowing the user to try alternative layout algorithms. Or even provide their own positions for nodes.
In particular, the graphviz/dot algorithm might be better for these kinds of diagrams, because it would position the nodes vertically in depth order.
That said, I believe using the graphviz layout in NetworkX requires the installation of an additional and somewhat cumbersome dependency (the graphviz package, which is an C library not installable with pip, if memory serves). So while it is a useful option, there may be good reasons not to use it as the default layout.
The
draw()
method currently fixes the layout method for the drawn diagram as Kamada-Kawai. This is laying out the nodes in a roughly circular pattern, with no orientation based on node depth.As a feature request, this layout method could be exposed as a keyword argument for the
draw()
method, allowing the user to try alternative layout algorithms. Or even provide their own positions for nodes.https://github.com/causalincentives/pycid/blob/e79b237a098ea1d2a128f2296be589858df2e4f3/pycid/core/causal_bayesian_network.py#L269-L281
In particular, the graphviz/dot algorithm might be better for these kinds of diagrams, because it would position the nodes vertically in depth order.
That said, I believe using the graphviz layout in NetworkX requires the installation of an additional and somewhat cumbersome dependency (the graphviz package, which is an C library not installable with
pip
, if memory serves). So while it is a useful option, there may be good reasons not to use it as the default layout.