Skip to content

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

@merlincita

Description

@merlincita

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions