Skip to content

How can a user resize a node (if is tagged as 'resizable')? #45

Answered by bcakmakoglu
ulissepress asked this question in Q&A
Discussion options

You must be logged in to vote

To implement a "resizable" node you would have to create a custom node that can support the resizing on a corner click.
Or you could check the onClick event for nodes and calculate where the click happened etc. but that seems more complicated than adding a custom node 😅

But generally you can change a node's size by applying styles to it, so an example implementation could look like this.

<script setup>
import { VueFlow } from '@braks/vue-flow'
import CustomNode from './CustomNode.vue'

const elements = ref([
  { id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
  {
    id: '2',
	type: 'custom',
    label: 'Node 2',
    position: { x: 100, y: 100 },
    style: { backgr…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@ghiscoding
Comment options

@bcakmakoglu
Comment options

@ghiscoding
Comment options

@ghiscoding
Comment options

@bcakmakoglu
Comment options

Answer selected by bcakmakoglu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants
Converted from issue

This discussion was converted from issue #44 on March 26, 2022 17:59.