diff --git a/src/views/GroupEvolution/component/groupGraph.vue b/src/views/GroupEvolution/component/groupGraph.vue index b329fbb..5dd8158 100644 --- a/src/views/GroupEvolution/component/groupGraph.vue +++ b/src/views/GroupEvolution/component/groupGraph.vue @@ -185,7 +185,7 @@ const clusterAnalyze = () => { node.color = color }) graphVis.addNodesInGroup(nodes, { - shape: "polygon", //circle|rect|polygon|bubbleset + shape: "circle", //circle|rect|polygon|bubbleset color: color, alpha: 0.2 }) @@ -233,43 +233,53 @@ const clusterAnalyze = () => { g.smoothPath = false; }); */ - // 时间门控:达到阈值就把各组异常节点染红 + 加红圈 + // 时间门控:达到阈值就把各组异常节点染红 const shouldA = now >= TA; const shouldB = now >= TB; const shouldC = now >= TC; if(shouldA) { - console.log("A异常") - graphVis.nodes = graphVis.nodes.map(n => { if(props.store.graphAbnormalData.groupA.includes(n.id)) { n.fillColor = RED; } return n; }) + console.log(graphVis.nodes) + graphVis.addNodesInGroup(graphVis.nodes.filter(n => props.store.graphAbnormalData.groupA.includes(n.id)), { + shape: "circle", + color: RED, + alpha: GROUP_ALPHA + }) + } if(shouldB) { - console.log("B异常") graphVis.nodes = graphVis.nodes.map(n => { if(props.store.graphAbnormalData.groupB.includes(n.id)) { n.fillColor = RED; } return n; }) + graphVis.addNodesInGroup(graphVis.nodes.filter(n => props.store.graphAbnormalData.groupB.includes(n.id)), { + shape: "circle", + color: RED, + alpha: GROUP_ALPHA + }) + } if(shouldC) { - console.log("C异常") - graphVis.nodes = graphVis.nodes.map(n => { if(props.store.graphAbnormalData.groupC.includes(n.id)) { n.fillColor = RED; } return n; }) + graphVis.addNodesInGroup(graphVis.nodes.filter(n => props.store.graphAbnormalData.groupC.includes(n.id)), { + shape: "circle", + color: RED, + alpha: GROUP_ALPHA + }) } - - - graphVis.autoGroupLayout(graphVis.nodes); graphVis.zoomFit(); // 没有 refresh;这两个就够 }