Merge branch 'master' of http://172.16.20.1:3000/duanhao/SocialNetworks_duan
This commit is contained in:
commit
6c143c2a55
|
|
@ -6,7 +6,7 @@
|
|||
<TimeAxis
|
||||
v-if="timeList.length"
|
||||
:time-list="timeList"
|
||||
:is-auto-play="isPlay"
|
||||
:is-auto-play="false"
|
||||
:start-time="new Date(timeList[0])"
|
||||
:end-time="new Date(timeList[timeList.length - 1])"
|
||||
@click:pointerDown="handlePointerDown"
|
||||
|
|
@ -40,18 +40,18 @@ const defaultConfig = {
|
|||
show: true,
|
||||
font: "normal 14px KaiTi",
|
||||
color: "250,250,250",
|
||||
textPosition: "Bottom_Center", //Middle_Center
|
||||
textPosition: "Middle_Center", //Middle_Center
|
||||
textOffsetY: 10
|
||||
},
|
||||
shape: "circle",
|
||||
size: 30,
|
||||
size: 60,
|
||||
borderColor: "200,50,50",
|
||||
borderWidth: 0,
|
||||
selected: {
|
||||
borderWidth: 2,
|
||||
borderColor: "100,250,100",
|
||||
showShadow: true, // 是否展示阴影
|
||||
shadowBlur: 10, //阴影范围大小
|
||||
shadowBlur: 5, //阴影范围大小
|
||||
shadowColor: "50,250,30" // 选中是的阴影颜色
|
||||
}
|
||||
},
|
||||
|
|
@ -64,7 +64,7 @@ const defaultConfig = {
|
|||
background: "255,255,255" //文字背景色(设置后文字居中,一般与画布背景色一致)
|
||||
},
|
||||
lineType: "straight", // curver
|
||||
showArrow: false,
|
||||
showArrow: true,
|
||||
lineWidth: 2,
|
||||
colorType: "both",
|
||||
color: "240,240,240",
|
||||
|
|
@ -131,16 +131,18 @@ const registEvents = () => {
|
|||
}
|
||||
const runForceLayout = (layoutConfig, layoutType, isAsync) => {
|
||||
//执行异步布局计算
|
||||
|
||||
graphVis.excuteWorkerLayout(
|
||||
graphVis.getGraphData(),
|
||||
layoutType,
|
||||
layoutConfig,
|
||||
isAsync,
|
||||
function () {
|
||||
isPlay.value = true
|
||||
graphVis.zoomFit() //布局结束缩放居中
|
||||
// isPlay.value = true
|
||||
graphVis.zoomFit() //场景视图大小自适应缩放
|
||||
}
|
||||
)
|
||||
graphVis.hideIsolatedNodes() //隐藏孤立节点
|
||||
}
|
||||
// 根据节点的cluster属性进行分组
|
||||
const clusterAnalyze = () => {
|
||||
|
|
@ -173,6 +175,7 @@ const clusterAnalyze = () => {
|
|||
group.smoothPath = false //拟合平滑曲线(耗性能)
|
||||
})
|
||||
graphVis.autoGroupLayout(graphVis.nodes)
|
||||
// graphVis.selectedEdge(graphVis.links[0])
|
||||
}
|
||||
|
||||
const createGraph = () => {
|
||||
|
|
@ -205,7 +208,6 @@ const updateChart = (newGraphData) => {
|
|||
}
|
||||
graphVis.clearAll()
|
||||
graphVis.addGraph({ ...toRaw(newGraphData) })
|
||||
graphVis.zoomFit()
|
||||
// 重新运行力导向布局
|
||||
clusterAnalyze()
|
||||
runForceLayout({ strength: -500, ajustCluster: true }, "simulation", true)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user