7
votes

We are trying to use the latest Draw.io repository, and modify the javascript client side code to change some of its behaviors for an improved UX. But, the only up to date source we can find is here: https://github.com/jgraph/draw.io/tree/master/war/js

You'll notice that several of the source files are already minified, such as app.min.js

We found an old non-minified version of draw.io from 5 years ago: https://github.com/vmassol/draw.io

But it looks like it's missing a lot of functionality..

Does anyone have more information about this? Is there a way to get the non-minified source of the up to date version? Just how much functionality is missing from the old version? Or, do we misunderstand something, and the minified files, like app.min.js are just pre-built products from the source that's in the rest of the directories?

Thanks!

2

2 Answers

12
votes

The minified and non-minified (NM) sources are both in the project. The NM sources mostly live in the diagramly folder (the old name for draw.io) and the GraphEditor folder.

If you look in the build file, you can see which sources go into which *.min.js files.

The GraphEditor source serve as the base stack under draw.io. It used to be maintained as a cut-down editor, just not any longer.

0
votes

i managed to run the app from the unminified modifying the index.html as follows:

// Changes paths for local development environment
    if (urlParams['dev'] == '1') {
        // Used to request grapheditor/mxgraph sources in dev mode
        //the line below was: var mxDevUrl = document.location.protocol + '//devhost.jgraph.com/mxgraph2';
        var mxDevUrl = document.location.origin + '/mxgraph'; 

        // Used to request draw.io sources in dev mode
        //the line below was : var drawDevUrl = document.location.protocol + '//devhost.jgraph.com/drawio/src/main/webapp/';
        var drawDevUrl = document.location.origin + '/drawio/src/main/webapp/'; 

        ...

        //The line below was: var geBasePath = mxDevUrl + '/javascript/examples/grapheditor/www/js';
        var geBasePath = drawDevUrl + '/js/mxgraph';
        var mxBasePath = mxDevUrl + '/javascript/src';
        ...
    }

To make everything work I had to start an http-server (es. nodejs http-server module) at mxgraph and drawio repos parent.