Nasdankia provides two Maven modules for working with Drawio diagrams - API and Model. The modules require Java 17 or above.
Drawio module provides Java API for reading and manipulating Drawio diagrams. It is built on top of Graph.
The module provides the following interfaces representing elements of a diagram file:
The below diagram shows relationships between the above interfaces including their super-interfaces:
Util provides utility methods such as layout()
and methods to navigate and query documents and their elements.
With Nasdanika Drawio API and other products you can make your diagrams executable. There are two primary methods:
The first option requires less coding, the second is more flexible.
Executable (computational) graphs & diagrams story provides a high level overview of executable graphs and diagrams. Graph documentation features more technical details and code samples. Beyond Diagrams book explains the mapping approach. And Compute Graph Demo provides examples of the both approaches using the compute graph from the “Executable (computational) graphs & diagrams” story.
Drawio Model module provides an EMF Ecore model for diagrams. A model instance can be obtained from the API document by calling Document.toModelDocument()
method.
The model makes it more convenient to work with the diagram elements by: