Skip to content

Resources for Diagram development

Alexander Pann edited this page Jan 13, 2025 · 3 revisions

Use the language de.itemis.mps.editor.diagram to create diagrams. It should be used instead of the deprecated language jetbrains.mps.lang.editor.diagram. A very short introduction to the language can be found in the documentation.

The Java library behind the language is the deprecated library jgraphx. If you can't find the code in the language runtime, it comes from this repository.

For layouting the diagrams, the Eclipse Layout Kernel is used:

There is a list of open issues for the language: Diagram: Meta Issue.

You can export diagrams for debugging, by including diagram_lib ("org.eclipse.elk:org.eclipse.elk.graph.json:0.9.1") in the build script and creating stubs for those new JAR files in de.itemis.mps.editor.diagram.runtime. To export them as JSON files add the following code to ElkLayouter#layoutOnce after buildKGraph():

try { 
  PrintWriter writer = new  PrintWriter(new File(yourLocation)); 
  writer.write(ElkGraphJson.forGraph(graph).toJson()); 
  writer.flush(); 
  writer.close(); 
} catch (FileNotFoundException e) { 
  <no statements> 
}
Clone this wiki locally