dreampuf / GraphvizOnline

Let's Graphviz it online
https://dreampuf.github.io/GraphvizOnline/
BSD 3-Clause "New" or "Revised" License
799 stars 213 forks source link

use Workaround for loading page on local disk #19

Closed SimonStier closed 3 years ago

SimonStier commented 3 years ago

When opening index.html from local disk, Firefox and Chrome prevent loading of the worker script "full.render.js" from local source. Therefore a workaround from https://stackoverflow.com/questions/21408510/chrome-cant-load-web-worker was used to enable both local and hosted use

dreampuf commented 3 years ago

Hi @SimonStier I think I need more background regarding these two commits. What's the short key of ctrl+shift+7 stands for? Or is that your personal config?

Enabling the local file mode is an interesting feature, even it was designed for the worker for leveraging multicore. Could you use python simple server? That could help you set up a simple web server in a second.

# py2
python -m SimpleHTTPServer
# py3 
python3 -m http.server
SimonStier commented 3 years ago

Hi @dreampuf,

default short key for block comment is ace.js is ctrl+/, but it doesn't work with a german keyboard layout (see https://github.com/ajaxorg/ace/issues/2506). Block comments are very useful when you are demonstrating a GraphiViz graph live and want to dynamically hide parts of the graph. Therefore the workaround. But that is a very specific problem and was actually not intended for the merge request at all (sorry).

GraphvizOnline is in my opinion the best editor for GraphViz ( many thanks for the work by the way), but unfortunately not directly available offline. So I thought it would be handy if you can just download the source code and run the editor locally. You are of course right that a minimal local web server means only minimal more effort. So please consider this only as a optional suggestion how to make your project additionally a load & run offline application. However, this is also rather a special problem. So maybe it would be best to just leave the changes in the forked project. =)