Braks 8d33014291 refactor(nodes,edges): change defaults to functional components
# What's changed?

* Change default node/edge components to functional components
2022-04-24 13:34:22 +02:00
2022-04-14 17:19:30 +02:00
2022-04-21 10:47:53 +02:00
2021-07-01 19:54:02 +02:00
2022-04-11 11:30:10 +02:00
2021-10-20 22:39:54 +02:00
2022-04-21 10:53:39 +02:00
2022-04-11 16:43:07 +02:00
2022-04-11 11:30:10 +02:00
2022-04-11 18:09:41 +02:00
2022-04-11 11:30:10 +02:00

Vue Flow 🌊

vue flow top-language dependencies Status devDependencies Status 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 on how to get started in the documentation or check the examples.

Features

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

  • 🎨 Customizable: Use your own custom nodes, edges, connection lines and expand on the 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

  • 🦾 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 we call them elements.

Each element needs a unique id.

A node also needs a xy-position. An edge needs a source (node id) and a target (node id).

A simple setup could look like this:

<!-- Flowchart.vue -->
<template>
  <VueFlow :elements="elements"></VueFlow>
</template>
<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>

Make sure to import the necessary styles:

/* main.css */

/* 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 Vue2.

🧪 Development

# start (dev)
$ yarn dev

# build dist
$ yarn build

Stargazers

Thanks for your star!

Stargazers repo roster for @braks/vue-flow

💝 Acknowledgement

This project is based on webkid's react flow. I wholeheartedly thank them for their amazing work! Without them this project would've been impossible for me. Please consider donating to them if you like Vue Flow.

Description
No description provided
Readme 17 MiB
Languages
TypeScript 80.3%
Vue 17%
CSS 1.8%
JavaScript 0.6%
Dockerfile 0.2%
Other 0.1%