Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/ChrisShen93/VGEditor

A visual graph editor based on G6 and Vue, inspired by GGEditor.
https://github.com/ChrisShen93/VGEditor

Last synced: 2 months ago
JSON representation

A visual graph editor based on G6 and Vue, inspired by GGEditor.

Lists

README

        

# VGEditor

A visual graph editor based on G6 and Vue, inspired by [GGEditor](https://github.com/alibaba/GGEditor)

### Online demo

1. [flow](https://chrisshen93.github.io/VGEditor/demo/build/#/flow)
2. [koni](https://chrisshen93.github.io/VGEditor/demo/build/#/koni)
3. [mind](https://chrisshen93.github.io/VGEditor/demo/build/#/mind)

## Installation

### yarn and npm

```shell
yarn add [email protected]
# or
npm install [email protected] -S
```

> If you're using vue-cli v4, you must use [email protected] or later

### Run demo

```shell
git clone https://github.com/ChrisShen93/VGEditor.git
cd VGEditor
yarn
yarn dev
```

## Usage

### Flow

```html



import VGEditor, { Flow } from 'vg-editor'
const data = {
nodes: [{
type: 'node',
size: '70*70',
shape: 'flow-circle',
color: '#FA8C16',
label: 'θ΅·ζ­’θŠ‚η‚Ή',
x: 55,
y: 55,
id: 'ea1184e8',
index: 0,
}, {
type: 'node',
size: '70*70',
shape: 'flow-circle',
color: '#FA8C16',
label: 'η»“ζŸθŠ‚η‚Ή',
x: 55,
y: 255,
id: '481fbb1a',
index: 2,
}],
edges: [{
source: 'ea1184e8',
sourceAnchor: 2,
target: '481fbb1a',
targetAnchor: 0,
id: '7989ac70',
index: 1,
}],
};
export default {
data () {
return { data }
},
components: { VGEditor, Flow }
}

```

### Mind

```html



import VGEditor, { Mind } from 'vg-editor'
const data = {
roots: [{
label: 'δΈ­εΏƒδΈ»ι’˜',
children: [{
label: 'εˆ†ζ”―δΈ»ι’˜ 1',
}, {
label: 'εˆ†ζ”―δΈ»ι’˜ 2',
}, {
label: 'εˆ†ζ”―δΈ»ι’˜ 3',
}],
}],
};
export default {
data () {
return { data }
},
components: { VGEditor, Mind }
}

```

### Documentation

[API](https://chrisshen93.github.io/VGEditor/docs/)