MPS language visualizer
A JetBrains MPS plugin to visualize the structure of a language.
The visualization does not yet show in an integrated window, but can be quite usable when using an image viewer which refreshes on file change.
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 (www.oracle.com/technetwork/java/javase)
- Download PlantUML jar file from http://plantuml.sourceforge.net/download.html and store it into your home directory
- Install GraphViz (http://www.graphviz.org/) to satisfy PlantUML dependency (e.g.
sudo apt-get install graphvizor
choco install graphviz)
- Download and install ant (e.g. using
sudo apt-get install antor
choco install apache.ant)
- Install the auto-refreshing image viewer of your choice (e.g.
sudo apt-get install eogor
choco install irfanview)
- 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")
- Clone this git repository
Build the plugin
- (Optional) regenerate the build.xml file
- Open the mps-langstructvis solution in MPS.
- Adjust the mps_home path in the build solution
- Rebuild all solutions (there should be a build.xml now 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:
- Select "File" -> "Settings" -> "Plugins" -> "Install plugin from disk".
- From the "build/artifacts/GenerateMetaModelDocumentation" subdirectory of the project select the zip file.
- Press "OK" and "Restart"
You can create the following types of visualizations:
- Full structure of a language (right click "structure" of 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")
Note that no panel is automatically opened yet. Only a file is generated and an external PlantUML is required to show the image. For more information see the next sections.
Currently the main usage is the inheritance hierarchy for a certain concept. This is especially useful when interfaces are heavily used. Other visualizations may not be very complete. However the code is currently quite compact and can be tweaked where needed.
Viewing the visualization with PlantUML
- 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.txt file and you will have a picture that autorefreshes every time you call the visualizer in MPS.
Viewing the visualization with your favorite image viewer
- Start your image viewer (e.g. "eog ~/mps-metamodel.png")
- If your viewer automatically refreshes, you can leave it open and keep on creating visualizations.