Raise an error when passing a `selection.data()` key that does not evaluate to a string.
mjmdavis opened this issue · comments
Michael Davis commented
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.
Mike Bostock commented
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.