Hi Fawzan, As I understood main problem here is to identify if a specific element is inside another element. As I have checked I couldn't find a d3.js inbuilt function for this. But you should be able to achieve it by acquiring top,left,right,top,bottom values of the dragging element and the element we are checking relative to the SVG. Then calling a function inside the drag method to validate. So if a specific object is there only , it will transform with the parent. I think it would be easier to have a the images inside rec objects so that you can do the math easier. But I'm not sure about it. In d3 if you need to check if something is inside another then I think you have to go with position values relative to the drawn SVG. you can check[1] which detects a rect if its completely inside a circle and found [2] which may be useful for you.
[1] http://stackoverflow.com/questions/21193580/detect-if-rect-is-completely-inside-circle-d3js [2] http://stackoverflow.com/questions/12066870/how-to-check-if-an-element-is-overlapping-other-elements Thanks, Damith. On Thu, Aug 20, 2015 at 7:55 PM, Mohamed Fawzan <[email protected]> wrote: > Hi, Can someone help on this SO question[1] > <http://stackoverflow.com/questions/32085240/d3js-transforming-nested-group-images> > ? > > > [1]- > http://stackoverflow.com/questions/32085240/d3js-transforming-nested-group-images > > -Regards > > -- > Mohammed Fawzan > Faculty of Engineering | UoP > +94771121195 > > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Software Engineer WSO2 Inc.; http://wso2.com <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg> lean.enterprise.middleware mobile: *+94728671315*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
