2
2
3
3
[ ![ Vue flow] ( vue-flow.gif )] ( https://vueflow.dev/ )
4
4
![ top-language] ( https://img.shields.io/github/languages/top/bcakmakoglu/vue-flow )
5
- ![ vulnerabilities] ( https://img.shields.io/snyk/vulnerabilities/github/bcakmakoglu/vue-flow )
6
5
![ GitHub code size in bytes] ( https://img.shields.io/github/languages/code-size/bcakmakoglu/vue-flow )
7
6
![ GitHub last commit] ( https://img.shields.io/github/last-commit/bcakmakoglu/vue-flow )
8
7
9
8
__ Vue Flow: A highly customizable Vue 3 Flowchart component.__
10
9
11
- With Vue Flow, you can build your own, customized node-based applications like static diagrams or even more complex and
12
- interactive editors!
10
+ Vue Flow is a bridge to the world of interactive flowcharts and graphs, empowering you to bring
11
+ interactivity to your graphic representations. Whether it's crafting personal diagrams, generating dynamic
12
+ editors, or anything else your imagination conjures up, Vue Flow has you covered.
13
13
14
- You can find a detailed explanation of how to get started in the [ documentation ] ( https://vueflow.dev/guide/ ) or check
14
+ You can find a detailed explanation on how to get started [ here ] ( https://vueflow.dev/guide/ ) or jump right into
15
15
the [ examples] ( https://vueflow.dev/examples/ ) .
16
16
17
17
## Table of contents
@@ -21,11 +21,11 @@ the [examples](https://vueflow.dev/examples/).
21
21
* [ 🛠 Setup] ( #-setup )
22
22
23
23
* [ 🎮 Quickstart] ( #-quickstart )
24
-
24
+
25
25
+ [ 🪴 Vue 2] ( #-vue-2 )
26
26
27
27
* [ 🧪 Development] ( #-development )
28
-
28
+
29
29
+ [ 🐳 Dev Container] ( #-dev-container )
30
30
31
31
* [ ![ discord logo] ( https://api.iconify.design/logos:discord-icon.svg ) Discord] ( #-discord )
@@ -61,38 +61,40 @@ the [examples](https://vueflow.dev/examples/).
61
61
``` bash
62
62
$ npm i @vue-flow/core
63
63
64
+ # or
65
+ $ pnpm i @vue-flow/core
66
+
64
67
# or
65
68
$ yarn add @vue-flow/core
66
69
```
67
70
68
71
## 🎮 Quickstart
69
72
70
- A flow consists of __ nodes__ and __ edges__ (or just nodes).
71
- Together they are called __ elements__ .
73
+ In Vue Flow, an application structure consists of __ nodes__ and __ edges__ , all of which are categorised as __ elements__ .
72
74
73
- __ Each element needs a unique id.__
75
+ __ Each element requires a unique id.__
74
76
75
- A node also needs an XY position.
76
- An edge needs a source (node id) and a target (node id).
77
-
78
- A basic setup looks like this:
77
+ Nodes additionally need an __ XY-position__ , while edges require a __ source__ and a __ target__ , both represented by node ids.
79
78
80
79
``` vue
81
80
<!-- Flowchart.vue -->
82
81
<script setup>
83
82
import { VueFlow } from '@vue-flow/core'
84
83
85
- const elements = ref([
84
+ const nodes = ref([
86
85
{
87
86
id: '1',
88
87
label: 'node 1',
89
- position: { x: 100, y: 100 },
88
+ position: {x: 100, y: 100},
90
89
},
91
90
{
92
91
id: '2',
93
92
label: 'node 2',
94
- position: { x: 100, y: 200 },
93
+ position: {x: 100, y: 200},
95
94
},
95
+ ])
96
+
97
+ const edges = ref([
96
98
{
97
99
id: 'e1-2',
98
100
target: '2',
@@ -102,11 +104,10 @@ const elements = ref([
102
104
</script>
103
105
104
106
<template>
105
- <VueFlow v-model="elements "></VueFlow>
107
+ <VueFlow :nodes="nodes" :edges="edges "></VueFlow>
106
108
</template>
107
109
```
108
110
109
-
110
111
⚠️ __ Make sure to import the necessary styles:__
111
112
112
113
``` css
@@ -117,6 +118,8 @@ const elements = ref([
117
118
@import " @vue-flow/core/dist/theme-default.css" ;
118
119
```
119
120
121
+ Do __ not__ scope these styles with ` scoped ` in your component.
122
+
120
123
### 🪴 Vue 2
121
124
122
125
** _ This library doesn't work with Vue 2._ **
@@ -128,12 +131,11 @@ there is no support for Vue 2, nor will there be any support in the future, sorr
128
131
129
132
### Prerequisites
130
133
131
- - [ Node.js v14+] ( https://nodejs.org/ )
132
- - [ PnPm] ( https://pnpm.io/ )
133
-
134
+ - [ Node.js v18+] ( https://nodejs.org/ )
135
+ - [ pnpm] ( https://pnpm.io/ )
134
136
135
137
``` bash
136
- # skip if you already have pnpm installed
138
+ # install pnpm if you haven't already
137
139
$ npm i -g pnpm
138
140
139
141
# start examples
@@ -166,9 +168,9 @@ or share your work that you have built with Vue Flow.
166
168
This project is built with
167
169
168
170
- [ React Flow] ( https://reactflow.dev/ )
169
- - Vue flow is heavily based on [ webkids'] ( https://webkid.io/ ) [ react flow ] ( https://reactflow.dev/ ) . I wholeheartedly thank
170
- them for their amazing work! Without them Vue Flow would not exist.
171
- Please consider [ donating] ( https://github.com/sponsors/wbkd ) to them .
171
+ - Vue flow is heavily based on [ webkids'] ( https://webkid.io/ ) [ ReactFlow ] ( https://reactflow.dev/ ) . I wholeheartedly
172
+ thank them for their amazing work! Without them VueFlow would not exist.
173
+ Please consider [ donating] ( https://github.com/sponsors/wbkd ) or subscribing to [ ReactFlow Pro ] ( https://reactflow.dev/pro ) .
172
174
173
175
- [ D3.js] ( https://d3js.org/ )
174
176
- D3 makes all the zoom and pan actions in Vue Flow possible.
0 commit comments