Convert d3 selection to jquery selection

714 views
Skip to first unread message

mario.g...@ogilvy.com

unread,
Mar 17, 2013, 4:34:05 PM3/17/13
to d3...@googlegroups.com
Sometimes I need to do some jquery thing to an object, and I usually grab the object by saying something along the lines of

var $el = $( myD3Selection[0][0] )

Although it works, it seems like i'm digging into the inner workings of selections too much when I do that.
Is there a 'righter' way?



Simon Russell

unread,
Mar 17, 2013, 6:59:23 PM3/17/13
to d3...@googlegroups.com
If you're just getting on thing:

myD3Selection.node() 

will give you the first node in the selection.


--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages