Socket
Socket
Sign inDemoInstall

@braks/vue-flow

Package Overview
Dependencies
36
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @braks/vue-flow

[![Vue flow](vue-flow.gif)](https://vueflow.dev/) ![top-language](https://img.shields.io/github/languages/top/bcakmakoglu/vue-flow) ![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/bcakmakoglu/vue-flow) ![GitHub code size in bytes](ht


Version published
Weekly downloads
847
decreased by-5.26%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

[0.4.41] - 2022-10-07

247f248...8fc28f9

Bug Fixes

  • Use resize observer to set viewpane dimensions (a8d0830)
  • Calculate proper dimensions for view el (55e4403)
  • Edge-renderer to update on edge updates (8c0982a)
  • Use filter to remove orphaned edges (1ad6073)
  • Interrupt edge hidden check if orphaned edge found (d7282cc)
  • Move resize observer to mounted hooks (de6220b)
  • Undo handle validation wrapping itself (f508e6e)
  • Zoom action tests to check for containing str (72dd98b)
  • Check if element exists in isNode/Edge (fc263a6)

Documentation

Features

  • Add from position to position change event (a29d7c8)
  • Add useNode composable (70871df)
  • Add nodeRef injection (7d992b5)
  • Add generics to findNode action (9b943df)
  • Add useEdge composable (44a65b3)
  • Add connection actions to store (b0c168f)
  • Add vue flow mount command (dc30ef4)
  • Add default command timeout of 1000 (e81bea1)
  • Add tests for add, find & remove actions (9f59be7)
  • Add selected elements action tests (cc4a007)
  • Add remove selected elements action tests (e3327eb)
  • Add set min/max zoom action tests (3770083)
  • Add update edge test (fa5b5da)
  • Add data-id prop to edges (3461602)
  • Add connection line action tests (9fde0bc)
  • Add dragging nodes test (63dae2c)
  • Add connecting nodes test (e429fdf)
  • Add update edge tests (1526ecd)
  • Add data-type to edge anchors (9cea132)

Miscellaneous Tasks

Refactor

  • Use dom matrix to calculate handle bounds zoom (ee56ddb)
  • Only update position on mount (70dd73f)
  • Cleanup handle calculation logic (31b0bcb)
  • Use single resize observer for nodes (a780813)
  • Remove unnecessary scope (bf7594f)
  • Remove flush timing from drag (091c3df)
  • Make handlebounds shallow reactive (726471c)
  • Calculate bounds on mount (1d1447e)
  • Use connection start handle and remove other props from store (a443d38)
  • Emit connection events start and end with actions (7a657f1)
  • Upgrade to cypress 10 (8928eb8)
  • Move test files (6e0c0c7)

Readme

Source

Vue Flow 🌊

Vue flow top-language vulnerabilities GitHub code size in bytes GitHub last commit

Vue Flow: A highly customizable Vue 3 Flowchart component.

With Vue Flow, you can build your own, customized node-based applications like static diagrams or even more complex and interactive editors!

You can find a detailed explanation of how to get started in the documentation or check the examples.

Table of contents

⭐️ Features

  • 👶 Easy setup: Get started hassle-free - Built-in zoom- & pan features, element dragging, selection and much more

  • 🎨 Customizable: Use your custom nodes, edges and connection lines and expand on Vue Flows' functionality

  • 🚀 Fast: Tracks changes reactively and only re-renders the appropriate elements

  • 🧲 Utils & Composition: Comes with graph helper and state composable functions for advanced uses

  • 📦 Additional Components:

    • 🖼 Background: With two built-in patterns and some configuration options like height, width or color.

    • 🧭 Minimap: Shows current nodes in a small map shape in the bottom right corner

    • 🕹 Controls: Control zoom behavior from a panel on the bottom left

    • 🤖 And (many) more to come...

  • 🦾 Reliable: Fully written in TypeScript

🛠 Setup

$ npm i @braks/vue-flow

# or
$ yarn add @braks/vue-flow

🎮 Quickstart

A flow consists of nodes and edges (or just nodes). Together they are called elements.

Each element needs a unique id.

A node also needs an XY position. An edge needs a source (node id) and a target (node id).

A basic setup looks like this:

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

const elements = ref([
  {
    id: '1',
    label: 'node 1',
    position: { x: 100, y: 100 },
  },
  {
    id: '2',
    label: 'node 2',
    position: { x: 100, y: 200 },
  },
  {
    id: 'e1-2',
    target: '2',
    source: '1',
  },
])
</script>

<template>
  <VueFlow v-model="elements"></VueFlow>
</template>

⚠️ Make sure to import the necessary styles:

/* import the required styles */
@import "@braks/vue-flow/dist/style.css";

/* import the default theme (optional) */
@import "@braks/vue-flow/dist/theme-default.css";

🪴 Vue 2

This library doesn't work with Vue 2.

Vue Flow uses features that are exclusive to Vue 3, therefore there is no support for Vue 2, nor will there be any support in the future, sorry.

🧪 Development

Prerequisites

# skip if you already have pnpm installed
$ npm i -g pnpm

# start examples
$ pnpm dev

# build all packages
$ pnpm build

🐳 Dev Container

To start using development containers, install the Docker extension for VSCode. After installing the extension, open the connection menu either on the bottom left or open it via the commands tab. Select the Open Folder in Container option to mount the project.

The development container will spin up all packages example apps and forward the ports to your machine.

discord logo Discord

Join the Vue Flow Discord server!

Here you can ask questions to the community, propose ideas for new features or share your work that you have built with Vue Flow.

💝 Special Thanks

This project is built with

  • React Flow

    • Vue flow is heavily based on webkids' react flow. I wholeheartedly thank them for their amazing work! Without them Vue Flow would not exist. Please consider donating to them.
  • D3.js

    • D3 makes all the zoom and pan actions in Vue Flow possible.
  • VueUse

    • VueUse is a collection of essential vue composition utilities

⭐ Stargazers

Many thanks to the kind individuals who leave a star. Your support is much appreciated!

Stargazers for @braks/vue-flow

FAQs

Last updated on 07 Oct 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