Redraw with new positions #358
-
I have been using ngraph.forceLayout to calculate the layout of the Now, I'd like to be able to show / hide Is there a way to force a redraw of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In a custom Node, you can access the underlying store object via the following code in a script tag. const graph = getContext('graph');
let internalNode;
onMount(() => {
internalNode = graph.nodes.get(`N-${yourNodeID}`);
}); You could then update the position manually by calling This isn't really for external use and I don't recommend building something around this functionality as it is subject to change. The next version, which will release in a few weeks, will have exported functions and stores on the major components that you will be able to access via component instance binding. This is how we plan on enabling this kind of functionality going forward and we will have updated documentation for exactly this use case. You can also access this internal Node object via |
Beta Was this translation helpful? Give feedback.
In a custom Node, you can access the underlying store object via the following code in a script tag.
You could then update the position manually by calling
internalNode.position.set({x, y})
.This isn't really for external use and I don't recommend building something around this functionality as it is subject to change. The next version, which will release in a few weeks, will have exported functions and stores on the major components that you will be able to access via component instance binding. This is how we plan on enabling this kind of functionality going f…