dash14 / v-network-graph

An interactive network graph visualization component for Vue 3
https://dash14.github.io/v-network-graph/
MIT License
495 stars 44 forks source link

node:pointerup not always firing #50

Closed nbst84 closed 2 years ago

nbst84 commented 2 years ago

I noticed that the node:pointerup event will only fire if you pressed the mouse button on that same node. Meaning, if you have nodes A and B, and press down mouse button on node A, and then move to node B and release mouse button over node B, you will get node:pointerdown on node A but no node:pointerup at all.

The node:pointerover will also not fire when hovering a node (B) while holding the mouse button if it was pressed over another node (A).

Is this intended? Would it be possible to have these events fired in all cases?

I am trying to implement a way to create an edge between 2 nodes using the mouse (dragging from a node to an other) but this is preventing me from finding out what the destination node is (when releasing the mouse button).

Thanks

dash14 commented 2 years ago

Hi @nbst84,

Is this intended? Would it be possible to have these events fired in all cases?

Yes, this behavior is intended. But I understood that this behavior is undesirable for your purpose. Since changing this behavior now could break applications that expect this behavior, I have considered a feasible way to achieve your purpose. Please see the example below. https://dash14.github.io/v-network-graph/examples/event.html#set-raw-event-handlers-to-the-node-elements (Please use v0.5.10 or later, due to some fixes.)

I hope this helps you. Best Regards,

nbst84 commented 2 years ago

Hi @dash14,

That is perfect - thank you so much for the quick update!