mhemesath / r2d3

Raphael Rendered, Data Driven Documents
MIT License
546 stars 133 forks source link

d3.text() setting undefined textContent #5

Closed mbecica closed 12 years ago

mbecica commented 12 years ago

I've been trying to get to the root of the issue on this one but haven't had any luck yet, no matter if the text is a function or string.

d3_selectionPrototype.text is returning the correct value, but within it this.textContent is always returning undefined - while the value of 'v' is correct. I keep going around in circles on this one. hints?

mhemesath commented 12 years ago

Under the covers this is actually a Raphael text element: http://raphaeljs.com/reference.html#Paper.text. The cleanest way to solve this is to probably write a custom r2d3 text module to replace d3's. This is a similar approach to what I had to do with append.

In general I try to avoid replacing d3 modules with my own custom versions.. but I'm not sure if we can get around it.

mhemesath commented 12 years ago

I think I fixed the issue, please checkout this pull request and let me know what you think and I can merge it in.

https://github.com/mhemesath/r2d3/pull/6/files