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
In the case of using d3-drag to drag nodes with Canvas, you might want to use drag.filter to check whether a node was clicked on before allowing the drag behavior. However, there’s no way to access whatever is computed during filter on dragstart (aside from having the caller use a global). For example, you might hit-test your circles:
Unfortunately, you’d have to perform this same hit-test again to determine the current node on dragstart.
Maybe drag.filter should be replaced by drag.target, which sets the target property on the event to whatever you like? But the default filter is still useful:
In the case of using d3-drag to drag nodes with Canvas, you might want to use drag.filter to check whether a node was clicked on before allowing the drag behavior. However, there’s no way to access whatever is computed during filter on dragstart (aside from having the caller use a global). For example, you might hit-test your circles:
Unfortunately, you’d have to perform this same hit-test again to determine the current node on dragstart.
Maybe drag.filter should be replaced by drag.target, which sets the target property on the event to whatever you like? But the default filter is still useful:
Would it be weird to do this?
Maybe context is a better name, since there’s already a concept of the event’s target, which is the DOM element.
The text was updated successfully, but these errors were encountered: