Skip to content

Instantly share code, notes, and snippets.

@MHenderson
Last active November 4, 2021 09:57
Show Gist options
  • Save MHenderson/9767470 to your computer and use it in GitHub Desktop.
Save MHenderson/9767470 to your computer and use it in GitHub Desktop.
Minimal example of vis.js (visjs.org).
<!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>
@MHenderson
Copy link
Author

thanks @cdanielgomes

@MHenderson
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment