Commit 97113153 authored by 郭铭瑶's avatar 郭铭瑶 🤘

更新依赖

parent 7efb3722
...@@ -4,9 +4,8 @@ module.exports = { ...@@ -4,9 +4,8 @@ module.exports = {
es2021: true, es2021: true,
}, },
extends: ['plugin:vue/vue3-recommended', 'plugin:prettier/recommended'], extends: ['plugin:vue/vue3-recommended', 'plugin:prettier/recommended'],
parserOptions: { parser: 'vue-eslint-parser',
parser: 'babel-eslint', plugins: ['vue'],
},
rules: { rules: {
'vue/no-multiple-template-root': 'off', 'vue/no-multiple-template-root': 'off',
'vue/max-attributes-per-line': 'off', 'vue/max-attributes-per-line': 'off',
......
...@@ -3,4 +3,4 @@ module.exports = { ...@@ -3,4 +3,4 @@ module.exports = {
useTabs: false, useTabs: false,
singleQuote: true, singleQuote: true,
semi: false, semi: false,
} };
\ No newline at end of file
## relation-graph ## relation-graph
关系图工具 with D3.js 关系图 with D3.js
---
- 安装依赖
```bash
npm install
```
- 启动
```bash
npm run dev
# or
npm start
```
- 打包
```bash
npm run build
```
{ {
"name": "relation-graph", "name": "relation-graph",
"version": "0.0.0", "version": "0.0.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "0.0.0", "version": "0.0.1",
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"d3": "^7.0.0", "d3": "^7.0.0",
"qs": "^6.10.1", "qs": "^6.10.1",
"vue": "^3.0.5" "vue": "^3.1.5"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^1.1.5", "@vitejs/plugin-vue": "^1.3.0",
"@vue/compiler-sfc": "^3.0.5", "@vue/compiler-sfc": "^3.1.5",
"babel-eslint": "^10.1.0", "eslint": "^7.30.0",
"eslint": "^7.17.0", "eslint-config-prettier": "^8.3.0",
"eslint-config-prettier": "^7.1.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^7.14.0",
"eslint-plugin-vue": "^7.4.1",
"naive-ui": "^2.16.5", "naive-ui": "^2.16.5",
"prettier": "^2.2.1", "prettier": "^2.3.2",
"stylus": "^0.54.8", "stylus": "^0.54.8",
"vite": "^2.1.0" "vite": "^2.4.4",
} "vue-eslint-parser": "^7.10.0"
},
"node_modules/@babel/code-frame": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz",
"integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==",
"dev": true,
"dependencies": {
"@babel/highlight": "^7.14.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/generator": {
"version": "7.15.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.0.tgz",
"integrity": "sha512-eKl4XdMrbpYvuB505KTta4AV9g+wWzmVBW69tX0H2NwKVKd2YJbKgyK6M8j/rgLbmHOYJn6rUklV677nOyJrEQ==",
"dev": true,
"dependencies": {
"@babel/types": "^7.15.0",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/generator/node_modules/source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/@babel/helper-function-name": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz",
"integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==",
"dev": true,
"dependencies": {
"@babel/helper-get-function-arity": "^7.14.5",
"@babel/template": "^7.14.5",
"@babel/types": "^7.14.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-get-function-arity": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz",
"integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==",
"dev": true,
"dependencies": {
"@babel/types": "^7.14.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-hoist-variables": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz",
"integrity": "sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==",
"dev": true,
"dependencies": {
"@babel/types": "^7.14.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-split-export-declaration": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz",
"integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==",
"dev": true,
"dependencies": {
"@babel/types": "^7.14.5"
},
"engines": {
"node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-validator-identifier": { "node_modules/@babel/helper-validator-identifier": {
...@@ -144,40 +59,6 @@ ...@@ -144,40 +59,6 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/@babel/template": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz",
"integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.14.5",
"@babel/parser": "^7.14.5",
"@babel/types": "^7.14.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
"version": "7.15.0",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.0.tgz",
"integrity": "sha512-392d8BN0C9eVxVWd8H6x9WfipgVH5IaIoLp23334Sc1vbKKWINnvwRpb4us0xtPaCumlwbTtIYNA0Dv/32sVFw==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.14.5",
"@babel/generator": "^7.15.0",
"@babel/helper-function-name": "^7.14.5",
"@babel/helper-hoist-variables": "^7.14.5",
"@babel/helper-split-export-declaration": "^7.14.5",
"@babel/parser": "^7.15.0",
"@babel/types": "^7.15.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.15.0", "version": "7.15.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz",
...@@ -642,27 +523,6 @@ ...@@ -642,27 +523,6 @@
"follow-redirects": "^1.10.0" "follow-redirects": "^1.10.0"
} }
}, },
"node_modules/babel-eslint": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz",
"integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==",
"deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.0.0",
"@babel/parser": "^7.7.0",
"@babel/traverse": "^7.7.0",
"@babel/types": "^7.7.0",
"eslint-visitor-keys": "^1.0.0",
"resolve": "^1.12.0"
},
"engines": {
"node": ">=6"
},
"peerDependencies": {
"eslint": ">= 4.12.1"
}
},
"node_modules/balanced-match": { "node_modules/balanced-match": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
...@@ -1393,9 +1253,9 @@ ...@@ -1393,9 +1253,9 @@
} }
}, },
"node_modules/eslint-config-prettier": { "node_modules/eslint-config-prettier": {
"version": "7.2.0", "version": "8.3.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz",
"integrity": "sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg==", "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==",
"dev": true, "dev": true,
"bin": { "bin": {
"eslint-config-prettier": "bin/cli.js" "eslint-config-prettier": "bin/cli.js"
...@@ -1861,15 +1721,6 @@ ...@@ -1861,15 +1721,6 @@
"node": ">= 6" "node": ">= 6"
} }
}, },
"node_modules/globals": {
"version": "11.12.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/has": { "node_modules/has": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
...@@ -2164,18 +2015,6 @@ ...@@ -2164,18 +2015,6 @@
"js-yaml": "bin/js-yaml.js" "js-yaml": "bin/js-yaml.js"
} }
}, },
"node_modules/jsesc": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
"integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
"dev": true,
"bin": {
"jsesc": "bin/jsesc"
},
"engines": {
"node": ">=4"
}
},
"node_modules/json-schema-traverse": { "node_modules/json-schema-traverse": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
...@@ -3345,72 +3184,6 @@ ...@@ -3345,72 +3184,6 @@
} }
}, },
"dependencies": { "dependencies": {
"@babel/code-frame": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz",
"integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==",
"dev": true,
"requires": {
"@babel/highlight": "^7.14.5"
}
},
"@babel/generator": {
"version": "7.15.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.0.tgz",
"integrity": "sha512-eKl4XdMrbpYvuB505KTta4AV9g+wWzmVBW69tX0H2NwKVKd2YJbKgyK6M8j/rgLbmHOYJn6rUklV677nOyJrEQ==",
"dev": true,
"requires": {
"@babel/types": "^7.15.0",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
},
"dependencies": {
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
}
}
},
"@babel/helper-function-name": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz",
"integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==",
"dev": true,
"requires": {
"@babel/helper-get-function-arity": "^7.14.5",
"@babel/template": "^7.14.5",
"@babel/types": "^7.14.5"
}
},
"@babel/helper-get-function-arity": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz",
"integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==",
"dev": true,
"requires": {
"@babel/types": "^7.14.5"
}
},
"@babel/helper-hoist-variables": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz",
"integrity": "sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==",
"dev": true,
"requires": {
"@babel/types": "^7.14.5"
}
},
"@babel/helper-split-export-declaration": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz",
"integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==",
"dev": true,
"requires": {
"@babel/types": "^7.14.5"
}
},
"@babel/helper-validator-identifier": { "@babel/helper-validator-identifier": {
"version": "7.14.9", "version": "7.14.9",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz",
...@@ -3432,34 +3205,6 @@ ...@@ -3432,34 +3205,6 @@
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.2.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.2.tgz",
"integrity": "sha512-bMJXql1Ss8lFnvr11TZDH4ArtwlAS5NG9qBmdiFW2UHHm6MVoR+GDc5XE2b9K938cyjc9O6/+vjjcffLDtfuDg==" "integrity": "sha512-bMJXql1Ss8lFnvr11TZDH4ArtwlAS5NG9qBmdiFW2UHHm6MVoR+GDc5XE2b9K938cyjc9O6/+vjjcffLDtfuDg=="
}, },
"@babel/template": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz",
"integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.14.5",
"@babel/parser": "^7.14.5",
"@babel/types": "^7.14.5"
}
},
"@babel/traverse": {
"version": "7.15.0",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.0.tgz",
"integrity": "sha512-392d8BN0C9eVxVWd8H6x9WfipgVH5IaIoLp23334Sc1vbKKWINnvwRpb4us0xtPaCumlwbTtIYNA0Dv/32sVFw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.14.5",
"@babel/generator": "^7.15.0",
"@babel/helper-function-name": "^7.14.5",
"@babel/helper-hoist-variables": "^7.14.5",
"@babel/helper-split-export-declaration": "^7.14.5",
"@babel/parser": "^7.15.0",
"@babel/types": "^7.15.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
}
},
"@babel/types": { "@babel/types": {
"version": "7.15.0", "version": "7.15.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz",
...@@ -3852,20 +3597,6 @@ ...@@ -3852,20 +3597,6 @@
"follow-redirects": "^1.10.0" "follow-redirects": "^1.10.0"
} }
}, },
"babel-eslint": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz",
"integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"@babel/parser": "^7.7.0",
"@babel/traverse": "^7.7.0",
"@babel/types": "^7.7.0",
"eslint-visitor-keys": "^1.0.0",
"resolve": "^1.12.0"
}
},
"balanced-match": { "balanced-match": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
...@@ -4499,9 +4230,9 @@ ...@@ -4499,9 +4230,9 @@
} }
}, },
"eslint-config-prettier": { "eslint-config-prettier": {
"version": "7.2.0", "version": "8.3.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz",
"integrity": "sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg==", "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
...@@ -4753,12 +4484,6 @@ ...@@ -4753,12 +4484,6 @@
"is-glob": "^4.0.1" "is-glob": "^4.0.1"
} }
}, },
"globals": {
"version": "11.12.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
"dev": true
},
"has": { "has": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
...@@ -4975,12 +4700,6 @@ ...@@ -4975,12 +4700,6 @@
"esprima": "^4.0.0" "esprima": "^4.0.0"
} }
}, },
"jsesc": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
"integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
"dev": true
},
"json-schema-traverse": { "json-schema-traverse": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
......
{ {
"name": "relation-graph", "name": "relation-graph",
"version": "0.0.0", "version": "0.0.1",
"description": "关系图",
"author": "Mr.Guo",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"start": "node node_modules/esbuild/install.js && npm run dev", "start": "npm run dev",
"build": "vite build" "build": "vite build"
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"d3": "^7.0.0", "d3": "^7.0.0",
"qs": "^6.10.1", "qs": "^6.10.1",
"vue": "^3.0.5" "vue": "^3.1.5"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^1.1.5", "@vitejs/plugin-vue": "^1.3.0",
"@vue/compiler-sfc": "^3.0.5", "@vue/compiler-sfc": "^3.1.5",
"babel-eslint": "^10.1.0", "eslint": "^7.30.0",
"eslint": "^7.17.0", "eslint-config-prettier": "^8.3.0",
"eslint-config-prettier": "^7.1.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^7.14.0",
"eslint-plugin-vue": "^7.4.1",
"naive-ui": "^2.16.5", "naive-ui": "^2.16.5",
"prettier": "^2.2.1", "prettier": "^2.3.2",
"stylus": "^0.54.8", "stylus": "^0.54.8",
"vite": "^2.1.0" "vite": "^2.4.4",
}, "vue-eslint-parser": "^7.10.0"
"description": "关系图工具", }
"author": "Guo"
} }
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
PUT_SUBJECT: '/subject/{id}', PUT_SUBJECT: '/subject/{id}',
GET_RELATIONS: '/relations', GET_RELATIONS: '/relations',
POST_SUBJECT: '/subject', POST_SUBJECT: '/subject',
POST_NODE: '/node/relation', POST_NODE: '/node/relation/v2',
DELETE_RELATION: '/node/relation/{id}', DELETE_RELATION: '/node/relation/{id}',
GET_NODES: '/node/relations', GET_NODES: '/node/relations',
DELETE_NODE: '/node/{id}', DELETE_NODE: '/node/{id}',
......
<template> <template>
<div class="main"> <div class="main">
<Nav style="grid-area: nav" />
<D3 <D3
ref="d3Ref" ref="d3Ref"
style="grid-area: content" style="grid-area: content"
...@@ -13,7 +12,6 @@ ...@@ -13,7 +12,6 @@
@link="openLinkDrawer" @link="openLinkDrawer"
@del-link="deleteLink" @del-link="deleteLink"
/> />
<Side style="grid-area: side" />
<Footer <Footer
style="grid-area: footer" style="grid-area: footer"
:node="curNode" :node="curNode"
...@@ -176,8 +174,6 @@ ...@@ -176,8 +174,6 @@
<script setup> <script setup>
import D3 from './d3.vue' import D3 from './d3.vue'
import Nav from './nav.vue'
import Side from './side.vue'
import Footer from './footer.vue' import Footer from './footer.vue'
import { ref, watch } from 'vue' import { ref, watch } from 'vue'
import { ajax, api } from '@/ajax' import { ajax, api } from '@/ajax'
...@@ -574,9 +570,9 @@ function deleteItem(i) { ...@@ -574,9 +570,9 @@ function deleteItem(i) {
height 100vh height 100vh
display grid display grid
overflow hidden overflow hidden
grid-template-areas 'nav nav' 'side content' 'side footer' grid-template-areas 'content' 'footer'
grid-template-columns 0px 1fr grid-template-columns 1fr
grid-template-rows 0px 1fr 70px grid-template-rows 1fr 70px
padding 4px padding 4px
font-weight bold !important font-weight bold !important
......
<template>
<div class="nav">
<!-- <n-input
v-model:value="searchKey"
type="text"
placeholder="搜索Subject"
clearable
@keypressenter="search"
/> -->
</div>
</template>
<script>
import { defineComponent, ref } from 'vue'
export default defineComponent({
name: 'Nav',
emits: ['search'],
setup(_, ctx) {
const searchKey = ref(null)
return {
searchKey,
search: () => ctx.emit('search', searchKey.value),
}
},
})
</script>
<style lang="stylus" scoped>
// .nav
// background #f9fbfd
// border-bottom 4px solid #fff
// padding 0 10px
</style>
<template>
<div></div>
</template>
<script>
import { defineComponent } from 'vue'
export default defineComponent({
name: 'Side',
setup() {},
})
</script>
<style lang="stylus" scoped></style>
...@@ -76,6 +76,23 @@ function textWrap(text, width) { ...@@ -76,6 +76,23 @@ function textWrap(text, width) {
}) })
} }
/*
*求圆内接正多边形的顶点串,形如x1,y1,x2,y2,...xn,yn
*cx,cy为圆心,r为半径,n为边数,正多边形底边与X轴平行
*/
function polygonPoints(cx, cy, r, n) {
const alpha = (2 * Math.PI) / n
let a = Math.PI / 2 + alpha / 2
let points = ''
for (let i = 0; i < n; i++) {
x = cx + r * Math.cos(a)
y = cy + r * Math.sin(a)
points += x + ',' + y + ','
a += alpha
}
return points.substring(0, points.length - 1)
}
// 默认配置 // 默认配置
const defaultConfig = { const defaultConfig = {
nodes: [], // 节点数组 nodes: [], // 节点数组
...@@ -167,7 +184,21 @@ export default class RelationGraph { ...@@ -167,7 +184,21 @@ export default class RelationGraph {
} }
}) })
}) })
return { links, nodes } const subjects = []
const objects = []
const others = []
nodes.forEach((n) => {
if (n.subjectType) {
if (n.subjectType == '1') {
subjects.push(n)
} else if (n.subjectType == '2') {
objects.push(n)
}
} else {
others.push(n)
}
})
return { links, nodes, subjects, objects, others }
} }
setKey(key) { setKey(key) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment