修改第四个页面的节点和前面节点的区分

This commit is contained in:
qumeng039@126.com 2025-08-12 09:44:30 +08:00
parent f52589a651
commit bc45d925fd
3 changed files with 123 additions and 98 deletions

View File

@ -463,9 +463,13 @@ export const useGroupStructureStore = defineStore("groupStructure", {
chart: {
xAxisData: item.chart.xaxisData.map((item) => utcStringToHHMMSS(item)),
yAxisRange: {
min: item.name === '内部密度指数演化' ? 20.0 : 0,
max: item.name === '内部密度指数演化' ? 20.5 : Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval: item.name === '内部密度指数演化' ? 0.1 : Math.ceil(item.chart.yaxisRange.max / 5)
min: item.name === "内部密度指数演化" ? 20.0 : 0,
max:
item.name === "内部密度指数演化"
? 20.5
: Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval:
item.name === "内部密度指数演化" ? 0.1 : Math.ceil(item.chart.yaxisRange.max / 5)
},
seriesList: item.chart.seriesList.map((item) => ({
data: item.data,
@ -480,9 +484,13 @@ export const useGroupStructureStore = defineStore("groupStructure", {
chart: {
xAxisData: item.chart.xaxisData.map((item) => utcStringToHHMMSS(item)),
yAxisRange: {
min: item.name === '内部密度指数演化' ? 20.0 : 0,
max: item.name === '内部密度指数演化' ? 20.5 : Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval: item.name === '内部密度指数演化' ? 0.1 : Math.ceil(item.chart.yaxisRange.max / 5)
min: item.name === "内部密度指数演化" ? 20.0 : 0,
max:
item.name === "内部密度指数演化"
? 20.5
: Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval:
item.name === "内部密度指数演化" ? 0.1 : Math.ceil(item.chart.yaxisRange.max / 5)
},
seriesList: item.chart.seriesList.map((item) => ({
data: item.data,
@ -497,9 +505,13 @@ export const useGroupStructureStore = defineStore("groupStructure", {
chart: {
xAxisData: item.chart.xaxisData.map((item) => utcStringToHHMMSS(item)),
yAxisRange: {
min: item.name === '内部密度指数演化' ? 20.0 : 0,
max: item.name === '内部密度指数演化' ? 20.5 : Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval: item.name === '内部密度指数演化' ? 0.1 : Math.ceil(item.chart.yaxisRange.max / 5)
min: item.name === "内部密度指数演化" ? 20.0 : 0,
max:
item.name === "内部密度指数演化"
? 20.5
: Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval:
item.name === "内部密度指数演化" ? 0.1 : Math.ceil(item.chart.yaxisRange.max / 5)
},
seriesList: item.chart.seriesList.map((item) => ({
data: item.data,
@ -626,9 +638,15 @@ export const useGroupMemberStore = defineStore("groupMember", {
chart: {
xAxisData: item.chart.xaxisData.map((item) => utcStringToHHMMSS(item)),
yAxisRange: {
min: item.name ==='合并演化' || item.name ==='扩展演化' ? 20.00 : 0,
max: item.name ==='合并演化' || item.name ==='扩展演化' ? 20.03 : Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval: item.name ==='合并演化' || item.name ==='扩展演化' ? 0.006 : Math.ceil(item.chart.yaxisRange.max / 5)
min: item.name === "合并演化" || item.name === "扩展演化" ? 20.0 : 0,
max:
item.name === "合并演化" || item.name === "扩展演化"
? 20.03
: Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval:
item.name === "合并演化" || item.name === "扩展演化"
? 0.006
: Math.ceil(item.chart.yaxisRange.max / 5)
},
seriesList: item.chart.seriesList.map((item) => ({
data: item.data.map((item) => item.toFixed(2)),
@ -644,9 +662,15 @@ export const useGroupMemberStore = defineStore("groupMember", {
chart: {
xAxisData: item.chart.xaxisData.map((item) => utcStringToHHMMSS(item)),
yAxisRange: {
min: item.name ==='合并演化' || item.name ==='扩展演化' ? 20.00 : 0,
max: item.name ==='合并演化' || item.name ==='扩展演化' ? 20.03 : Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval: item.name ==='合并演化' || item.name ==='扩展演化' ? 0.006 : Math.ceil(item.chart.yaxisRange.max / 5)
min: item.name === "合并演化" || item.name === "扩展演化" ? 20.0 : 0,
max:
item.name === "合并演化" || item.name === "扩展演化"
? 20.03
: Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval:
item.name === "合并演化" || item.name === "扩展演化"
? 0.006
: Math.ceil(item.chart.yaxisRange.max / 5)
},
seriesList: item.chart.seriesList.map((item) => ({
data: item.data.map((item) => item.toFixed(2)),
@ -662,9 +686,9 @@ export const useGroupMemberStore = defineStore("groupMember", {
chart: {
xAxisData: item.chart.xaxisData.map((item) => utcStringToHHMMSS(item)),
yAxisRange: {
min: item.name ==='合并演化' ? 20.00 : 0,
max: item.name ==='合并演化' ? 20.03 : Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval: item.name ==='合并演化' ? 0.006 : Math.ceil(item.chart.yaxisRange.max / 5)
min: item.name === "合并演化" ? 20.0 : 0,
max: item.name === "合并演化" ? 20.03 : Math.ceil(item.chart.yaxisRange.max / 5) * 5,
interval: item.name === "合并演化" ? 0.006 : Math.ceil(item.chart.yaxisRange.max / 5)
},
seriesList: item.chart.seriesList.map((item) => ({
data: item.data.map((item) => item.toFixed(2)),

View File

@ -1,5 +1,6 @@
//自定义绘制节点的方法
export const paintNodeFunction = function (ctx, onlyShape) {
export const paintNodeFunction = (storeId) => {
return function (ctx, onlyShape) {
//默认绘制数据类型图片
if (this.properties.typeIcon) {
if (this.selected || this.showSelected) {
@ -29,12 +30,7 @@ export const paintNodeFunction = function (ctx, onlyShape) {
} else {
this.drawShape(ctx, onlyShape)
}
// ctx.beginPath()
// ctx.arc(0, 0, this.radius + 6, 0, Math.PI * 2)
// ctx.lineWidth = 8
// ctx.strokeStyle = `rgba(${this.fillColor},${this.alpha * 0.4})`
// ctx.stroke()
if (storeId == "anomalousGroup") {
// 半径 & 样式参数(按需调整)
// ===== 三层:实心圆 + 半透明边框 + 外圈虚线 =====
const rFill = this.radius // 实心圆半径
@ -77,9 +73,17 @@ export const paintNodeFunction = function (ctx, onlyShape) {
ctx.stroke()
ctx.setLineDash([]) // 清理,避免影响后续绘制
ctx.restore()
} else {
ctx.beginPath()
ctx.arc(0, 0, this.radius + 6, 0, Math.PI * 2)
ctx.lineWidth = 5
ctx.strokeStyle = `rgba(${this.fillColor},${this.alpha * 0.4})`
ctx.stroke()
}
this.paintText(ctx) //调用内部方法绘制文字
}
}
//自定义连线的方法
export const paintLineFunction = function (ctx, needHideText) {

View File

@ -46,10 +46,9 @@ const defaultConfig = {
textOffsetY: 10
},
shape: "circle",
size: 15,
size: storeId == "anomalousGroup" ? 15 : 40,
borderColor: "200,50,50",
borderWidth: 0,
selected: {
borderWidth: 5,
borderColor: "100,250,100",
@ -77,8 +76,8 @@ const defaultConfig = {
},
highLightNeiber: true //
}
const registCustomePaintFunc = () => {
graphVis.definedNodePaintFunc(paintNodeFunction) //
const registCustomePaintFunc = (curStoreId) => {
graphVis.definedNodePaintFunc(paintNodeFunction(curStoreId)) //
graphVis.definedLinkPaintFunc(paintLineFunction) //
}
//
@ -128,7 +127,6 @@ const registEvents = () => {
currentSelectNode.value.fx = null
currentSelectNode.value.fy = null
currentSelectNode.value = null
// highLightAboutNodesOrLinks(typeMap[storeId])
}
})
}
@ -136,9 +134,9 @@ const registEvents = () => {
//线
const highLightAboutNodesOrLinks = (type) => {
graphVis.cancelAllSelected()
const { newNodes, newLinks } = graph.value
if (type == "nodes") {
//
const { newNodes } = graph.value
graphVis.nodes.forEach((node) =>
newNodes.forEach((newNode) => {
if (node.id === newNode.name) {
@ -148,7 +146,6 @@ const highLightAboutNodesOrLinks = (type) => {
)
} else if (type == "links") {
//线
const { newLinks } = graph.value
graphVis.links.forEach((link) =>
newLinks.forEach((newLink) => {
if (link.source.id === newLink.source && link.target.id === newLink.target) {
@ -311,7 +308,7 @@ const createGraph = () => {
graphVis.setDragHideLine(false) //线
graphVis.setShowDetailScale(0.1) //
graphVis.setZoomRange(0.1, 5) //
registCustomePaintFunc() //
registCustomePaintFunc(storeId) //
registEvents()
}