VivaGraphJS
VivaGraphJS copied to clipboard
Cannot run any example code
Getting the same errors every time
vivagraph.js:1 Uncaught SyntaxError: Unexpected token < index_twit_viva.html:8 Uncaught ReferenceError: Viva is not defined
What is this file index_twit_viva.html
?
Sorry to miss that info. That is the same content as the demo - "01 - Create Graph.html"
The example works here: https://anvaka.github.io/VivaGraphJS/demos/tutorial_svg/01%20-%20Create%20Graph.html
Are you sure vivagraph is loaded on your page? Do you see any other errors in the developer console?
No other error besides those two. I think the vivagraph is not loading, although the local path for the file vivagraph.js is correct.
I changed the line in demo to this -
Now the only error I am getting is this - index_twit_viva.html:10 Uncaught ReferenceError: Viva is not defined
main @ index_twit_viva.html:10 onload @ index_twit_viva.html:33
Just wondering, if this is a node app you just created, are you able to load in any other local JS files just fine? If you're using something like express, your app.js package should have something like this:
// Load static files (ie public/javascripts/*.js)
app.use(express.static(path.join(__dirname, 'public')));
Then you can put the vivagraph dist file in public/javascripts/vivagraph.js
and be able to call it from your view template as : <script src="javascripts/vivagraph.js"></script>
I created a boilerplate repo that may help a bit: https://github.com/joerodrig3/vivagraph-boilerplate