Questions tagged [dot]

DOT is both a mathematical graph description language and a particular graph rendering engine (dot). As a graph description language, DOT uses a simple plain text mapping syntax to describe the relationships between nodes and edges (e.g. `nodeA -> nodeB`) , and a plain text markup syntax to add style, annotations, and constrain the rendered layout.

DOT is a plain text graph description language. It is a simple way of describing graphs that both humans and computer programs can use.

The following Example:

digraph g{

    // basic: A,B,C,D  (this is a comment)
    A -> B -> C -> D
    D -> C
    B -> D

    // node and edge markups
    nodeA [shape=diamond, color=red, style=dashed, label="Warehouse 259"]
    nodeA -> nodeB [color=blue, style=solid, label="MWF schedule, 2 ton capacity"]

}

will render to this graph:

enter image description here

DOT graphs are typically files that end with the .gv (preferred) or .dot extension.

Most uses of DOT are either by GraphViz programs or by software that uses GraphViz internally.

941 questions
42
votes
1 answer

size of node with shape=circle

i'm trying to set the size of the nodes this way: controller[shape=circle,width=.5,label="Controller",style=filled,fillcolor="#8EC13A"]; But all three nodes are with different size. How can i set fixed size?
cupakob
  • 7,691
  • 24
  • 60
  • 75
41
votes
3 answers

How to place edge labels ON edge in graphviz

By default in Graphviz, edge labels are placed just to the right of the edge. I'm looking for a way to place the labels OVER the edge, centred on the edge. (It'll still be readable because I'm changing the colour of the edge). Any ideas?
naught101
  • 16,068
  • 19
  • 81
  • 128
39
votes
2 answers

Prevent overlapping records using graphviz and neato

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 program but I think I really want it processed by neato to create a more "free…
Chris Williams
  • 443
  • 1
  • 4
  • 6
36
votes
1 answer

Rank attribute is confusing to me

Rank attribute on edge has five values "same", "min", "source", "max", "sink". Except "same", I have no idea when to use other values. min \begin{dotpic} rankdir=LR; size="7,5"; node[shape=circle]; C->A; {rank=min;A;B} B->D …
nirvana9235
  • 535
  • 1
  • 4
  • 7
36
votes
2 answers

Graphviz: how to set 'default' arrow style?

Consider this dot language code: digraph graphname { subgraph clusterA { node [shape=plaintext,style=filled]; 1 -> 2 [arrowhead=normal,arrowtail=dot]; 2 -> 3 -> X2 -> 5; 6; 7; label = "A"; …
sdaau
  • 32,015
  • 34
  • 178
  • 244
35
votes
6 answers

Converting dot to png in python

I have a dot file generated from my code and want to render it in my output. For this i have seen on the net that the command is something like this on cmd dot -Tpng InputFile.dot -o OutputFile.png for Graphviz But my problem is that I want to use…
user506710
34
votes
3 answers

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…
Stephane Rolland
  • 34,892
  • 31
  • 111
  • 159
33
votes
1 answer

How to control subgraphs' layout in dot?

i have a digraph composed of many independant and simple subgraphs of various sizes. dot lays all these subgraphs horizontally, so i end up with a 40000x200 output file, e.g: G1 G2 G3 G.....4 G5 How do i tell dot to layout these subgraphs in both…
Benoît
  • 3,134
  • 2
  • 26
  • 30
33
votes
4 answers

Reading DOT files in javascript/d3

Is there a standard way to read and parse DOT graph files in javascript, ideally in way that will work nicely in d3? Currently, the only thing I can think of doing is reading plain text and doing my own parsing. Hopefully this'd be reinventing the…
ajwood
  • 15,375
  • 15
  • 54
  • 90
32
votes
3 answers

Improve positioning of subscript and superscript on node labels

When using both subscript and superscripts on a node label, is it possible to alter the positioning so that they are directly above each other. Example: digraph G { x11[label=1(1)>]; …
user2957945
  • 2,229
  • 1
  • 17
  • 29
31
votes
1 answer

Graphviz .dot node ordering

I'm building a epsilon NFA to recognize a regular expression using the canonical construction. I'm using subgraphs to group various parts of the regular expression. The * operator is giving me particular trouble since dot has decided to move the…
Michael Conlen
  • 1,789
  • 2
  • 15
  • 18
30
votes
1 answer

Forcing orthogonal (vertical or horizontal) edges with dot

I would like to force dot displaying only vertical or horizontal edges between nodes. I have found a similar request with the post Family tree layout with Dot/GraphViz, but I am not dealing with trees, so I hope there is a solution without inserting…
nocbos
  • 361
  • 1
  • 4
  • 6
29
votes
3 answers

How does one define double-lines for edge and node shapes in graphviz dot?

How can edges and nodes be styled using graphviz dot with doubled lines as shown the in the "LEGAL" and "TAX DISC" nodes of the following diagram?
Judge Maygarden
  • 25,264
  • 8
  • 76
  • 98
28
votes
1 answer

group nodes with subgraphs

I'd like to group some nodes with the following code digraph dataflow { subgraph pipeline { relations; synonyms; articles; } subgraph lucene { index; search; } training_data - > index; …
Reactormonk
  • 20,410
  • 12
  • 66
  • 110
27
votes
2 answers

How do I get DOT to display an image for a node?

I am not having success displaying an image at a node in dot. My node is defined: SW103 [image="swOpen.png"] I can view swOpen.png so I think the file is ok, and it is in the same directory as the code. But dot displays the node using its label…
kathleen gould
  • 303
  • 1
  • 3
  • 7
1
2
3
62 63