How to get data object on click ?
Closed this issue · 2 comments
kristoff2016 commented
Hello thanks for great plugin. I am looking for the way how to get data objects when user clicked on each cycles.
example: onclick="myfunc(data)"
func myfunc(data) {
console.log('data here', data)
}
thanks for your helps
thanks
benfred commented
I think you're looking something like this (assuming the diagram is in a div with id=venn)
d3.selectAll("#venn .venn-circle")
.on("click", function(data) {
console.log(data);
});
kristoff2016 commented
Hi Thanks for your replied. I will try it and let's you know