magjac / d3-graphviz

Graphviz DOT rendering and animated transitions using D3
BSD 3-Clause "New" or "Revised" License
1.67k stars 103 forks source link

Modify node shape from javascript #276

Closed wjj1928 closed 1 year ago

wjj1928 commented 1 year ago

My dot graph file is very big, it do not define shape attribute for nodes, how can I define the default nodes shape as rectangle?

magjac commented 1 year ago

Questions like this are probably better suited at https://forum.graphviz.org/c/help/5, but try this:

digraph {
    node [shape=rectangle]
    a -> b
}

See the result and experiment yourself at http://magjac.com/graphviz-visual-editor/?dot=digraph%20%7B%0A%20%20%20%20node%20%5Bshape%3Drectangle%5D%0A%20%20%20%20a%20-%3E%20b%0A%7D