Giter Club home page Giter Club logo

jvanderkaaij / vue-flow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bcakmakoglu/vue-flow

0.0 0.0 0.0 16.13 MB

A highly customizable Flowchart component for Vue 3. Features seamless zoom & pan ๐Ÿ”Ž, additional components like a Minimap ๐Ÿ—บ and utilities to interact with state and graph.

Home Page: https://vueflow.dev/

License: MIT License

JavaScript 0.73% TypeScript 79.59% CSS 1.89% HTML 0.12% Vue 17.46% Dockerfile 0.21%

vue-flow's Introduction

Vue Flow ๐ŸŒŠ

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

Vue Flow: A highly customizable Vue 3 Flowchart component.

You can find a detailed explanation on how to get started here or jump right into 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 @vue-flow/core

# or
$ pnpm i @vue-flow/core

# or
$ yarn add @vue-flow/core

๐ŸŽฎ Quickstart

In Vue Flow, an application structure consists of nodes and edges, all of which are categorised as elements.

Each element requires a unique id.

Nodes additionally need an XY-position, while edges require a source and a target, both represented by node ids.

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

const nodes = ref([
  { id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
  { id: '2', label: 'Node 2', position: { x: 100, y: 100 } },
  { id: '3', label: 'Node 3', position: { x: 400, y: 100 } },
  { id: '4', label: 'Node 4', position: { x: 400, y: 200 } },
])
  
const edges = ref([
  { id: 'e1-2', source: '1', target: '2', animated: true },
  { id: 'e1-3', source: '1', target: '3' },
])
</script>

<template>
  <VueFlow v-model:nodes="nodes" v-model:edges="edges"></VueFlow>
</template>

โš ๏ธ Make sure to import the necessary styles:

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

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

Do not scope these styles with scoped in your component.

๐Ÿชด 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

# install pnpm if you haven't already
$ 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' ReactFlow. I wholeheartedly thank them for their amazing work! Without them VueFlow would not exist. Please consider donating or subscribing to ReactFlow Pro.
  • 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 @vue-flow/core

vue-flow's People

Contributors

bcakmakoglu avatar github-actions[bot] avatar thomasmountford avatar snoozbuster avatar lehoczky avatar jayrchamp avatar poerlang avatar nihiyama avatar skraye avatar thanakorn-ki avatar srborines avatar robin-hoodie avatar pdiee avatar owenconti avatar tchiotludo avatar katlyn avatar oas avatar grinsli avatar congyuwang avatar oe1rfc avatar azamat7g avatar larchliu avatar logaretm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.