benfred/venn.js

How to get data object on click ?

Closed this issue · 2 comments

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

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);
});

Hi Thanks for your replied. I will try it and let's you know