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.
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:
Tag
is contained by Page
and has bi-directional reference with tagged elements.