- Trying to add new NodeSet to topology using the addNodeSet method. However getting "Cannot read property 'parentVertexSetID' of undefined" error. See this fiddle: NeXt nodeset - JSFiddle
addNodeSet is a low level API, you missed second parameter as config, it should look like this:
topo.addNodeSet(topologyData.nodeSet[0],{})
will update NeXt make the second parameter as optional.
- Is there a method for removing NodeSet from topology. Tried the removeNode method but couldn't make it work. What about adding node to existing NodeSet.
Add node to nodeSet could be a little bit tricky. We don't have that feature before.
- Any change of implementing the add node to nodeSet method. Would like to be able to add new node to nodeSet without reloading the dataset.
In this demo(removeNode&insertNodetoNodeSet - JSFiddle) implement a function called 'addNodeToNodeSet', you can use this function. It's not add that to framework yet.
function addNodeToNodeSet(topo, pid, nodeData) { if (!topo || !pid || !nodeData) { return; } var graph = topo.graph(); var nodeSet = topo.getNode(pid); if (nodeSet) { var vertexSet = nodeSet.model(); var vertex = graph._addVertex(nodeData); vertexSet.addVertex(vertex); graph.updateVertexSet(vertex); if (!nodeSet.collapsed()) { var animation = nodeSet.animation(); nodeSet.animation(false); nodeSet.collapsed(true); nodeSet.collapsed(false); nodeSet.animation(animation); } } }
Comments
0 comments
Please sign in to leave a comment.