Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "GEF/GEF4/DOT/User Guide"

< GEF‎ | GEF4‎ | DOT
(Created page with "== GEF4 DOT User Guide == This component adds a DOT editor and a ''DOT Graph'' view to the UI. The DOT editor can be used to edit [http://www.graphviz.org Graphviz] *.dot fil...")
 
m
Line 1: Line 1:
== GEF4 DOT User Guide ==
+
''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 [http://wiki.eclipse.org/GEF/GEF4/DOT the original wiki page]''.
  
This component adds a DOT editor and a ''DOT Graph'' view to the UI. The DOT editor can be used to edit [http://www.graphviz.org Graphviz] *.dot files, while the DOT Graph view allows to render them within Eclipse using [[GEF/GEF4/Zest | GEF4 Zest]], as well as to export them as PDF using the [http://www.graphviz.org/ Graphviz] native executable.  
+
__NOTOC__
 +
 
 +
The [[GEF/GEF4/DOT| GEF4 DOT]] component adds a DOT editor and a ''DOT Graph'' view to the UI. The DOT editor can be used to edit [http://www.graphviz.org Graphviz] *.dot files, while the DOT Graph view allows to render them within Eclipse using [[GEF/GEF4/Zest | GEF4 Zest]], as well as to export them as PDF using the [http://www.graphviz.org/ Graphviz] native executable.  
  
 
Please note that the DOT editor and the [[GEF/GEF4/Zest | GEF4 Zest]]-based rendering of the DOT Graph view are currently still limited to support only a subset of the DOT language (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=454629 #454629], [https://bugs.eclipse.org/bugs/show_bug.cgi?id=321775 #321775], and [https://bugs.eclipse.org/bugs/show_bug.cgi?id=441352 #441352] for details).
 
Please note that the DOT editor and the [[GEF/GEF4/Zest | GEF4 Zest]]-based rendering of the DOT Graph view are currently still limited to support only a subset of the DOT language (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=454629 #454629], [https://bugs.eclipse.org/bugs/show_bug.cgi?id=321775 #321775], and [https://bugs.eclipse.org/bugs/show_bug.cgi?id=441352 #441352] for details).

Revision as of 08:14, 28 January 2016

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 GEF4 DOT component adds a DOT editor and a DOT Graph view to the UI. The DOT editor can be used to edit Graphviz *.dot files, while the DOT Graph view allows to render them within Eclipse using GEF4 Zest, as well as to export them as PDF using the Graphviz native executable.

Please note that the DOT editor and the GEF4 Zest-based rendering of the DOT Graph view are currently still limited to support only a subset of the DOT language (see #454629, #321775, and #441352 for details).

DOT editor

The DOT editor is registered for *.dot files within the Eclipse Workbench UI. It is based on Xtext and thus provides support for syntax coloring, content assist, and integrated validation, as well as a customized Outline view integration.

DotEditor.png

The editor also provides a 'Sync Graphviz Export (PDF)' option (toggle button in the toolbar; using the default printer icon), which - if enabled - automatically stores a PDF file representing the saved state of the edited .dot file to the directory containing the .dot file, and opens it with the associated external PDF viewer, if one is available. The export relies on executing the native Graphviz dot binary. In this example, the export looks like this:

DotZestM2Rendered.png

DOT Graph view

The DOT Graph view ('Window -> Show View -> Other... -> Visualization -> DOT Graph') can be used to visualize DOT graphs contained in *.dot files or embedded in other files, which are either explicitly loaded from the workspace, or synched with the .dot file currently being edited in the active DOT editor.

The view draws the DOT graphs using GEF4 Zest and allows for PDF export of the currently visualized Zest graph (based on the Graphviz executable).

For instance, consider a file with the .dot extension, containing the following DOT graph definition:

digraph s{ 
 n1[label="Node 1"]; n2[label="Node 2"]; 
 n1 -> n2[style=dotted label="A dotted edge"]
}

Loading it in the DOT Graph view will result in the following:

GEF4-DOT-DotGraphView.png

The DOT Graph view can be linked with the DOT editor to visualize the saved state of the currently edited .dot file (link mode):

DotZestEditor.png

It can further be used to display embedded DOT in other files, e.g. in source code comments or in wiki markup:

DotZestWikiText.png

This provides a GEF4 Zest-based DOT authoring environment. If a *.dot file or embedded DOT is edited, it will be visualized in the DOT Graph view, and can be exported as a PDF with Graphviz. At the same time the view provides a simple way to visualize *.dot file output of any kind of program, e.g. to visualize and debug internal data structures, results, etc: if a program running in Eclipse outputs any *.dot file in the workspace and the workspace is refreshed, the view will be updated with the corresponding Zest graph.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.