Wednesday, June 04, 2008
 

Visualizing EMF models with Graphviz

Michael Clay and I have built an integration (currently proof of concept) between EMF and Graphviz. Actually, this is especially relevant for textual models (created via Xtext) since GraphViz has very good auto-layout facilities; so it becomes realistic and useful to automatically render a diagram from a specification (textual model) that has no layout information in it.



Here's the way it works: Michael has created an EMF representation of the dot language (GraphViz's language for describing the to-be-rendered graph). He has also built a generator (using oAW's Xpand) that actually generates the dot file. This can then be rendered by the GraphViz dot renderer.

Here's how you render your own model: you write a model-to-model transformation that maps you meta model onto the dot meta model. To do that, I wrote a bunch of oAW extension functions that make this job easy.

To render the example picture above from my textual spec, I had to write about 30 lines of Xtend code -- not much.

If you're interested, we're currently in the process of figuring out where and how to make it available.

Labels:

 
Comments:
Why don't you guys use Zest? It renders really nice graphics and unlike Graphviz it is all Java
 
Because I couldn't find any reasonable documentation for ZEST.

Any idea where I could find some?
 
Markus, You're right and that is completely my fault.

I have been updating the snippets

http://www.eclipse.org/gef/zest/snippets.php

and I will link to that site today, but there is no excuse for why I don't have a good article on using Zest. Consider this my top priority now!
 
I took a stab at implementing a prototype with Zest.See http://screencast.com/t/A3wo1SRQz. With the help if Ian's scriptlets, this was a matter of 2 hours or so. Zest is pretty cool!
 
Do you consider to continue with graphviz? It has its strengths!

One feature I really like is, that you can render your graphs for a target size (A4, A3 or 2xA3). If you generate pdf via postscript then you can search on your (maybe big) models.
 
we're currently in the process
of figuring out where and how to make it available.


Markus, if you still don't have a home for this work, I believe that at least the dot metamodel implementation would be a great contribution to the EclipseGraphviz project:

http://eclipsegraphviz.wiki.sourceforge.net/

Let me know if you are interested.

Cheers,

Rafael
 
Rafael,

That makes sense for GraphViz, although Markus and I chatted off-line a bit about a project to hold meta-models for many different types of visualizations: GrpahViz, BIRT Charts, Maps, etc... Between the Meta-models and the viewer (which understands the meta-models), a developer could map and render their data relatively easily.

I have most of these meta-models from my PhD work, and I would be happy to contribute them.
 
Ian and Markus, we are working to create visualization of EMF sources through the use of intermediary models. The perfuse example produces a GraphML transformation (albeit not a model). One was mentioned for Graphviz.

As anyone tackle this before? Ian, you kind of mention that you did? Any possibility of sharing this or your thoughts at least?

We want to be able to leverage a number of rendering techonologies, starting with Zest and Perfuse and maybe Graphviz/Grappa and Birt for charts.

Is it a good idea to go with something like GraphML as our intermediary model (or something closely derived from it), or should we consider the Perfuse data model instead ? We obviously would want to produce an EMF model of this graphing data and use M2M transformation to create the content and then push that out to the renderers.
 
Ian and Marcus, we are looking at creating some visualization of EMF models with the use of a model in the middle and the use of different renderers.

I noticed that the Perfuse example use GraphML for exchange (albeit not a model) and that a model has been mentioned for Graphviz earlier.

Does anyone have any of those models to share or at least some thoughts about the right approach here.

We want to use a variety of renders, such as Zest, Perfuse, Graphviz/Grappa and BIRT Charts to name a few.

Should we base our model on GraphML or on Perfuse data model or is there a better approach.

We want to populate the model through M2M transformation and then push the content to the rendered with M2T or other means.
 
Hi Alain,

> Ian and Marcus, we are looking
> at creating some visualization
> of EMF models with the use of a
> model in the middle and the use
> of different renderers.

right! That's the way to go.

> I noticed that the Perfuse
> example use GraphML for exchange
> (albeit not a model) and that a
> model has been mentioned for
> Graphviz earlier.

both approaches use an explicit model. In case of GraphML, I then serialize it to XML because I didn't want to bother with the Prefuse API. But that's a hack that should be changed,

> Does anyone have any of those
> models to share or at least some
> thoughts about the right
> approach here.

sure. I can send you the code with the (meta)models if you let me know your Email address.

> We want to use a variety of
> renders, such as Zest, Perfuse,
> Graphviz/Grappa and BIRT Charts > to name a few.

yes :-)

> Should we base our model on
> GraphML or on Perfuse data model
> or is there a better approach.

I am not an expert there, GraphML looked ok.

> We want to populate the model
> through M2M transformation and
> then push the content to the
> rendered with M2T or other means.

right. That's what I do too.

Markus
 
Hi all,

I have a similar need (visualisation of parts of a Xtext model).

Is there already something elaborated availablle?

I simply do not want to re-invent the wheel. So what is currently the right starting point?

Was your work merge this work merged into the graphviz Eclipse plug-in or into Zest? Or is there any other project for it?

Cheers,
Marco
 
what we have ended up doing is creating an EMF model for dot and a simple transform from the ecore instance to the textual dot file that then gets processed.

So our app produces an instance of the dot ecore model and then we get the output sent for rendering
 
Here is an alternative to rapidly turn an EMF model into a diagram with Graphviz :
http://marketplace.eclipse.org/content/emf-graphviz-emf2gv

Regards.
 
Post a Comment

<< Home

back to voelter.de

ABOUT ME
This is Markus Voelter's Blog. It is not intended as a replacement for my regular web site, but rather as a companion that contains ideas, thoughts and loose ends.

ARCHIVES
December 2005 / January 2006 / February 2006 / March 2006 / April 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / February 2007 / March 2007 / April 2007 / May 2007 / June 2007 / July 2007 / September 2007 / October 2007 / November 2007 / December 2007 / January 2008 / February 2008 / March 2008 / April 2008 / May 2008 / June 2008 / July 2008 / August 2008 / September 2008 / October 2008 / November 2008 / December 2008 / January 2009 / February 2009 / March 2009 / April 2009 / May 2009 / June 2009 / July 2009 / August 2009 / September 2009 / October 2009 / November 2009 / December 2009 / January 2010 / February 2010 / April 2010 / May 2010 / June 2010 / July 2010 / August 2010 / September 2010 / October 2010 / November 2010 / December 2010 / January 2011 / March 2011 / April 2011 / May 2011 / June 2011 / July 2011 / October 2011 / November 2011 / December 2011 / January 2012 / February 2012 / October 2012 / January 2013 /

FEED
You can get an atom feed for this blog.