Last active
November 4, 2021 09:57
-
-
Save MHenderson/9767470 to your computer and use it in GitHub Desktop.
Minimal example of vis.js (visjs.org).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>vis.js Graph demo</title> | |
<script src="http://visjs.org/dist/vis.js"></script> | |
<link href="http://visjs.org/dist/vis.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<div id="graph"></div> | |
<script type="text/javascript"> | |
var nodes = [ | |
{id: 1, label: 'a'}, | |
{id: 2, label: 'b'}, | |
{id: 3, label: 'c'}, | |
]; | |
var edges = [ | |
{from: 1, to: 2}, | |
{from: 1, to: 3}, | |
{from: 2, to: 3}, | |
]; | |
var container = document.getElementById('graph'); | |
var data = { | |
nodes: nodes, | |
edges: edges, | |
}; | |
var graph = new vis.Graph(container, data, {}); | |
</script> | |
</body> | |
</html> |
Found this does not like to hosted from http://visjs.org/dist/
Download vss.css and vis.min.js to your hosting and it works OK
Hello I found your work very very useful to me since I have been trying to produce something similar. Was excited when I saw this post. However, when I copied and pasted the code in a notepad editor and tried to open it in my google chrome browser, it showed a blank page. Please kindly guide me or help me find out what I did wrong. Thank you very much
if you use vis.Network(container, data, {}) it will work
thanks @cdanielgomes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does not working