Skip to content

Commit

Permalink
style: show reference point bold
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercchase committed Nov 7, 2024
1 parent 78a35db commit a35851d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@
top: 17px;
right: 95px;
}


:host ::ng-deep .ts-reference-point {
fill: red !important;
}
23 changes: 10 additions & 13 deletions src/app/components/timeseries-chart/timeseries-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ interface TimeSeriesChartPoint {

interface TimeSeriesData {
short_wavelength_displacement: number
date: string
date: string,
id: string
}

interface DataReady {
Expand Down Expand Up @@ -181,18 +182,11 @@ export class TimeseriesChartComponent implements OnInit, OnDestroy {
'id': key,
'temporal_baseline': result[key].temporal_baseline
})
if(this.baseData) {
this.timeSeriesData.push({
'short_wavelength_displacement': result[key].short_wavelength_displacement - this.baseData.short_wavelength_displacement,
'date': result[key].secondary_datetime
});
}
else {
this.timeSeriesData.push({
'short_wavelength_displacement': result[key].short_wavelength_displacement,
'date': result[key].secondary_datetime
});
}
this.timeSeriesData.push({
'short_wavelength_displacement': result[key].short_wavelength_displacement - (this.baseData?.short_wavelength_displacement ?? 0),
'date': result[key].secondary_datetime,
'id': key + result[key].short_wavelength_displacement
})
}
this.timeSeriesData.sort((a, b) => {
if(a.date < b.date) {
Expand Down Expand Up @@ -378,6 +372,9 @@ export class TimeseriesChartComponent implements OnInit, OnDestroy {
.append('circle')
.attr('cx', (d) => this.x(Date.parse(d.date)))
.attr('cy', (d) => this.y(d.short_wavelength_displacement))
.attr('class', (d) : string=> { if(this.baseData && this.baseData.id === d.id) {
return 'ts-reference-point'
}})
.on('mouseover', function (_event: any, p: TimeSeriesData) {
self.hoveredElement = this;
const date = new Date(p.date);
Expand Down

0 comments on commit a35851d

Please sign in to comment.