Note to non-wiki readers: This documentation is generated from the Eclipse wiki - if you have corrections or additions it would be awesome if you added them in the original wiki page .
The DOT component provides the Graphviz DOT authoring environment consisting of the DOT Editor, the DOT Graph View, the DOT Preference Page and the Sync Graphviz Export toggle button to the Eclipse UI. The DOT Editor can be used to edit Graphviz *.dot files, while the DOT Graph View allows to render them in Eclipse using Zest. The Sync Graphviz Export feature uses the Graphviz native executable to export the *.dot files into different image formats such as *.pdf, *.png, *.svg ...etc., which can be configured on the DOT Preference Page.
The Graphviz DOT authoring environment provides a simple way to visualize *.dot file outputs of any kind of program (e.g. to visualize and debug internal data structures, results, ...etc.) running in Eclipse. If a *.dot file in the Eclipse workspace appears or updated, the DOT Graph View and the image export also show up/updated automatically.
The DOT Editor is an Xtext-based textual editor registered for the *.dot files in the Eclipse workbench UI. It provides – amongst others – support for the following features:
![](images/dot-user-guide/DOT_Editor_01_Syntax_Highlighting.png "DOT Editor Syntax Highlighting")
CTRL + SPACE
. Depending on the current cursor position, only those language elements will be offered that make sense within the given context: graph attributes names within a graph context, edge attribute names within an edge context and all possible attribute values within a certain attribute context.
![](images/dot-user-guide/DOT_Editor_02_Content_Assistant.png "DOT Editor Content Assistant")
![](images/dot-user-guide/DOT_Editor_03_Template_Proposals.png "DOT Editor Template Proposals")
ENTER
key in a graph definition properly indents the cursor in the subsequent new line.
![](images/dot-user-guide/DOT_Editor_04_AutoEditing.png "DOT Editor Auto Editing")
![](images/dot-user-guide/DOT_Editor_05_BracketMatching.png "DOT Editor Bracket Matching")
![](images/dot-user-guide/DOT_Editor_06_CodeMining.png "DOT Editor Code Mining")
![](images/dot-user-guide/DOT_Editor_07_Hovering.png "DOT Editor Hovering")
![](images/dot-user-guide/DOT_Editor_08_Error_Checking.png "DOT Editor Error Checking")
CTRL + 1
either in the editor or on the corresponding Problems View entry. Applying such a quickfix can for instance replace an invalid dot attribute value by a valid one.
![](images/dot-user-guide/DOT_Editor_09_Quickfixes.png "DOT Editor Quickfixes")
CTRL + 1
. After clicking on the Finish button, all Invalid Edge Operator errors will be fixed at once with a single quickfix action.
![](images/dot-user-guide/DOT_Editor_10_Multi-Quickfixes.png "DOT Editor Multi-Quickfixes")
Source -> Format
context menu of the editor or via the keyboard shortcut
CTRL + SHIFT + F
. It automatically corrects the indentations, inserts/removes white spaces/line breaks without changing the underlying semantic model.
![](images/dot-user-guide/DOT_Editor_11_Formatting.png "DOT Editor Formatting")
![](images/dot-user-guide/DOT_Editor_12_Outline_View.png "DOT Editor Outline View")
CTRL + O
keyboard shortcut opens the Outline View in a popup window. The Quick Outline View also supports searching for elements using wildcard symbols such as * or CamelCase search.
![](images/dot-user-guide/DOT_Editor_13_Quick_Outline_View.png "DOT Editor Quick Outline View")
![](images/dot-user-guide/DOT_Editor_14_Folding.png "DOT Editor Folding")
CTRL + click
or hit
F3
e.g. on a source/target node of an edge to directly jump to the corresponding node definition.
![](images/dot-user-guide/DOT_Editor_15_Hyperlink_Navigation.png "DOT Editor Hyperlink Navigation")
![](images/dot-user-guide/DOT_Editor_16_Marking_Occurrences.png "DOT Editor Marking Occurrences")
![](images/dot-user-guide/DOT_Editor_17_Find_References.png "DOT Editor Find References")
ALT + SHIFT + R
triggers the in-place linked editing inclusive validation and preview. The performed action renames the selected element (e.g. a node) together with all the references (e.g. in edges). The 'Rename Element' action is even undoable via the
Edit -> Undo Rename Element
submenu or using the keyboard shortcut
CTRL + Z
.
![](images/dot-user-guide/DOT_Editor_18_Rename_Refactoring.png "DOT Editor Rename Refactoring")
//
symbols) and multi-line (surrounded by the
/*
*/
symbols) comments at any place in a dot file. The user can even use the toggle comment keyboard shortcut
CTRL + /
to comment/uncomment the current line/the currently selected lines in the editor.
![](images/dot-user-guide/DOT_Editor_19_Adding_Toggling_Comments.png "DOT Editor Adding/Toggling Comments")
![](images/dot-user-guide/DOT_Editor_20_TODO_FIXME_XXX_Statements.png "DOT Editor TODO/FIXME/XXX Statements")
![](images/dot-user-guide/DOT_Editor_21_New_Project_Wizard_New_File_Wizard.png "DOT Editor New Project Wizard / New File Wizard")
Window -> Preferences -> GEF DOT
preference pages. They enable to change the default syntax coloring styles, to define additional template proposals ...etc.
![](images/dot-user-guide/DOT_Editor_22_Preferences.png "DOT Editor Preferences")
Open With -> Sample Ecore Model Editor
context menu, a *.dot file can be opened with the EMF tree editor to inspect the in-memory tree-structure representation (the Abstract Syntax Tree - AST) of the textual dot file.
![](images/dot-user-guide/DOT_Editor_23_Integration_with_other_editors.png "DOT Editor Integration with other editors")
![](images/dot-user-guide/DOT_Editor_24_Sync_Graphviz_Export.png "DOT Editor Sync Graphviz Export")
The export relies on executing the native Graphviz dot binary, which can be configured under the `Windows -> Preferences -> GEF DOT -> Graphviz` preference page.
![](images/dot-user-guide/DOT_Editor_24_Graphviz_Preference_Page.png "DOT Editor Graphviz Preference Page")
Show In -> GEF DOT Graph
context menu of the
DOT Editor to visualize the contained DOT graph definition.
![](images/dot-user-guide/DOT_Editor_25_Visualizing_the_DOT_Graph.png "DOT Editor Visualizing the DOT Graph")
The
DOT Graph View (
Window -> Show View -> Other... -> GEF -> GEF DOT Graph
) is able to visualize DOT graphs either contained in *.dot files, embedded in other files, or synched with the dot file currently being edited in the active
DOT Editor. E.g. loading the
/*
* sample Graphviz DOT graph
*/
digraph {
edge[dir=both]
1
2 [shape=diamond fillcolor="/greys3/2" fontcolor="blue" style=filled]
3
4 [shape=circle xlabel="external node label" style="bold, dashed"]
5 [shape=box label="internal node label"]
1 -> 2 [
style=dashed
headlabel="head label"
taillabel="tail label"
]
3 -> 2 [style=dotted, label="edge label"]
2 -> 4 [arrowtail=box]
4 -> 5 [arrowhead=teeodot]
2 -> 5 [arrowhead=vee, xlabel="external edge label"]
}
DOT graph definition into the DOT Graph View results either in the 'native mode' representation (when the dot executable is configured, it is used for layouting), or in the 'emulated mode' representation (when the dot executable is not configured, the layouting is emulated by using a comparable Layout algorithm).
The DOT Editor is also able to automatically notify the DOT Graph View when the user saves the currently modified dot file. Using the 'Link with DOT Editor' functionality, there is no need to manually trigger the graph visualization to re-render the currently edited dot file in the DOT Graph View.
The DOT Graph View can even be used to visualize DOT graph definitions embedded in other files. These files can be loaded into the DOT Graph View via the 'Load *.dot file (or file with embedded DOT)' toolbar button e.g. to visualize DOT graph definitions in source code comments or in wiki markups: