mxGraph Draw.IO File Parser and JSON Data Model
Parses Draw.io or diagrams.net file that may be compressed into pure JSON.
Also provides simple Typescript interfaces and an indexing data model for searching the graph model.
Draw.io essentially encapsulates a 2D canvas API for drawing stencils and graphs, so graphics commands and command serialization is a significant part of the Draw.io XML serialization.
Order is important for graphics commands therefore it is import that the JSON translation maintains the XML element order.
You must include Pako
/** * Externals: * You must add these to your application. */globalpako = ; var mxd = ;var fs = ; var fname = "./data/cisco1.drawio";var drawfile = fs;mxd;
Usage:
node ./examples/parse_compressed.js MXFile name: ./data/cisco1.drawioMXFile version: 13.6.0Diagram name: Page-1