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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks @cdanielgomes