From acadb98f3d2b41f270cdf1be41c639698023ceb2 Mon Sep 17 00:00:00 2001 From: Jiri Pokorny Date: Tue, 2 Apr 2024 21:28:31 +0200 Subject: [PATCH] Removed second cursor from diff chart --- .../diff-profilechart.component.ts | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/projects/planner/src/app/diff/profilechart/diff-profilechart.component.ts b/projects/planner/src/app/diff/profilechart/diff-profilechart.component.ts index 90924d00..0f495bd2 100644 --- a/projects/planner/src/app/diff/profilechart/diff-profilechart.component.ts +++ b/projects/planner/src/app/diff/profilechart/diff-profilechart.component.ts @@ -34,7 +34,6 @@ export class ProfileDifferenceChartComponent extends Streamed implements OnInit }; private cursor1: Partial = ProfileDifferenceChartComponent.createCursor(ChartPlotterFactory.depthLineColorA); - private cursor2: Partial = ProfileDifferenceChartComponent.createCursor(ChartPlotterFactory.depthLineColorB); private layout: any; private resampling: ResamplingService; @@ -151,21 +150,17 @@ export class ProfileDifferenceChartComponent extends Streamed implements OnInit return; } - const update: Partial = { - shapes: [] - }; + const wayPoint = selected.durationA ? selected.wayPointA : selected.wayPointB; - if(selected.wayPointA) { - this.updateCursor(selected.wayPointA, this.cursor1); - update.shapes!.push(this.cursor1); - } + if(wayPoint) { + this.updateCursor(wayPoint, this.cursor1); - if(selected.wayPointB) { - this.updateCursor(selected.wayPointB, this.cursor2); - update.shapes!.push(this.cursor2); - } + const update: Partial = { + shapes: [ this.cursor1 ] + }; - Plotly.relayout(this.elementName, update); + Plotly.relayout(this.elementName, update); + } } private updateCursor(wayPoint: WayPoint, cursor: Partial): void {