this._drag = d3.behavior.drag()
Without seeing the rest of your code, I can't tell what source element the drag is being called on. Therefore, I can’t be sure of the data that is being passed to the drag origin function. But the error leads me to believe that you are calling the drag function on a source object with no data. From the API:
The origin accessor must return an object with x and y properties representing the starting coordinates of the element being dragged.
Frequently the origin accessor is specified as the identity function: function(d) { return d; }. This is suitable when the datum bound to the dragged element is already an object with x and y attributes representing its current position.
The key being the part of, "This is suitable when the datum bound to the dragged element is already an object with x and y attributes representing its current position." If you post where you are calling the drag function, we could steer you in the right direction.
Cheers,
Andy
--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/rDwMonSe7L4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+un...@googlegroups.com.