tgdwyer / WebCola

Javascript constraint-based graph layout
http://marvl.infotech.monash.edu/webcola/
MIT License
2.03k stars 258 forks source link

Question: can I use without node.js ? #328

Open LazarenkoA opened 2 years ago

LazarenkoA commented 2 years ago

In this example, I want to load json from a file or from a string, is it possible? https://github.com/tgdwyer/WebCola/blob/master/website/examples/smallworldwithgroups.html

FalseProtagonist commented 2 years ago

Webcola is able to run in the browser, this is not really to do with this library just how the web platform works.

If you want to load json in a browser, then you need to either put the file in a place where the web page is able to access it (in the public folder that index.html is in, usually) or put the data into the source code (just copy and paste it in and assign it to a variable).