fix: 解决Beta中的 scatterGL 在超出轴线最大最小值范围时依旧渲染的问题

This commit is contained in:
Xu Zhimeng 2023-09-26 15:42:49 +08:00
parent 164e98dad2
commit ad2a550668

View File

@ -358,6 +358,8 @@ export default {
this.emitRangeChange([0, 256, 0, 256]) this.emitRangeChange([0, 256, 0, 256])
this.reDrawRect() this.reDrawRect()
this.rangeScatter()
}, },
// ROI // ROI
@ -409,7 +411,8 @@ export default {
// //
chart.dispatchAction({ chart.dispatchAction({
type: 'takeGlobalCursor' type: 'takeGlobalCursor',
rushOption: false
}) })
}, },
@ -436,11 +439,29 @@ export default {
this.emitRangeChange([x1, x2, y1, y2]) this.emitRangeChange([x1, x2, y1, y2])
this.reDrawRect() this.reDrawRect()
this.rangeScatter()
} }
this.clearBrush(chart) this.clearBrush(chart)
}, },
/**
* 因scatterGL 不受axis中max和min的控制手动处理溢出部分
*/
rangeScatter() {
const {
xAxis: { min: minX, max: maxX },
yAxis: { min: minY, max: maxY }
} = this.twoDOption
const data = this.histogramDataList
.filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY)
.map(({ b, g, c }) => [b, g, c])
this.twoDOption.series.data = data
},
// //
emitRangeChange(range) { emitRangeChange(range) {
this.$emit('rangeChange', range) this.$emit('rangeChange', range)
@ -462,6 +483,7 @@ export default {
} }
this.reDrawRect() this.reDrawRect()
this.rangeScatter()
}, },
// //
@ -705,6 +727,7 @@ export default {
handler(newVal) { handler(newVal) {
this.active = 0 this.active = 0
this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 2D Scatter this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 2D Scatter
this.rangeScatter()
}, },
immediate: true immediate: true
}, },