Within the context of most callback functions in d3, `this` refers to
the current node. For example, if you pass a function to `attr`,
`style`, or `each`, when that function is called, `this` will refer to
the current DOM element.
d3.select(this) creates a 1-element selection containing the current
node. This allows you to use D3's operators to modify the element, or
do whatever else, rather than using the raw W3C DOM API.
Mike
to access showDetails (a function of class info), I must have access to the class "this". But to access the current element, I must have access to the current node "this". I could of course access the class context using windows.class_instance but that is poor programming in my view. The bind(this) is necessary to access the class "this" but then I lose the current node inside showDetails. I tried using two mouseover events on the same node, but the second one overwrites the first.
What can be done?
Thanks!
Gordon
--
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/d/optout.