Skip to content
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

Raise an error when passing a selection.data() key that does not evaluate to a string. #293

Closed
mjmdavis opened this issue Oct 21, 2021 · 1 comment

Comments

@mjmdavis
Copy link

As a naive user, I've fallen into the trap of passing an object a few times and d3 doesn't complain and 'kind of' works but the behaviour is not what I intended.

Adding a check might save some people similar confusion.

@mbostock
Copy link
Member

Values are coerced to a string (e.g., dates), so it would be far too strict to throw an error for all objects. We could specifically test for “[object Object]”, but I think that would be overly precise and also prone to false positives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants