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