From 4d37f0fb7ee4c181f5a55383eb917731a02d1aeb Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Wed, 13 Nov 2024 13:33:21 -0800 Subject: [PATCH] Slider now is recreated on refresh for prior series --- .../timeseries-results-menu.component.ts | 12 +++++++++--- .../timeseries-chart-temporal-slider.component.scss | 3 ++- src/styles.scss | 4 ++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/app/components/results-menu/timeseries-results-menu/timeseries-results-menu.component.ts b/src/app/components/results-menu/timeseries-results-menu/timeseries-results-menu.component.ts index e01f20a8c..e4ab44c07 100644 --- a/src/app/components/results-menu/timeseries-results-menu/timeseries-results-menu.component.ts +++ b/src/app/components/results-menu/timeseries-results-menu/timeseries-results-menu.component.ts @@ -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); + }) }); } } @@ -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; @@ -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(); diff --git a/src/app/components/timeseries-chart/timeseries-chart-temporal-slider/timeseries-chart-temporal-slider.component.scss b/src/app/components/timeseries-chart/timeseries-chart-temporal-slider/timeseries-chart-temporal-slider.component.scss index cf7785e8b..d18e1cfcb 100644 --- a/src/app/components/timeseries-chart/timeseries-chart-temporal-slider/timeseries-chart-temporal-slider.component.scss +++ b/src/app/components/timeseries-chart/timeseries-chart-temporal-slider/timeseries-chart-temporal-slider.component.scss @@ -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; diff --git a/src/styles.scss b/src/styles.scss index 7ace069af..12d89fecb 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -512,6 +512,10 @@ ul { font-size: 13px; top: 17px; } + + .noUi-tooltip { + font-size: 14px; + } } .tick > line {