Skip to content

Commit

Permalink
Slider now is recreated on refresh for prior series
Browse files Browse the repository at this point in the history
  • Loading branch information
artisticlight committed Nov 13, 2024
1 parent 0b65eb3 commit 4d37f0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,13 @@ export class TimeseriesResultsMenuComponent implements OnInit, OnDestroy {
return this.wktService.wktToFeature(value, 'EPSG:4326');
})
previous_points?.forEach((point, idx) => {
let allPointsData = [];
this.pointHistoryService.addPoint(point.getGeometry(), idx + 1);
this.netcdfService.getTimeSeries(point.getGeometry()).pipe(first()).subscribe()
this.netcdfService.getTimeSeries(point.getGeometry()).pipe(first()).subscribe( data => {
allPointsData.push(data);
// this.chartData.next(allPointsData);
this.maxRange = this.temporalRange = this.getMaxRange(allPointsData);
})
});
}
}
Expand Down Expand Up @@ -236,6 +241,7 @@ export class TimeseriesResultsMenuComponent implements OnInit, OnDestroy {
public toggleAllSeries(checked: boolean) {
this.store$.dispatch(chartStore.setAllTimeseriesChecked({checked}))
}

public getMaxRange(allSeries: PointSeries[]) {
let minDate = null;
let maxDate = null;
Expand All @@ -255,15 +261,15 @@ export class TimeseriesResultsMenuComponent implements OnInit, OnDestroy {
return dateRange;
}


public updateSeries(checked: boolean, index?: number) {
const wkt = this.chartStates[index]?.wkt

this.store$.dispatch(chartStore.setTimeseriesChecked({wkt, checked}))
}

public deletePoint(index: number) {
this.pointHistoryService.removePoint(index);
}

ngOnDestroy() {
this.pointHistoryService.clearPoints();
this.subs.unsubscribe();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Contenedor principal del slider */
.displacement-slider {
margin: 20px auto; /* Centra el slider horizontalmente */
display: block;
margin: 10px 20px 20px 45px; /* Centra el slider horizontalmente */
width: 100%; /* Ocupa todo el ancho disponible */
max-width: 95%; /* Opcional: Limita el ancho máximo para que no se extienda demasiado */
box-sizing: border-box;
Expand Down
4 changes: 4 additions & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ ul {
font-size: 13px;
top: 17px;
}

.noUi-tooltip {
font-size: 14px;
}
}

.tick > line {
Expand Down

0 comments on commit 4d37f0f

Please sign in to comment.