-
vizulyJune 21, 2016 at 10:29 am #6225
Hi John,
Yes you are right about the data tip.
So the best way to go here would be to expose an onclick event in the actual halo source code which isn’t that hard. It will require just a couple of things in the src/viz/halo.js file.
1. Add a new custom event to this line:
var customEvents = [“linkover”,”nodeover”,”arcover”,”linkout”,”nodeout”,”arcout”];
TO
var customEvents = [“linkover”,”nodeover”,”arcover”,”linkout”,”nodeout”,”arcout”,”nodeclick”];2. Attach this event to a node by adding to this code here:
circle.enter().append(“circle”).attr(“class”,function (d) { return “vz-halo-node node-key_” + d.key; })
.on(“mouseover”,function (d,i) { scope.dispatch.nodeover(this,d,i) })
.on(“mouseout”,function (d,i) { scope.dispatch.nodeout(this,d,i) });
ADD
.on(“click”,function (d,i) { scope.dispatch.nodeclick(this,d,i) });Now the halo component exposes a node click event.
In your test container you will want to probably add a url to the node data property so you can access when responding to the click event which would be like the below.
myHalo.on(“nodeclick”,function (d,i) { window.open(d.myNodeUrl); });
Let me know how that works for you.
– Tom
You must be logged in to reply to this topic.
© 2024 — vizuly.io