diff --git a/.gitignore b/.gitignore index 60a4aff1..624876e9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist dist-ssr *.local .vscode +.idea diff --git a/package.json b/package.json index 8895b4e3..bbcf6e73 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "three": "^0.145.0", "vue": "^3.2.31", "vue-demi": "^0.13.1", - "vue-i18n": "^9.2.2", + "vue-i18n": "9.2.2", "vue-router": "4.0.12", "vue3-lazyload": "^0.2.5-beta", "vue3-sketch-ruler": "^1.3.3", diff --git a/src/packages/components/Charts/Mores/Graph/config.ts b/src/packages/components/Charts/Mores/Graph/config.ts index 0dfb0dc8..125d7469 100644 --- a/src/packages/components/Charts/Mores/Graph/config.ts +++ b/src/packages/components/Charts/Mores/Graph/config.ts @@ -9,7 +9,8 @@ export const includes = [] // 关系图布局 export const GraphLayout = [ { label: '无', value: 'none' }, - { label: '环形', value: 'circular' } + { label: '环形', value: 'circular' }, + { label: '力引导', value: 'force' } ] // 标签开关 @@ -24,44 +25,57 @@ export const LabelPosition = [ { label: '右侧', value: 'right' }, { label: '顶部', value: 'top' }, { label: '底部', value: 'bottom' }, - { label: '内部', value: 'inside' }, + { label: '内部', value: 'inside' } +] + +// 图-迭代动画 +export const LayoutAnimation = [ + { label: '开启', value: 1 }, + { label: '关闭', value: 0 } ] export const option = { - dataset: { ...dataJson }, - tooltip: {}, - legend:{ - show:true, - textStyle:{ - color:"#eee", - fontSize: 14 , - }, - data: dataJson.categories.map(function (a) { - return a.name; - }) + dataset: { ...dataJson }, + tooltip: {}, + legend: { + show: true, + textStyle: { + color: '#eee', + fontSize: 14 }, - series: [ - { - type: 'graph', - layout: 'none', // none circular环形布局 - data: dataJson.nodes, - links: dataJson.links, - categories: dataJson.categories, - label: { // 标签 - show: 1, - position: 'right', - formatter: '{b}' - }, - labelLayout: { - hideOverlap: true - }, - lineStyle: { - color: 'source', // 线条颜色 - curveness: 0.2 // 线条卷曲程度 - } + data: dataJson.categories.map(function (a) { + return a.name + }) + }, + series: [ + { + type: 'graph', + layout: 'none', // none circular环形布局 + data: dataJson.nodes, + links: dataJson.links, + categories: dataJson.categories, + label: { + show: 1, + position: 'right', + formatter: '{b}' + }, + labelLayout: { + hideOverlap: true + }, + lineStyle: { + color: 'source', // 线条颜色 + curveness: 0.2 // 线条卷曲程度 + }, + force: { + repulsion: 100, + gravity: 0.1, + edgeLength: 30, + layoutAnimation: 1, + friction: 0.6 } - ] - }; + } + ] +} export default class Config extends PublicConfigClass implements CreateComponentType { public key = GraphConfig.key diff --git a/src/packages/components/Charts/Mores/Graph/config.vue b/src/packages/components/Charts/Mores/Graph/config.vue index 07319fde..65e6e38d 100644 --- a/src/packages/components/Charts/Mores/Graph/config.vue +++ b/src/packages/components/Charts/Mores/Graph/config.vue @@ -16,14 +16,14 @@ - + + v-model:value="optionData.series[0].lineStyle.curveness" + :min="0" + :step="0.01" + placeholder="弯曲程度" + size="small" + > @@ -32,10 +32,61 @@ size="small" :modes="['hex']" v-model:value="optionData.legend.textStyle.color" - > + > - + + + + + + + + + + + + + + + + + + + + + + @@ -46,7 +97,7 @@ diff --git a/src/packages/components/Charts/Mores/Graph/index.vue b/src/packages/components/Charts/Mores/Graph/index.vue index 40c2b0e1..378c968e 100644 --- a/src/packages/components/Charts/Mores/Graph/index.vue +++ b/src/packages/components/Charts/Mores/Graph/index.vue @@ -1,5 +1,12 @@