d3-render
d3-render copied to clipboard
Accessing 'data' in on* events (for tooltips)
In d3, when I process an event like mouseOver, the data passed into the event is the data that is bound to the DOM element. When using d3-render, when I look at the data that is passed to the event, it is actually the data for d3-render element and not the actual data used to generate the render data.
For example, in d3, on a mouseover event, I can get the value to display in a tooltip to be the actual data (using d):
so I can show d.value
But when I look at the d passed to the event in d3-render, it is
Any suggestions for how to get to the actual d.value?
This may not be possible, because the data is abstracted away from the rendering, but that poses a bit of a challenge for how to render tooltips...
Hi,
Could you try something like this? (from a bar chart example)
Basically pass
d
manually into the onClick function