Socket
Socket
Sign inDemoInstall

@braks/vue-flow-resize-rotate-node

Package Overview
Dependencies
58
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @braks/vue-flow-resize-rotate-node

### Custom Node that can be resized and rotated


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Vue Flow Resizable Rotatable Node

Custom Node that can be resized and rotated

🛠 Setup

# install
$ yarn add @braks/vue-flow-resize-rotate-node

# or
$ npm i --save @braks/vue-flow-resize-rotate-node

🎮 Quickstart


<script setup>
import { VueFlow } from '@braks/vue-flow'
import { ResizeRotateNode } from '@braks/vue-flow-resize-rotate-node'
import initialElements from './initial-elements'

const elements = ref(initialElements)
</script>
<template>
  <div style="height: 300px">
    <VueFlow v-model="elements">
      <template #node-resize-rotate="props">
        <ResizeRotateNode v-bind="props" />
      </template>
    </VueFlow>
  </div>
</template>
// initial-elements.js
export default [
  {
    id: '1',
    label: 'Node 1',
    type: 'resize-rotate',
    targetPosition: 'left',
    sourcePosition: 'right',
    position: {
      x: 0,
      y: 0,
    },
    data: {
      // additional styles for the node
      // cannot use the regular style tag as those apply to the node wrapper
      style: {
        background: 'rgb(255, 0, 114) none repeat scroll 0% 0%',
        padding: '20px',
        borderRadius: '20px',
      },
    },
  },
  {
    id: '2',
    label: 'Node 2',
    type: 'resize-rotate',
    targetPosition: 'left',
    position: {
      x: 330,
      y: 50,
    },
    data: {
      style: {
        background: 'rgb(50, 188, 188) none repeat scroll 0% 0%',
        padding: '20px',
        borderRadius: '20px',
      },
    },
  },
  {
    id: 'e1-2',
    source: '1',
    target: '2',
    type: 'smoothstep',
  },
]

FAQs

Last updated on 30 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc