From 5a216202aaec5e5521dc9b5cb6d82f29a0967562 Mon Sep 17 00:00:00 2001 From: Lukas Merz Date: Mon, 4 Mar 2024 09:37:23 +0100 Subject: [PATCH] Adapt breaking changes in charts library --- .../elevation-profile-chart.component.ts | 3 +++ src/app/map/map.module.ts | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/map/components/elevation-profile-overlay/elevation-profile-chart/elevation-profile-chart.component.ts b/src/app/map/components/elevation-profile-overlay/elevation-profile-chart/elevation-profile-chart.component.ts index f9a6ca5f5..3773502c2 100644 --- a/src/app/map/components/elevation-profile-overlay/elevation-profile-chart/elevation-profile-chart.component.ts +++ b/src/app/map/components/elevation-profile-overlay/elevation-profile-chart/elevation-profile-chart.component.ts @@ -3,13 +3,16 @@ import {ElevationProfileData, ElevationProfileDataPoint} from '../../../../share import {ElevationProfileChartJsDataConfiguration} from './types/chartjs.type'; import {ElevationPlotConfigService} from './services/elevation-plot-config.service'; import {ElevationProfileChartJsOptions} from './interfaces/chartjs.interface'; +import {BaseChartDirective} from 'ng2-charts'; const VERTIXAL_AXIS_LABEL = 'MüM'; @Component({ + standalone: true, selector: 'elevation-profile-chart', templateUrl: './elevation-profile-chart.component.html', styleUrls: ['./elevation-profile-chart.component.scss'], + imports: [BaseChartDirective], }) export class ElevationProfileChartComponent implements OnInit { @Input() public elevationProfileData!: ElevationProfileData; diff --git a/src/app/map/map.module.ts b/src/app/map/map.module.ts index 011657230..7cb6a8f74 100644 --- a/src/app/map/map.module.ts +++ b/src/app/map/map.module.ts @@ -68,8 +68,6 @@ import {ProductComponent} from './components/map-tools/product/product.component import {DataDownloadFilterDialogComponent} from './components/map-tools/data-download-filter-dialog/data-download-filter-dialog.component'; import {DataDownloadEmailDialogComponent} from './components/map-tools/data-download-email-dialog/data-download-email-dialog.component'; import {ElevationProfileOverlayComponent} from './components/elevation-profile-overlay/elevation-profile-overlay.component'; -import {NgChartsModule} from 'ng2-charts'; -import {ElevationProfileChartComponent} from './components/elevation-profile-overlay/elevation-profile-chart/elevation-profile-chart.component'; import {ElevationProfileStatisticsComponent} from './components/elevation-profile-overlay/elevation-profile-statistics/elevation-profile-statistics.component'; import {DataDownloadEmailConfirmationDialogComponent} from './components/map-tools/data-download-email-confirmation-dialog/data-download-email-confirmation-dialog.component'; import {DataDownloadStatusQueueComponent} from './components/map-tools/data-download-status-queue/data-download-status-queue.component'; @@ -86,8 +84,11 @@ import {MapAttributeFilterOverlayComponent} from './components/map-attribute-fil import {DelayedMouseEnterDirective} from '../shared/directives/delayed-mouse-enter.directive'; import {DisableOverscrollBehaviourComponent} from './components/disable-overscroll-behaviour/disable-overscroll-behaviour.component'; import {NotificationIndicatorComponent} from './components/notification-indicator/notification-indicator.component'; +import {ElevationProfileChartComponent} from './components/elevation-profile-overlay/elevation-profile-chart/elevation-profile-chart.component'; +import {provideCharts, withDefaultRegisterables} from 'ng2-charts'; @NgModule({ + providers: [provideCharts(withDefaultRegisterables())], declarations: [ MapPageComponent, MapContainerComponent, @@ -152,7 +153,6 @@ import {NotificationIndicatorComponent} from './components/notification-indicato DataDownloadFilterDialogComponent, DataDownloadEmailDialogComponent, ElevationProfileOverlayComponent, - ElevationProfileChartComponent, ElevationProfileStatisticsComponent, DataDownloadEmailConfirmationDialogComponent, DataDownloadStatusQueueComponent, @@ -168,7 +168,6 @@ import {NotificationIndicatorComponent} from './components/notification-indicato OnboardingGuideModule, FormsModule, ReactiveFormsModule, - NgChartsModule, MapImportServiceAndUrlComponent, MapImportLayerListComponent, MapImportDisplayNameComponent, @@ -180,6 +179,7 @@ import {NotificationIndicatorComponent} from './components/notification-indicato DelayedMouseEnterDirective, DisableOverscrollBehaviourComponent, NotificationIndicatorComponent, + ElevationProfileChartComponent, ], exports: [LegendOverlayComponent, FeatureInfoOverlayComponent, MapContainerComponent, ZoomControlsComponent, MapOverlayComponent], })