MPS language visualizer
A JetBrains MPS plugin to visualize the structure of a language.
The visualization shows in an integrated toolwindow, but the visualisation can also viewed using an image viewer which refreshes on file change.
.travis.yml for the current MPS version of mps-langvis on master. Other versions can be found in the
An integrated tool window is shown when visualizing (parts of) a language.
Tested with Linux, Windows and Mac.
The following installation instructions assume an
apt-get package manager on Linux and the Chocolatey package manager (https://chocolatey.org/) on Windows.
- Install the latest Oracle JDK (
- Download PlantUML jar file from http://plantuml.sourceforge.net/download.html and store it into your home directory (
%HOME%on windows or
$HOMEon linux), for instance /Users/diederikdulfer.
- Install GraphViz (http://www.graphviz.org/) to satisfy PlantUML dependency (e.g.
sudo apt-get install graphvizor
choco install graphviz)
- For Windows: make sure your
JAVA_HOMEenvironment variable points to your JDK (e.g.
set JAVA_HOME="c:\Program Files\Java\jdk1.8.0_45")
- (Optional) If you prefer an alternative to the integrated panel or the PlantUML viewer, install the auto-refreshing image viewer of your choice (e.g.
sudo apt-get install eogor
choco install irfanview)
- Install above Runtime prerequisites
- Download and install ant (e.g. using
sudo apt-get install antor
choco install apache.ant)
- Clone this git repository
Install plugin from https://plugins.jetbrains.com/plugin/10689-com-dslfoundry-langvis
Build the plugin
(Optional) regenerate the
mps-langstructvissolution in MPS.
- Adjust the
mps_homepath in the build solution
Rebuild all solutions (there should be a
build.xmlnow in the top-level folder of the cloned repository)
antin the top-level folder the cloned repository
For Windows, you would typically use the following command:
ant -Dmps_home="C:\Program Files (x86)\JetBrains\MPS 3.1"
- For Mac, you would typically use the following command:
ant -Dmps_home="/Applications/MPS 3.3.app/Contents"
In MPS, install the plugin:
Install plugin from disk.
- From the
build/artifacts/GenerateMetaModelDocumentationsubdirectory of the project select the zip file.
Usage of the plugin
You can create the following types of visualizations:
- Full structure of a language (right click
structureof the language and select
Visualize Language Structure) - hotkey: Ctrl+Shift+M
- Concept structure showing the children and inheritance hierarchy of a concept (Right click concept and select
Visualize Concept Context)
When visualizing the structure, a tool windows automatically opens on the side.
The tool window allows you to select the following options using check boxes:
Structure: Show relations (lines) between children and descendants (the composition structure) of the concept.
Hierarchy: Show concept extension and interface implementation/extension relations (the inheritance hierarchy) of the vizualized concepts.
Cardinality: Show the cardinalities (e.g.
0..n) of the visualized relations.
Role names: Show the names of the child/descendant next to the line.
Flatten namespaces: Do not group items from the same namespace, but show fully qualified names of the items instead.
After adjusting the options, you need to press the
refresh icon to apply the changes.
If the provided tool panel is not to your liking, there are two alternative methods of viewing the visualizations (see sections below)
(Optional) Viewing the visualization with PlantUML's auto-refreshing viewer
- From your home directory start
java -jar ~/plantuml.jar. This will monitor the home directory for plantuml files and generate png files.
- Double click on the
mps-metamodel.txtfile and you will have a picture that autorefreshes every time you call the visualizer in MPS.
(Optional) Viewing the visualization with your favorite image viewer
- Start your image viewer (e.g.
- If your viewer automatically refreshes, you can leave it open and keep on creating visualizations.