Vis.js: 你能在悬停时显示属性吗?

Vis.js: Can you show properties on hovering?

我知道悬停在节点上可以显示标题属性。但是我还可以显示其他属性吗?另外,对边缘做同样的事情怎么样?

谢谢, 鲍勃

您也可以在边上使用标题 属性。 并且您需要在将其绑定到网络之前生成 title 属性。

var nodes = new vis.DataSet([
  { id: 1, label: "Node 1", title: 'generate text before binding the sets' },
  { id: 2, label: "Node 2" },
  { id: 3, label: "Node 3" },
  { id: 4, label: "Node 4" },
  { id: 5, label: "Node 5" }
]);

// create an array with edges
var edges = new vis.DataSet([
  { from: 1, to: 3, title: 'from 1 to 3' },
  { from: 1, to: 2, title: 'from one 2 two' },
  { from: 2, to: 4 },
  { from: 2, to: 5 },
  { from: 3, to: 3 }
]);

看到这个example