I am trying to build an animation using vis.js network. In one part, I need to show the value of a node at the center of the node.
Thus, I have convert the value of a node to its label. However, since I also resize the node, I have to use the dot node type. Here is an example of what I have here:
var nodes = new vis.DataSet([
{id: 1, value:1, label: '1'},
{id: 2, value:2, label: '2'},
{id: 3, value:3, label: '3'},
{id: 4, value:4, label: '4'},
{id: 5, value:5, label: '5'}
]);
var options = {
nodes:{
shape: "dot",
scaling: {
customScalingFunction: function (min, max, total, value){
return value/total
},
min: 5,
max: 150,
}
}
};
Would appreciate if anyone can help.