-
Notifications
You must be signed in to change notification settings - Fork 59
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
callback function binding in options.manipulation #13
Comments
I'm currently looking at it right now. I will improve the binding in the next version of vue2vis. |
Thanks for your kindly reply. I'm looking forward to your dev version. |
Hi @uwmyuan, Looking at the visjs doc a bit deeper, I don't think However, the event Last but not least, from your issue description, you could achieve your requirements by calling |
Hi @alexcode , |
I don't recommand to use JQuery at all with vue but you can use |
Very helpful, thanks. I got it. |
Hi @alexcode, I have one more question about the binding event to function. In the vanilla vis.js, the example shows binding the I tried Thanks. |
Could you send me a jsfiddle of what you intend to do, it will be helpful? |
Thanks. Yes, of course. Please see this example for more information. |
@alexcode Hi, I do not know how to get the selected-node in the click event. Please tell me how to solve. I'm thinking about solving in the following way, is This code correct? methods: {
setClickEvent: function ( ){
this.$refs.network.$on('click' , (e) => {
console.log('Selected Node ID : ' + e.nodes.toString())
console.log(this.getSelectedNodeObject( e.nodes.toString() ))
})
},
getSelectedNodeObject: function ( inNodeID ){
for(let i=0; i<Object.keys(this.network.nodes).length; i++){
if(this.network.nodes[i].id == inNodeID){
return this.network.nodes[i]
}
}
return null
},
}, |
Hi @alexcode, I'm struggling with a similar problem, where I'm trying to get the current positions of nodes. I understand that I need Like your example, I have a
Could you point me in the right direction please? Thanks |
@CJLees01 you should call Here is a fiddle working. I'm printing the JSON of the nodes at the bottom of the page. The |
Great - thank you very much. Just in case it helps anyone else reading this thread, I was expecting |
Hi,
The network example shows the usage of the network module. However, if dragging one node (say node data n) to another location, the attributes n.x and n.y won't change accordingly. One may simply replicate this by adding one duplicate instance of network component and binding the same data (nodes and edges) with networks. If one node (node 1) in one network is moved, the corresponding node (node 1') won't move in the other network. It looks the data are not binded in the other direction.
I try to have a workaround by binding a method to handle the
dragging
event. However, I cannot since I'm not using webpack and in-DOM template would induce an error.Could you share any clue? Thanks.
The text was updated successfully, but these errors were encountered: