I am building a network graph using vis.js
The problem is, how do I make all the images the same size? (see live example here --> parison of wordpress & drupal)
here's the graph code:
var nodes = [];
nodes.push({
id: 7,
shape: 'image',
image: '/static/windows8_icons/PNG/Industry/circuit/circuit-26.png',
label: 'sharepoint',
widthMin: 20,
widthMax: 20
});
edges.push({
from: 1,
to: 7,
length: 100
});
var data = {
nodes: nodes,
edges: edges
};
var options = {
smoothCurves: false,
stabilize: false,
nodes: {
shape: 'image',
radius: 24,
fontSize: 18,
widthMin: 20,
widthMax: 20
},
edges: {
width: 2
}
};
network = new vis.Network(container, data, options);
I am building a network graph using vis.js
The problem is, how do I make all the images the same size? (see live example here --> parison of wordpress & drupal)
here's the graph code:
var nodes = [];
nodes.push({
id: 7,
shape: 'image',
image: '/static/windows8_icons/PNG/Industry/circuit/circuit-26.png',
label: 'sharepoint',
widthMin: 20,
widthMax: 20
});
edges.push({
from: 1,
to: 7,
length: 100
});
var data = {
nodes: nodes,
edges: edges
};
var options = {
smoothCurves: false,
stabilize: false,
nodes: {
shape: 'image',
radius: 24,
fontSize: 18,
widthMin: 20,
widthMax: 20
},
edges: {
width: 2
}
};
network = new vis.Network(container, data, options);
Share
edited Sep 17, 2014 at 9:07
laaposto
12.2k15 gold badges58 silver badges72 bronze badges
asked Aug 5, 2014 at 9:55
NimoNimo
8,3147 gold badges43 silver badges41 bronze badges
3
- are your .png files all the same dimensions starting out? – RandomDeduction Commented Aug 5, 2014 at 16:39
- Sorry I didn't mention it.. Obviously the files are not the same size to begin with :( – Nimo Commented Aug 5, 2014 at 20:26
- I have same problem, have you solved this problem? – Mochammad Taufiq Commented Nov 23, 2018 at 7:15
1 Answer
Reset to default 3Go for size attribute of node.
Example
nodes:{shape:'image',size:20}
Reference: http://visjs/docs/network/nodes.html