2
使用Sigma.js我想将自定义图像添加到图形的节点。我发现a plugin,包括nodeShapes.js和plotter.js,然后添加图像属性:将自定义图像添加到节点
var imgUri="somepicture.png"
sigInst.addNode(id,{
'x': Math.random(),
'y': Math.random(),
'label': data.nodes[i].val,
// 'color': color, commenting this line out to add custom images to the nodes
'image':{'url':imgUri},
'cluster': clusters['cluster_id']
});
但图形保持不变,我仍然看到默认的点。
你是否设法让这个工作? – CodeGuru