visjs/angular-visjs

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

merlincita opened this issue · 1 comments

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!