Prevent overlapping records using graphviz and neato

后端 未结 2 1689
野的像风
野的像风 2020-12-30 19:16

I am building a dot file to represent computer hardware and the physical connections to a network switch and displays. I have it looking ok when processed by the dot progra

2条回答
  •  时光说笑
    2020-12-30 19:51

    Setting overlap to false will work for neato as the community wiki answer says; however, if the graph exhibits any kind of regularity or symmetry, [overlap=false] will often mess it up by jiggling the nodes around to make them not overlap.

    Use [overlap=false] as a last resort. All node overlaps that are outputted from neato can be viewed as occurring because the nodes are too big relative to the edges. You can make any overlaps go away by making the nodes smaller and preserve symmetry in the graph drawing by setting [overlap=scale]. Quoting the Neato user manual:

    To improve clarity, it is sometimes helpful to eliminate overlapping nodes or edges. One way to eliminate node overlaps is just to scale up the layout (in terms of the center points of the nodes) as much as needed. This is enabled by setting the graph attribute overlap=scale. This transformation preserves the overall geometric relationships in the layout, but in bad cases can require high scale factors

    As the documentation says [overlap=false] can result in graph drawings that are unacceptably large, but if it does not its output is generally going to be better looking than [overlap=false].

提交回复
热议问题