jgraph / drawio-desktop

Official electron build of draw.io

Home Page:https://www.diagrams.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML export feature - include local copy of JS libraries for offline/air-gapped viewing

IAXES opened this issue · comments

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Is your feature request related to a problem? Please describe.
I am testing the "export to HTML" feature, and the resulting output is nice (very useful for interactive diagram and training materials). However, it can only be viewed when my machine has internet access. Presumably this is to fetch the JavaScript library needed to render the diagrams, but I'm not certain of whether or not the script pulls additional dependencies. In any case, it would be helpful if the "export to HTML" feature included a copy of the necessary dependencies (and have the HTML reference the local copies rather than one on a remote server) so that one could view the HTML render of the final diagram when no internet access is available, or if one is deploying to an air-gapped LAN (i.e. student lab network).

If it's impractical to implement this feature, is there at least a means to manually implement this? (i.e. pull the JS files and any other necessary artifacts from some canonical/official location like a jgraph git repo) so that offline viewing of the HTML exports work?

Describe the solution you'd like
Noted above.

Describe alternatives you've considered
Noted above (i.e. manual workaround if full-blown enhancement/feature-request is impractical).

Additional context
N/A.

Additionally, lab security policies might require a static snapshot of the JS rather than a "live" copy being pulled every time the page is loaded (assuming the browser always purges local cache daily).

Thank you.

Export as SVG and embed that?

@davidjgraph I exported my multi-page diagram as an SVG, but it just provides a single page view (i.e. currently-open page) and the interactive functionality (i.e. links) are not present, at least when opening the .svg file locally via Firefox. The intent is to preserve/retain the interactive functionality (but in an offline/air-gapped use case).

Best solution is fork the repo and change the viewer URL in preconfig.js to point at the server.

Sounds good. Thanks for the help, and this awesome tool.

Cheers!