I'm using vis.js and want to render a graph that looks like this one: http://visjs.org/examples/network/nodeStyles/circularImages.html
The problem is that I don't know how to set image per node. In documentation it's said:
When you have given a node an option, you will override the global option for that property, and also the group option for that property if the node is in a group. If you then set that option to null, it will revert back to the default value.
But nothing is said about how to give option to a particular node.
Here's my code:
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.18.1/vis.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.18.1/vis.min.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#mynetwork {
width: 600px;
height: 400px;
border: 1px solid lightgray;
}
</style>
</head>
<body>
<div id="mynetwork"></div>
<script type="text/javascript">
var dot = 'hello {Hey->"I am lost"; 2->3; 5->3;}';
var parsed = vis.network.convertDot(dot);
var data = {
nodes: parsed.nodes,
edges: parsed.edges
}
var options = parsed.options;
options.nodes = {
// everything that is here will apply globaly
}
var container = document.getElementById('mynetwork');
var network = new vis.Network(container, data, options);
</script>
</body>
</html>