添加红色圆

This commit is contained in:
duanhao 2025-08-11 09:21:20 +08:00
parent f55627e0c0
commit 76bdd3535a

View File

@ -185,7 +185,7 @@ const clusterAnalyze = () => {
node.color = color node.color = color
}) })
graphVis.addNodesInGroup(nodes, { graphVis.addNodesInGroup(nodes, {
shape: "polygon", //circle|rect|polygon|bubbleset shape: "circle", //circle|rect|polygon|bubbleset
color: color, color: color,
alpha: 0.2 alpha: 0.2
}) })
@ -233,43 +233,53 @@ const clusterAnalyze = () => {
g.smoothPath = false; g.smoothPath = false;
}); */ }); */
// + //
const shouldA = now >= TA; const shouldA = now >= TA;
const shouldB = now >= TB; const shouldB = now >= TB;
const shouldC = now >= TC; const shouldC = now >= TC;
if(shouldA) { if(shouldA) {
console.log("A异常")
graphVis.nodes = graphVis.nodes.map(n => { graphVis.nodes = graphVis.nodes.map(n => {
if(props.store.graphAbnormalData.groupA.includes(n.id)) { if(props.store.graphAbnormalData.groupA.includes(n.id)) {
n.fillColor = RED; n.fillColor = RED;
} }
return n; 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) { if(shouldB) {
console.log("B异常")
graphVis.nodes = graphVis.nodes.map(n => { graphVis.nodes = graphVis.nodes.map(n => {
if(props.store.graphAbnormalData.groupB.includes(n.id)) { if(props.store.graphAbnormalData.groupB.includes(n.id)) {
n.fillColor = RED; n.fillColor = RED;
} }
return n; return n;
}) })
graphVis.addNodesInGroup(graphVis.nodes.filter(n => props.store.graphAbnormalData.groupB.includes(n.id)), {
shape: "circle",
color: RED,
alpha: GROUP_ALPHA
})
} }
if(shouldC) { if(shouldC) {
console.log("C异常")
graphVis.nodes = graphVis.nodes.map(n => { graphVis.nodes = graphVis.nodes.map(n => {
if(props.store.graphAbnormalData.groupC.includes(n.id)) { if(props.store.graphAbnormalData.groupC.includes(n.id)) {
n.fillColor = RED; n.fillColor = RED;
} }
return n; 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.autoGroupLayout(graphVis.nodes);
graphVis.zoomFit(); // refresh graphVis.zoomFit(); // refresh
} }