Questions about Node Dimensions #898
-
First off just wanted to say thank you for this amazing library. I'm having a few issues around the dimensions property of a node. I've noticed in some of the examples that I can update things like the label, position, etc after a Node has been created by doing something like: const parentNode = findNode('some-id'); But when it comes to the dimensions property and changing width/height it doesn't seem to work. I've tried using updateNodeInternals after updating dimensions and that doesn't seem to help either. Without going into too much detail I'm basically trying to do create dynamic nested nodes where child elements can be dynamically added to the parent. I am using the NodeResizer module for some of this but ideally I'd like to be able to do some repositioning and resizing programatically as new child nodes are added/deleted. Am I approaching this problem the wrong way or is this just something that can't be done in vue-flow? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can't mutate the To actually mutate the dimensions you can either use |
Beta Was this translation helpful? Give feedback.
You can't mutate the
node.dimensions
object if that's what you're talking about - it's readonly and represents the current dimensions of a node as provided by a resize observer.To actually mutate the dimensions you can either use
node.style.height
ornode.height
.Here's an example.