This commit is contained in:
duanhao 2025-08-08 10:07:08 +08:00
commit 6c143c2a55

View File

@ -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)