I am studying the grapheditor example under mxgraph's javascript https://github.com/jgraph/mxgraph/tree/master/javascript/examples/grapheditor
However, I notice there are two parts. There's a javascript/HTML portion in the www folder. And there's a java portion.
I am a bit rusty from my Java, so I cannot be sure what the Java code is responsible for.
Does the Javascript and HTML portion be totally responsible for the UI/UX display of the GraphEditor example?
Meaning to say things like displaying the action menu and drag and drop etc are handled by the javascript and html portion?
So what's the Java code responsible for exactly?
The front-end part is only client-side JavaScript and HTML. The Java back-end is partly historic for older browsers that couldn't do things like open/save locally without echoing the file via a server.
There's also export functionality on the server. A long time ago browsers couldn't generate raster images (like PNG) locally, so the server had to do it. Now IE 11 is the only supported browser that cannot do this.
There's also PDF export, no browser can currently do this, so that's always generated on the server. See https://github.com/jgraph/mxgraph/blob/master/javascript/examples/grapheditor/java/src/com/mxgraph/examples/web/GraphEditor.java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With