From ad2a550668913caa43a1f37f4d1621f598d12c83 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Tue, 26 Sep 2023 15:42:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3Beta=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=20scatterGL=20=E5=9C=A8=E8=B6=85=E5=87=BA=E8=BD=B4=E7=BA=BF?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=9C=80=E5=B0=8F=E5=80=BC=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E6=97=B6=E4=BE=9D=E6=97=A7=E6=B8=B2=E6=9F=93=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/BetaGammaSpectrumChart.vue | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue index d00bc10..3dc5eff 100644 --- a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue +++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue @@ -358,6 +358,8 @@ export default { this.emitRangeChange([0, 256, 0, 256]) this.reDrawRect() + + this.rangeScatter() }, // 点击ROI @@ -409,7 +411,8 @@ export default { // 改为不可刷选状态 chart.dispatchAction({ - type: 'takeGlobalCursor' + type: 'takeGlobalCursor', + rushOption: false }) }, @@ -436,11 +439,29 @@ export default { this.emitRangeChange([x1, x2, y1, y2]) this.reDrawRect() + + this.rangeScatter() } 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) { this.$emit('rangeChange', range) @@ -462,6 +483,7 @@ export default { } this.reDrawRect() + this.rangeScatter() }, // 重绘矩形框区域 @@ -705,6 +727,7 @@ export default { handler(newVal) { this.active = 0 this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 设置2D Scatter数据 + this.rangeScatter() }, immediate: true },