You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fu-hsi-web/src/views/caseDetails/js/caseAtlasConfig.js

88 lines
2.8 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* @description: 案件图谱配置
* @fileName: caseAtlasConfig
* @author: 17076
* @date: 2024/7/3-下午2:51
* @version: V1.0.0
**/
const caseAtlasConfig = {
// tooltip: { // 弹窗
// show: false
// },
series: [
{
categories: [],
type: 'graph',
layout: 'force',
zoom: 0.5,
symbolSize: 150,
// 节点是否可以拖动
draggable: true,
roam: true,
hoverAnimation: false,
legendHoverLink: false,
nodeScaleRatio: 0.6, // 鼠标漫游缩放时节点的相应缩放比例当设为0时节点不随着鼠标的缩放而缩放
focusNodeAdjacency: false, // 是否在鼠标移到节点上的时候突出显示节点以及节点的边和邻接节点。
// categories: categories,
itemStyle: {
color: '#67A3FF'
},
edgeSymbol: ['', 'arrow'],
edgeLabel: {
normal: {
show: true,
textStyle: {
fontSize: 12
},
formatter(x) {
return x.data.name
}
}
},
label: {
show: true,
textStyle: {
fontSize: 12
},
color: '#FFFFFF',
textBorderWidth: '1.3',
// 多字换行
formatter: function(params) {
// console.log(params);
var newParamsName = ''
var paramsNameNumber = params.name.length
var provideNumber = 8 // 一行显示几个字
var rowNumber = Math.ceil(paramsNameNumber / provideNumber)
if (paramsNameNumber > provideNumber) {
for (var p = 0; p < rowNumber; p++) {
var tempStr = ''
var start = p * provideNumber
var end = start + provideNumber
if (p === rowNumber - 1) {
tempStr = params.name.substring(start, paramsNameNumber)
} else {
tempStr = params.name.substring(start, end) + '\n\n'
}
newParamsName += tempStr
}
} else {
newParamsName = params.name
}
return newParamsName
}
},
force: {
repulsion: 200, // 节点之间的斥力因子。支持数组表达斥力范围,值越大斥力越大。
gravity: 0.01, // 节点受到的向中心的引力因子。该值越大节点越往中心点靠拢。
edgeLength: 400, // 边的两个节点之间的距离,这个距离也会受 repulsion影响 。值越大则长度越长
layoutAnimation: true // 因为力引导布局会在多次迭代后才会稳定,这个参数决定是否显示布局的迭代动画
// 在浏览器端节点数据较多(>100的时候不建议关闭布局过程会造成浏览器假死。
},
data: [],
links: []
}
]
}
export default caseAtlasConfig