Skip to content

Commit

Permalink
Removed second cursor from diff chart
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Apr 2, 2024
1 parent 4a901cb commit acadb98
Showing 1 changed file with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class ProfileDifferenceChartComponent extends Streamed implements OnInit
};

private cursor1: Partial<Plotly.Shape> = ProfileDifferenceChartComponent.createCursor(ChartPlotterFactory.depthLineColorA);
private cursor2: Partial<Plotly.Shape> = ProfileDifferenceChartComponent.createCursor(ChartPlotterFactory.depthLineColorB);

private layout: any;
private resampling: ResamplingService;
Expand Down Expand Up @@ -151,21 +150,17 @@ export class ProfileDifferenceChartComponent extends Streamed implements OnInit
return;
}

const update: Partial<Plotly.Layout> = {
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<Plotly.Layout> = {
shapes: [ this.cursor1 ]
};

Plotly.relayout(this.elementName, update);
Plotly.relayout(this.elementName, update);
}
}

private updateCursor(wayPoint: WayPoint, cursor: Partial<Plotly.Shape>): void {
Expand Down

0 comments on commit acadb98

Please sign in to comment.