添加红色圆

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