-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: expose node information to node related callbacks #385
Conversation
5ee29d8
to
0254239
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicelly done 馃憦 I didn't tought of adding the node
parameters to all the callbacks in the API, but looking at it done, it made me thought that it's actually better to have all the callback APIs aligned. Thanks! I'll leave this one for @terahn to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry got to carried away by the changes! I actually want to request changes before approving 馃槃 Please see my notes on some of the changes that we need to drop before merging. Cheers!
0254239
to
f00b457
Compare
Thanks for the feedback! 馃槂
Yeah, that's what I thought too! It's better if we provide the same information in all callbacks, rather than having this added in just one. It's very possible that users request this data in different scenarios after all: even if the original issue asked for
I've just dropped the commits that updated the |
This PR exposes the node data to the callback methods for all the node-related events. This will give developers access to all of the node's information (including its coordinates). Therefore, this should solve #306.
The event handlers affected by this change are:
onClickNode
onDoubleClickNode
onRightClickNode
onMouseOverNode
onMouseOutNode
To obtain the node's information, users can make use of a new parameter on the callback functions, like in the example below:
The
nodeId
is still returned first to keep compatibility with previous versions of the library. In the future we may want to delete this property and just return the node itself (as the id can be read from thenode
object directly).Task list:
馃捇 Development
node
param from theGraph
component's node event handlers to the user defined ones located in theprops
object.馃摑 Documentation
README
file.DOCUMENTATION
file.Graph
component docs.馃惓 Project settings
2.6.0
.