You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is intentional. When you’re trying to retrieve the current value of an attribution on the selection, the expectation is that the selection has exactly one element. If you have zero or more than one element selected, the behavior is undefined. If you want to check whether the selection is empty first, you can call selection.empty.
This is intentional. When you’re trying to retrieve the current value of an attribution on the selection, the expectation is that the selection has exactly one element. If you have zero or more than one element selected, the behavior is undefined. If you want to check whether the selection is empty first, you can call selection.empty.
Problem
When a node exists, say it has
id="foo"
in the DOM, then we can safely dohowever, when the node does NOT exist, then
will cause the following error
The fix to this issue seems relatively straight forward. The culprit is in
d3-selection/src/selection/attr.js
.There is simply a missing
null
check on the lines trying to call eithergetAttributeNS
orgetAttribute
onnode
.Proposed solution
Could also consider just using
?.
operator, however this may not be supported by all javascript runtimes?The text was updated successfully, but these errors were encountered: