How do I know if a point is in the area I selected?
like the API: isPointInPath(x, y)
I need to interact with a certain area of the graphic I am drawing.
Unfortunately there isn't a way to "Hit Test" out of the box. However, there are a number of alternatives. For your use case I'd recommend going off this example. You can use the the underlying SVG element to bind to any number of DOM events. In your case the mouseover and mouseout sound like good ones to bind to.
Hope this helps!
Thanks, this example is similar to my case, but I use the canvas, i want to bind different parts in one canvas. can I do this? (Because I had draw a pie charts, I should mouseover in different part and show different tips)
This example shows how you can make a simple Pen Tool in Two.js: https://jsfiddle.net/jonobr1/pvhwc7nu/
But, for your case if the Pie Chart already exists I think you'd have to make a custom function to check for hover etc.. I can make a demo for this, but if you have some sample code it would be easier to build off of and show you a specific example.
FYI: I am tracking hit-test logic here https://github.com/jonobr1/two.js/issues/306
This example shows how you can make a simple Pen Tool in Two.js: https://jsfiddle.net/jonobr1/pvhwc7nu/
But, for your case if the Pie Chart already exists I think you'd have to make a custom function to check for hover etc.. I can make a demo for this, but if you have some sample code it would be easier to build off of and show you a specific example.
supper cool, it's very useful
Most helpful comment
This example shows how you can make a simple Pen Tool in Two.js: https://jsfiddle.net/jonobr1/pvhwc7nu/
But, for your case if the Pie Chart already exists I think you'd have to make a custom function to check for hover etc.. I can make a demo for this, but if you have some sample code it would be easier to build off of and show you a specific example.