我使用以下示例生成有向图
我想添加一个单击事件,以便当用户单击某个节点时,显示该节点的标题
到目前为止,我这样做了
var circle = svg.append("svg:g").selectAll("circle")
.data(force.nodes())
.enter().append("svg:circle")
.attr("r", 6)
**.on("mouseup", disp)**
.call(force.drag);
;
function disp() {
alert("Display the heading of the node clicked here");
};
请告诉我如何显示