Skip to content

Commit a5e574d

Browse files
committed
feat: upgrade to G6 3.x
1 parent 43db7bc commit a5e574d

File tree

197 files changed

+7340
-4099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+7340
-4099
lines changed

.babelrc

-41
This file was deleted.

.eslintignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
es
2-
cjs
31
dist
4-
scripts
2+
lib
3+
es

.eslintrc.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
},
5+
parser: '@typescript-eslint/parser',
6+
extends: [
7+
'plugin:@typescript-eslint/recommended',
8+
'plugin:react/recommended',
9+
'plugin:prettier/recommended',
10+
'prettier/@typescript-eslint',
11+
],
12+
plugins: ['@typescript-eslint', 'react', 'prettier'],
13+
rules: {
14+
'@typescript-eslint/explicit-function-return-type': 0,
15+
'@typescript-eslint/no-empty-function': 0,
16+
'@typescript-eslint/no-empty-interface': 0,
17+
'@typescript-eslint/no-explicit-any': 0,
18+
'react/prop-types': 0,
19+
},
20+
};

.eslintrc.json

-26
This file was deleted.

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
es
2-
cjs
31
dist
2+
lib
3+
es
4+
45
node_modules
6+
.eslintcache

.prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
printWidth: 120,
3+
singleQuote: true,
4+
trailingComma: 'all',
5+
};

.travis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
3+
node_js:
4+
- 11
5+
6+
script:
7+
- npm run lint

.vscode/settings.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"javascript.validate.enable": false,
3+
"eslint.autoFixOnSave": true,
4+
"eslint.validate": [
5+
{ "language": "javascript", "autoFix": true },
6+
{ "language": "javascriptreact", "autoFix": true },
7+
{ "language": "typescript", "autoFix": true },
8+
{ "language": "typescriptreact", "autoFix": true }
9+
]
10+
}

README.md

+59-52
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ A visual graph editor based on [G6](https://github.com/antvis/g6) and [React](ht
1010

1111
## Demo
1212

13-
[Flow](http://ggeditor.com/demo/#/flow)
13+
[Flow](http://ggeditor.com/examples/flow)
1414

15-
[![Flow](https://img.alicdn.com/tfs/TB1cl0LyAzoK1RjSZFlXXai4VXa-800-407.gif)](http://ggeditor.com/demo/#/flow)
15+
[![Flow](https://img.alicdn.com/tfs/TB1cl0LyAzoK1RjSZFlXXai4VXa-800-407.gif)](http://ggeditor.com/examples/flow)
1616

17-
[Mind](http://ggeditor.com/demo/#/mind)
17+
[Mind](http://ggeditor.com/examples/mind)
1818

19-
[![Mind](https://img.alicdn.com/tfs/TB1Qed2yxjaK1RjSZFAXXbdLFXa-800-467.gif)](http://ggeditor.com/demo/#/mind)
20-
21-
[Koni](http://ggeditor.com/demo/#/koni)
22-
23-
[<img src="https://img.alicdn.com/tfs/TB1vWxUyAvoK1RjSZFwXXciCFXa-1920-1003.png" alt="Koni" width="800">](http://ggeditor.com/demo/#/koni)
19+
[![Mind](https://img.alicdn.com/tfs/TB1Qed2yxjaK1RjSZFAXXbdLFXa-800-467.gif)](http://ggeditor.com/examples/mind)
2420

2521
## Installation
2622

@@ -33,7 +29,7 @@ npm install --save gg-editor
3329
### umd
3430

3531
```html
36-
<script src="https://unpkg.com/gg-editor@${version}/dist/bundle.js"></script>
32+
<script src="https://unpkg.com/gg-editor@${version}/dist/index.js"></script>
3733
```
3834

3935
### run demo
@@ -53,40 +49,45 @@ $ npm start
5349
import GGEditor, { Flow } from 'gg-editor';
5450

5551
const data = {
56-
nodes: [{
57-
type: 'node',
58-
size: '70*70',
59-
shape: 'flow-circle',
60-
color: '#FA8C16',
61-
label: '起止节点',
62-
x: 55,
63-
y: 55,
64-
id: 'ea1184e8',
65-
index: 0,
66-
}, {
67-
type: 'node',
68-
size: '70*70',
69-
shape: 'flow-circle',
70-
color: '#FA8C16',
71-
label: '结束节点',
72-
x: 55,
73-
y: 255,
74-
id: '481fbb1a',
75-
index: 2,
76-
}],
77-
edges: [{
78-
source: 'ea1184e8',
79-
sourceAnchor: 2,
80-
target: '481fbb1a',
81-
targetAnchor: 0,
82-
id: '7989ac70',
83-
index: 1,
84-
}],
52+
nodes: [
53+
{
54+
type: 'node',
55+
size: '70*70',
56+
shape: 'flow-circle',
57+
color: '#FA8C16',
58+
label: '起止节点',
59+
x: 55,
60+
y: 55,
61+
id: 'ea1184e8',
62+
index: 0,
63+
},
64+
{
65+
type: 'node',
66+
size: '70*70',
67+
shape: 'flow-circle',
68+
color: '#FA8C16',
69+
label: '结束节点',
70+
x: 55,
71+
y: 255,
72+
id: '481fbb1a',
73+
index: 2,
74+
},
75+
],
76+
edges: [
77+
{
78+
source: 'ea1184e8',
79+
sourceAnchor: 2,
80+
target: '481fbb1a',
81+
targetAnchor: 0,
82+
id: '7989ac70',
83+
index: 1,
84+
},
85+
],
8586
};
8687

8788
<GGEditor>
8889
<Flow style={{ width: 500, height: 500 }} data={data} />
89-
</GGEditor>
90+
</GGEditor>;
9091
```
9192

9293
### Mind
@@ -95,27 +96,33 @@ const data = {
9596
import GGEditor, { Mind } from 'gg-editor';
9697

9798
const data = {
98-
roots: [{
99-
label: '中心主题',
100-
children: [{
101-
label: '分支主题 1',
102-
}, {
103-
label: '分支主题 2',
104-
}, {
105-
label: '分支主题 3',
106-
}],
107-
}],
99+
roots: [
100+
{
101+
label: '中心主题',
102+
children: [
103+
{
104+
label: '分支主题 1',
105+
},
106+
{
107+
label: '分支主题 2',
108+
},
109+
{
110+
label: '分支主题 3',
111+
},
112+
],
113+
},
114+
],
108115
};
109116

110117
<GGEditor>
111118
<Mind style={{ width: 500, height: 500 }} data={data} />
112-
</GGEditor>
119+
</GGEditor>;
113120
```
114121

115122
## Documentation
116123

117-
* [API](/docs/README.md#api)
124+
- [API](https://www.yuque.com/ggeditor/api-en)
118125

119126
## DingTalk Group
120127

121-
[<img src="https://img.alicdn.com/tfs/TB1AWhRywHqK1RjSZJnXXbNLpXa-1242-1602.jpg" alt="DingTalk Group" width="200">](https://qr.dingtalk.com/action/joingroup?code=v1,k1,PSFRQbatttuFXEJhDNG1P4CMMUI1+sUDO5MZr3gjhqk=&_dt_no_comment=1&origin=11)
128+
[<img src="https://img.alicdn.com/tfs/TB1AWhRywHqK1RjSZJnXXbNLpXa-1242-1602.jpg" alt="DingTalk Group" width="200">](https://qr.dingtalk.com/action/joingroup?code=v1,k1,PSFRQbatttuFXEJhDNG1P4CMMUI1+sUDO5MZr3gjhqk=&_dt_no_comment=1&origin=11)

0 commit comments

Comments
 (0)