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"

< GEF‎ | GEF4
(Introduction)
Line 3: Line 3:
 
== Introduction ==
 
== Introduction ==
  
The [[GEF/GEF4/DOT | GEF4 DOT]] component provides support for the [http://www.graphviz.org/ Graphviz] [http://www.graphviz.org/doc/info/lang.html DOT language], both as input and output format. It delivers:
+
The [[GEF/GEF4/DOT | GEF4 DOT]] component provides support for the [http://www.graphviz.org/ Graphviz] [http://www.graphviz.org/doc/info/lang.html DOT language], both as input and output format.  
  
* an Xtext-based DOT parser and serializer
+
It provides API to import/export DOT files to/from [[GEF/GEF4/Graph | GEF4 Graph]], so they can be visualized with [[GEF/GEF4/Zest | GEF4 Zest]]. It further provides end-user tools to work with DOT-files, i.e. an Xtext-based DOT editor as well as a [[GEF/GEF4/Zest | GEF4 Zest]]-based DOT Graph Viewer.
* import/export functionality from/to [[GEF/GEF4/Graph | GEF4 Graph]], so that it can be visualized with [[GEF/GEF4/Zest | GEF4 Zest]]
+
* an Xtext-based DOT text editor  
+
This component was started as a [http://socghop.appspot.com/student_project/show/google/gsoc2009/eclipse/t124022230869 project] in the [[Google Summer of Code 2009]] by [[User:Steeg.netcologne.de|Fabian Steeg]], mentored by Ian Bull, for [[GEF Zest Visualization|Zest]]. It was initially included in [[Zest#Zest_2.x|Zest 2]] and has finally been migrated to [[GEF/GEF4/DOT | GEF4 DOT]], being now based on [[GEF/GEF4/Graph | GEF4 Graph]], [[GEF/GEF4/Layout | GEF4 Layout]], and [[GEF/GEF4/Zest | GEF4 Zest]].
* a [[GEF/GEF4/Zest | GEF4 Zest]]-based DOT Graph Viewer
+
  
== User Documentation ==
+
=== Future Ideas ===
  
=== GUI ===
+
* Add support for different Graphviz shapes through [http://eclipsesource.com/blogs/2009/03/20/just-in-time-for-eclipsecon-custom-figures-in-zest/ Zest custom figures], e.g. for UML class diagrams
 +
* Add support to visualize Graphviz subgraphs as separate Zest graphs that can be accessed from the main graph
 +
* Look into possible ways of supporting Graphviz edge decorators (open or closed arrows, diamonds, etc.)
 +
* Map all graph, node and edge attributed from DOT input to corresponding Zest widget data (currently supported for graph attributes)
 +
* Add animation support using something like ''subgraph cluster_animation_1 { label = "Step 1"; 1->2 }'' etc., where animation steps are represented as subgraphs in the DOT input (which if rendered with Graphviz results in a static description of the animation)
  
This feature adds a DOT editor and a DOT Graph View to the UI:
+
For instance, for the input below a Zest animation could be created that changes like this (this is an experimental illustation of the idea):
  
[[Image:DotZestViewSelection.png]]
+
digraph SampleAnimation {
 
+
  /* We can specify a Zest layout for the animation here: */
==== DOT Graph View ====
+
  layout=tree // = TreeLayoutAlgorithm
 
+
  /* Global attributes can be defined for edges and nodes: */
The DOT Graph view can visualize DOT graphs in *.dot files or embedded in other files in the workspace. The view draws the DOT graphs using Zest and allows for image export of the current Zest graph. When automatic updating is enabled (see below), and a *.dot file or embedded DOT content is added to the workspace or altered in an editor, the Zest graph view is updated with the graph created from the DOT input. For instance, consider a file with the .dot extension, containing the following DOT graph definition:  
+
   node[label="Node"]
 
+
  edge[label="Edge" style=dotted]
digraph s{
+
  1;2;3;4;5
   n1[label="Node 1"]; n2[label="Node 2"];  
+
   /* The single animation steps are marked by numbers: */
   n1 -> n2[style=dotted label="A dotted edge"]
+
  subgraph cluster_animation_0{ 1 -> 2 [label="Dashed" style=dashed]}
 +
  subgraph cluster_animation_1{ 1 -> 3 }
 +
  subgraph cluster_animation_2{ 3 -> 4; 3 -> 5}
 
  }
 
  }
 
 
The view will display:
 
  
[[Image:DotZestGraphView.png|200px]]
+
After the first step:
  
The view contains buttons to toggle automatic updates, to load a specific file containing a DOT graph, and to layout the current graph. To export the current Zest graph as an image file by calling the ''dot'' executable, the view contains buttons to re-select the directory containing the ''dot'' executable, to enable export of the original DOT input, and to export as an image file (from left to right). When the image export button is selected, a PDF for the current graph is saved in the directory containing the file with the DOT input, and opened with the associated external editor, if one is available. In this example, the export looks like this:
+
[[Image:DotZestM5Screenshot1.png|200px]]
  
[[Image:DotZestM2Rendered.png]]
+
And the final state of the graph:
  
This provides a Zest-based DOT authoring environment. If a *.dot file or embedded DOT is edited, it will be visualized in the Zest Graph view (e.g. during editing), and can be exported as a PDF with Graphviz.
+
[[Image:DotZestM5Screenshot2.png|200px]]
  
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 (if automatic updating is enabled, see above).
+
The same input file, exported with Graphviz, shows the animation steps as subgraphs:
  
==== Editing ====
+
[[Image:DotZestAnimatedExport.png|200px]]
  
The Zest view can be used with the included DOT editor to visualize a DOT file:
+
A possible use case for defining such animations with DOT is to easily create animated documentation, e.g. to explain data structures. The same file defining the animation could be used to export a PDF illustrating the steps in a static way.
  
[[Image:DotZestEditor.png|400px]]
+
== User Documentation ==
 
+
Additionally, the Zest view also displays embedded DOT in other files, e.g. [http://fsteeg.wordpress.com/2010/01/07/visual-textual-documentation-with-dot-and-zest-in-eclipse/ in source code comments] or [http://fsteeg.wordpress.com/2010/02/07/diagrams-in-wiki-markup-with-mylyn-wikitext-dot-and-zest/ in wiki markup]:
+
 
+
[[Image:DotZestWikiText.png|400px]]
+
  
 
=== API ===
 
=== API ===
Line 135: Line 134:
 
[[Image:Zest2-osage-zest.png|150px]]
 
[[Image:Zest2-osage-zest.png|150px]]
  
== Developer Documentation ==
+
=== GUI ===
  
The goal of this feature is to implement the [http://www.graphviz.org/ Graphviz] [http://www.graphviz.org/doc/info/lang.html DOT language] as a domain-specific language (DSL) for [http://www.eclipse.org/gef/zest/ Zest: The Eclipse Visualization Toolkit], both as an input and output format. In other words, the goal is to transform both DOT graphs to Zest visualizations (to be used in Java SWT applications), and Zest visualizations to DOT graphs (to be rendered as image files with Graphviz).
+
This component adds a DOT editor and a DOT Graph View to the UI:
  
This feature started as a [http://socghop.appspot.com/student_project/show/google/gsoc2009/eclipse/t124022230869 project] in the [[Google Summer of Code 2009]] by [[User:Steeg.netcologne.de|Fabian Steeg]], mentored by Ian Bull, for [[GEF Zest Visualization|Zest]]. It is included in [[Zest#Zest_2.x|Zest 2]].
+
[[Image:DotZestViewSelection.png]]
  
=== Resources  ===
+
==== DOT Graph View ====
  
The main bug for this feature is {{bug|277380}}. View a [https://bugs.eclipse.org/bugs/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__all__&product=GEF&content=%5Bdot4zest%5D complete list] of related bugs. If you have suggestions for this feature you can [https://bugs.eclipse.org/bugs/enter_bug.cgi?bug_file_loc=http%3A%2F%2Fwiki.eclipse.org%2FGraphviz_DOT_as_a_DSL_for_Zest&bug_severity=enhancement&bug_status=NEW&comment=&component=Zest&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&description=&flag_type-1=X&flag_type-2=X&flag_type-6=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=All&priority=P3&product=GEF&rep_platform=All&short_desc=%5Bdot4zest%5D%20New%20request%20summary&version=unspecified file a new bug].
+
The DOT Graph view can visualize DOT graphs in *.dot files or embedded in other files in the workspace. The view draws the DOT graphs using Zest and allows for image export of the current Zest graph. When automatic updating is enabled (see below), and a *.dot file or embedded DOT content is added to the workspace or altered in an editor, the Zest graph view is updated with the graph created from the DOT input. For instance, consider a file with the .dot extension, containing the following DOT graph definition:
  
===Motivation===
+
digraph s{
 +
  n1[label="Node 1"]; n2[label="Node 2"];
 +
  n1 -> n2[style=dotted label="A dotted edge"]
 +
}
 +
 
 +
The view will display:
  
Graphviz is a very popular tool and its DOT language is widely used. Support for it could make using Zest very easy for many people who are familiar with DOT.  
+
[[Image:DotZestGraphView.png|200px]]
  
DOT integration for Zest could also be useful for existing Eclipse tools that are based on Graphviz, like [http://abstratt.com/textuml/ TextUML] or [http://eclipsegraphviz.wiki.sourceforge.net/ EclipseGraphviz], and others, for instance in the [http://tasktop.com/blog/eclipse/rich-editing-for-tasks-via-mylyn-wikitext Mylyn rich task editor] (for [http://fsteeg.wordpress.com/2010/02/07/diagrams-in-wiki-markup-with-mylyn-wikitext-dot-and-zest/ embedding DOT graphs in wiki text markup, visualized with Zest]).
+
The view contains buttons to toggle automatic updates, to load a specific file containing a DOT graph, and to layout the current graph. To export the current Zest graph as an image file by calling the ''dot'' executable, the view contains buttons to re-select the directory containing the ''dot'' executable, to enable export of the original DOT input, and to export as an image file (from left to right). When the image export button is selected, a PDF for the current graph is saved in the directory containing the file with the DOT input, and opened with the associated external editor, if one is available. In this example, the export looks like this:
  
On the output side, Zest can benefit from Graphviz output as it provides a way to produce high-quality export into different file formats, e.g. for printing Zest visualizations, or using them in digital publications.
+
[[Image:DotZestM2Rendered.png]]
  
===Implementation===
+
This provides a Zest-based DOT authoring environment. If a *.dot file or embedded DOT is edited, it will be visualized in the Zest Graph view (e.g. during editing), and can be exported as a PDF with Graphviz.
  
The dot4zest functionality is implemented based on [http://www.eclipse.org/modeling/ Eclipse Modeling] technologies, in particular [http://wiki.eclipse.org/Xtext Xtext] (part of [http://www.eclipse.org/modeling/tmf TMF]) for the input part (parse DOT, generate Zest) and [http://wiki.eclipse.org/M2T-JET JET] for the output (see details below).
+
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 (if automatic updating is enabled, see above).
  
[[Image:DotZestOverview.png|thumb|175px|right|Implementation of Graphviz DOT input and output for Zest using Eclipse modeling technology]]
+
==== Editing ====
  
====DOT to Zest====
+
The Zest view can be used with the included DOT editor to visualize a DOT file:
  
Based on an Xtext grammar, dot4zest interprets the parsed DOT EMF model using the generated Xtext switch API to dynamically create Zest graphs. The Zest graph view uses this to display DOT with Zest (see above).
+
[[Image:DotZestEditor.png|400px]]
  
====Zest to DOT====
+
Additionally, the Zest view also displays embedded DOT in other files, e.g. [http://fsteeg.wordpress.com/2010/01/07/visual-textual-documentation-with-dot-and-zest-in-eclipse/ in source code comments] or [http://fsteeg.wordpress.com/2010/02/07/diagrams-in-wiki-markup-with-mylyn-wikitext-dot-and-zest/ in wiki markup]:
  
To transform Zest graph instances to the Graphviz DOT language dot4zest uses [http://wiki.eclipse.org/M2T-JET JET].
+
[[Image:DotZestWikiText.png|400px]]
  
There are two reasons to use JET instead of Xpand here. First, this allows us to transform any Zest graph instance to DOT directly (not only those for which we have a DOT meta model instance that could act as the input to Xpand).
+
== Developer Documentation ==
  
Second, even if we had a DOT meta model instance (which we could create from the Zest graph), using Xpand would introduce a runtime dependency on the [http://wiki.eclipse.org/Modeling_Workflow_Engine_(MWE) Modeling Workflow Engine], whereas with JET we only introduce a dependency on a single class (the generator class JET created from the template).
+
===Implementation===
  
===Future Ideas===
+
The import/export functionality is implemented based on [http://www.eclipse.org/modeling/ Eclipse Modeling] technologies, in particular [http://wiki.eclipse.org/Xtext Xtext] (part of [http://www.eclipse.org/modeling/tmf TMF]) for the input part (parse DOT, generate Zest) and [http://wiki.eclipse.org/M2T-JET JET] for the output (see details below).
  
* Add support for different Graphviz shapes through [http://eclipsesource.com/blogs/2009/03/20/just-in-time-for-eclipsecon-custom-figures-in-zest/ Zest custom figures], e.g. for UML class diagrams
+
[[Image:DotZestOverview.png|thumb|175px|right|Implementation of Graphviz DOT input and output for Zest using Eclipse modeling technology]]
* Add support to visualize Graphviz subgraphs as separate Zest graphs that can be accessed from the main graph
+
* Look into possible ways of supporting Graphviz edge decorators (open or closed arrows, diamonds, etc.)
+
* Map all graph, node and edge attributed from DOT input to corresponding Zest widget data (currently supported for graph attributes)
+
* Add animation support using something like ''subgraph cluster_animation_1 { label = "Step 1"; 1->2 }'' etc., where animation steps are represented as subgraphs in the DOT input (which if rendered with Graphviz results in a static description of the animation)
+
  
For instance, for the input below a Zest animation could be created that changes like this (this is an experimental illustation of the idea):
+
====DOT to Zest====
  
digraph SampleAnimation {
+
Based on an Xtext grammar, GEF4 DOT interprets the parsed DOT EMF model using the generated Xtext switch API to dynamically create GEF4 Graph graphs. The Dot Graph view uses this to display DOT with GEF4 Zest (see above).
  /* We can specify a Zest layout for the animation here: */
+
  layout=tree // = TreeLayoutAlgorithm
+
  /* Global attributes can be defined for edges and nodes: */
+
  node[label="Node"]
+
  edge[label="Edge" style=dotted]
+
  1;2;3;4;5
+
  /* The single animation steps are marked by numbers: */
+
  subgraph cluster_animation_0{ 1 -> 2 [label="Dashed" style=dashed]}
+
  subgraph cluster_animation_1{ 1 -> 3 }
+
  subgraph cluster_animation_2{ 3 -> 4; 3 -> 5}
+
}
+
  
After the first step:
+
====Zest to DOT====
  
[[Image:DotZestM5Screenshot1.png|200px]]
+
To transform GEF4 Graph graph instances to the Graphviz DOT language GEF4 DOT uses [http://wiki.eclipse.org/M2T-JET JET].
  
And the final state of the graph:
+
There are two reasons to use JET instead of Xpand here. First, this allows us to transform any GEF4 Graph graph instance to DOT directly (not only those for which we have a DOT meta model instance that could act as the input to Xpand).
  
[[Image:DotZestM5Screenshot2.png|200px]]
+
Second, even if we had a DOT meta model instance (which we could create from the GEF4 Graph graph), using Xpand would introduce a runtime dependency on the [http://wiki.eclipse.org/Modeling_Workflow_Engine_(MWE) Modeling Workflow Engine], whereas with JET we only introduce a dependency on a single class (the generator class JET created from the template).
  
The same input file, exported with Graphviz, shows the animation steps as subgraphs:
 
 
[[Image:DotZestAnimatedExport.png|200px]]
 
 
A possible use case for defining such animations with DOT is to easily create animated documentation, e.g. to explain data structures. The same file defining the animation could be used to export a PDF illustrating the steps in a static way.
 
  
 
[[Category:SOC]]
 
[[Category:SOC]]
 
[[Category:GEF]]
 
[[Category:GEF]]

Revision as of 07:32, 1 February 2015

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.

Introduction

The GEF4 DOT component provides support for the Graphviz DOT language, both as input and output format.

It provides API to import/export DOT files to/from GEF4 Graph, so they can be visualized with GEF4 Zest. It further provides end-user tools to work with DOT-files, i.e. an Xtext-based DOT editor as well as a GEF4 Zest-based DOT Graph Viewer.

This component was started as a project in the Google Summer of Code 2009 by Fabian Steeg, mentored by Ian Bull, for Zest. It was initially included in Zest 2 and has finally been migrated to GEF4 DOT, being now based on GEF4 Graph, GEF4 Layout, and GEF4 Zest.

Future Ideas

  • Add support for different Graphviz shapes through Zest custom figures, e.g. for UML class diagrams
  • Add support to visualize Graphviz subgraphs as separate Zest graphs that can be accessed from the main graph
  • Look into possible ways of supporting Graphviz edge decorators (open or closed arrows, diamonds, etc.)
  • Map all graph, node and edge attributed from DOT input to corresponding Zest widget data (currently supported for graph attributes)
  • Add animation support using something like subgraph cluster_animation_1 { label = "Step 1"; 1->2 } etc., where animation steps are represented as subgraphs in the DOT input (which if rendered with Graphviz results in a static description of the animation)

For instance, for the input below a Zest animation could be created that changes like this (this is an experimental illustation of the idea):

digraph SampleAnimation {
 /* We can specify a Zest layout for the animation here: */
 layout=tree // = TreeLayoutAlgorithm
 /* Global attributes can be defined for edges and nodes: */
 node[label="Node"]
 edge[label="Edge" style=dotted]
 1;2;3;4;5
 /* The single animation steps are marked by numbers: */
 subgraph cluster_animation_0{ 1 -> 2 [label="Dashed" style=dashed]}
 subgraph cluster_animation_1{ 1 -> 3 }
 subgraph cluster_animation_2{ 3 -> 4; 3 -> 5}
}

After the first step:

DotZestM5Screenshot1.png

And the final state of the graph:

DotZestM5Screenshot2.png

The same input file, exported with Graphviz, shows the animation steps as subgraphs:

DotZestAnimatedExport.png

A possible use case for defining such animations with DOT is to easily create animated documentation, e.g. to explain data structures. The same file defining the animation could be used to export a PDF illustrating the steps in a static way.

User Documentation

API

Via the API, DOT can be imported to GEF4 Graph graph instances, and GEF4 Graph graph instances can be exported to DOT. To use the API, create a new Plug-in project, add GEF4 DOT and GEF4 Graph to the MANIFEST.MF dependencies, paste the code below into the source folder of the created project, and select Run As > Java Application.

Dot-Export example:

import org.eclipse.gef4.dot.DotExport;
import org.eclipse.gef4.graph.Edge;
import org.eclipse.gef4.graph.Graph;
import org.eclipse.gef4.graph.Graph.Attr;
import org.eclipse.gef4.graph.Node;

public final class DotExportExample {

	public static void main(final String[] args) {
		/* Set up a directed graph with a single connection: */
		Graph.Builder graph = new Graph.Builder();
		Node node1 = new Node.Builder().attr(Attr.Key.ID.toString(), "1")
				.attr(Attr.Key.LABEL.toString(), "Node 1").build();
		Node node2 = new Node.Builder().attr(Attr.Key.ID.toString(), "2")
				.attr(Attr.Key.LABEL.toString(), "Node 2").build();
		Edge edge = new Edge.Builder(node1, node2)
		.attr(Attr.Key.LABEL.toString(), "A dotted edge")
		.attr(Attr.Key.EDGE_STYLE.toString(), Graph.Attr.Value.LINE_DOT)
		.build();
		graph.attr(Graph.Attr.Key.EDGE_STYLE.toString(),
				Graph.Attr.Value.CONNECTIONS_DIRECTED).nodes(node1, node2)
				.edges(edge);

		/* Export the graph to a DOT string or a DOT file: */
		DotExport dotExport = new DotExport(graph.build());
		System.out.println(dotExport.toDotString());
	}

}

Dot-Import example:

import org.eclipse.gef4.dot.DotImport;
import org.eclipse.gef4.graph.Graph;

public final class DotImportExample {

	public static void main(final String[] args) {
		/* We can create Graphs based on GraphViz Dot files/string */
		Graph graph = new DotImport("graph { 1--2 ; 1--3 }").newGraphInstance();
		Graph digraph = new DotImport("digraph { 1->2 ; 1->3 }")
				.newGraphInstance();

		/* We can also import GraphViz Dot files/string into an existing graph */
		Graph.Builder graph2 = new Graph.Builder();
		new DotImport("digraph{1->2}").into(graph2);
		new DotImport("node[label=zested]; 2->3; 2->4").into(graph2); //$NON-NLS-1$
		new DotImport("edge[style=dashed]; 3->5; 4->6").into(graph2); //$NON-NLS-1$
	}

}

The complete sample usage is available in the repository, as well as working DOT input samples.

Layouts

DOT import

During import of DOT graphs into GEF4 Graph graphs, the DOT layout specified in the input is mapped to the most suitable GEF4 Layout layout algorithm - e.g. for the following DOT graph:

graph { 1--2--3; 2--4--5 }

If the graph defines a Graphviz layout, it is mapped to a GEF4 Layout layout as below:

graph[layout=dot];

Zest2-dot-zest.png

graph[layout=fdp];

Zest2-fdp-zest.png

graph[layout=twopi];

Zest2-twopi-zest.png

graph[layout=osage];

Zest2-osage-zest.png

GUI

This component adds a DOT editor and a DOT Graph View to the UI:

DotZestViewSelection.png

DOT Graph View

The DOT Graph view can visualize DOT graphs in *.dot files or embedded in other files in the workspace. The view draws the DOT graphs using Zest and allows for image export of the current Zest graph. When automatic updating is enabled (see below), and a *.dot file or embedded DOT content is added to the workspace or altered in an editor, the Zest graph view is updated with the graph created from the DOT input. 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"]
}
 

The view will display:

GEF4-DOT-DotGraphView.png

The view contains buttons to toggle automatic updates, to load a specific file containing a DOT graph, and to layout the current graph. To export the current Zest graph as an image file by calling the dot executable, the view contains buttons to re-select the directory containing the dot executable, to enable export of the original DOT input, and to export as an image file (from left to right). When the image export button is selected, a PDF for the current graph is saved in the directory containing the file with the DOT input, and opened with the associated external editor, if one is available. In this example, the export looks like this:

DotZestM2Rendered.png

This provides a Zest-based DOT authoring environment. If a *.dot file or embedded DOT is edited, it will be visualized in the Zest Graph view (e.g. during editing), 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 (if automatic updating is enabled, see above).

Editing

The Zest view can be used with the included DOT editor to visualize a DOT file:

DotZestEditor.png

Additionally, the Zest view also displays embedded DOT in other files, e.g. in source code comments or in wiki markup:

DotZestWikiText.png

Developer Documentation

Implementation

The import/export functionality is implemented based on Eclipse Modeling technologies, in particular Xtext (part of TMF) for the input part (parse DOT, generate Zest) and JET for the output (see details below).

Implementation of Graphviz DOT input and output for Zest using Eclipse modeling technology

DOT to Zest

Based on an Xtext grammar, GEF4 DOT interprets the parsed DOT EMF model using the generated Xtext switch API to dynamically create GEF4 Graph graphs. The Dot Graph view uses this to display DOT with GEF4 Zest (see above).

Zest to DOT

To transform GEF4 Graph graph instances to the Graphviz DOT language GEF4 DOT uses JET.

There are two reasons to use JET instead of Xpand here. First, this allows us to transform any GEF4 Graph graph instance to DOT directly (not only those for which we have a DOT meta model instance that could act as the input to Xpand).

Second, even if we had a DOT meta model instance (which we could create from the GEF4 Graph graph), using Xpand would introduce a runtime dependency on the Modeling Workflow Engine, whereas with JET we only introduce a dependency on a single class (the generator class JET created from the template).

Back to the top