Sample Library based code
// Some code
var nodes = new vis.DataSet([
{id: 1, label: 'Entity 1', color: 'red'},
{id: 2, label: 'Entity 2', color: 'blue'},
{id: 3, label: 'Entity 3', color: 'green'}
]);
var edges = new vis.DataSet([
{from: 1, to: 2, label: 'Attribute 1'},
{from: 2, to: 3, label: 'Attribute 2'},
{from: 3, to: 1, label: 'Attribute 3'}
]);
var container = document.getElementById('visualization');
var data = {
nodes: nodes,
edges: edges
};
var options = {
nodes: {
shape: 'dot',
size: 20
},
edges: {
font: {
size: 10
},
arrowStrikethrough: false
}
};
var network = new vis.Network(container, data, options);
Last updated