I have a problem with vis.js, I cannot increase the size of a node and the font of its label.
nodes.push({id: el, label: currentNode.hostName,font: {color:'#FF9900', face:'courier',size:300}, group: "Domain", color:{background: getColor(currentNode) , border: getColor(currentNode) }, value: 10000, title: label,labelHighlightBold: true, borderWidthSelected: 7 });
Domain: {
shape: 'triangleDown',
shapeProperties: {
useImageSize: false,
size:3333
}
}
Thank you
I have a problem with vis.js, I cannot increase the size of a node and the font of its label.
nodes.push({id: el, label: currentNode.hostName,font: {color:'#FF9900', face:'courier',size:300}, group: "Domain", color:{background: getColor(currentNode) , border: getColor(currentNode) }, value: 10000, title: label,labelHighlightBold: true, borderWidthSelected: 7 });
Domain: {
shape: 'triangleDown',
shapeProperties: {
useImageSize: false,
size:3333
}
}
Thank you
Share Improve this question asked Jun 24, 2016 at 14:36 urotiuroti 1472 silver badges11 bronze badges2 Answers
Reset to default 5you can define the font size inside the option for creating the network
var options = {
nodes : {
shape : 'dot',
size : 15,
color : '#ECBF26', // select color
font : {
size : 16,
color : '#ffffff'
},
borderWidth : 2
},
Well, I know its a little late, but I just started working with viz.js so you can do it like this:
Assuming you have your nodes save in NODES
NODES.update({ id: yourNodeId, size: 100 });
With the same method you can pretty much change anything (except for theid, which I havent been able to change like this yet) on your nodes or edges.
You can find that here, although I must admit that I ve seen better documentation for a library.
http://visjs/docs/data/dataset.html