Skip to content
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

How create nested nodes + selectNode event is executed after the node loses the focus #73

Open
merlincita opened this issue Apr 19, 2017 · 1 comment

Comments

@merlincita
Copy link

Hello,
I am new using this library. I have a couple of questions:

  • I want to change the background color of a node when it is clicked. What is happening is when clicking the node, it changes its layout to the default config, and after the node loses the focus is when its color changed. Please see the code below. I also try the click event and got the same behavior.
    vm.networkEvents = { selectNode: function (selected) { var nodeID = selected['nodes']['0']; if (nodeID) { var clickedNode = nodes.get(nodeID); clickedNode.color = { background: 'yellow' } nodes.update(clickedNode); } } }

The other question is I am trying to draw some nodes inside a container node, something similar to the attached image. I create a node with shape: 'box', shapeProperties: { borderDashes: true } to draw the container, and the other nodes with shape: 'database'. How can I embedded/nested these database nodes in the container node?
vis

Thank you!

@cdjackson
Copy link
Contributor

cdjackson commented Apr 19, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants