-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't pass d3 selection to chart constructor #1006
Comments
Thanks for reporting, @rjmorris. At some point I had the impression that Obviously the workaround is to pass |
So, yeah, superficially I'm adding something to detect d3 selections based on what methods they support, and treat them appropriately. |
Great! Thanks for looking into this. |
Closed (a few weeks ago) by 4d68611 |
For closure and rationale: d3/d3-selection#76 Fair enough, and that shows the right way to test if something is a selection ( |
The documentation says the
parent
argument for dc chart constructors can be:However, passing in a d3 selection doesn't work for me. Here's an illustration: http://jsfiddle.net/rjmorris/uv28k803. (This example uses the stable version of dc, but the same thing happens with the latest 2.0.0 beta.) Examining the source, it appears that in baseChart.anchor(), dc is select()ing my selection under the assumption that it's a selector string or a dom element. This causes an error later (TypeError: node.getAttribute is not a function) when d3 tries to add a class to the parent div.
The text was updated successfully, but these errors were encountered: