Search code examples
graphvizdot

How to set default node shape to box instead of oval?


I have some long labels in my graph written in dot language. As a result, (the default shape being oval) I have some not very practical thin really long oval in my graph which take much space.

I would like to set the default shape to box for all my nodes, unless specified otherwise.

I have seen the node notation, but it requires to list any node impacted by the styles.

Is it possible in dot language ?


Solution

  • using the node notation without listing the impacted nodes make the node shape style applied by default.

    digraph ExampleGraph
    {
        node [shape="box"];
    
        a -> b -> c -> d;
    }