diff --git a/package-lock.json b/package-lock.json index a50323cae..aa8323679 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "dayjs": "^1.11.7", "immer": "^10.0.1", "material-icons": "^1.13.3", - "ng2-charts": "^5.0.3", + "ng2-charts": "^6.0.0", "ngx-ui-tour-md-menu": "^12.0.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", @@ -13424,18 +13424,18 @@ } }, "node_modules/ng2-charts": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/ng2-charts/-/ng2-charts-5.0.4.tgz", - "integrity": "sha512-AnOZ2KSRw7QjiMMNtXz9tdnO+XrIKP/2MX1TfqEEo2fwFU5c8LFJIYqmkMPkIzAEm/U9y/1psA5TDNmxxjEdgA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ng2-charts/-/ng2-charts-6.0.0.tgz", + "integrity": "sha512-Hg45RDOoFoXSDya4U8t2IW2teKnXjy10zJVij65G/62Si+A5+uu8hKQKkBahxg67iTdpOwtyPGnQJ/chHVfFVA==", "dependencies": { "lodash-es": "^4.17.15", "tslib": "^2.3.0" }, "peerDependencies": { - "@angular/cdk": ">=16.0.0", - "@angular/common": ">=16.0.0", - "@angular/core": ">=16.0.0", - "@angular/platform-browser": ">=16.0.0", + "@angular/cdk": ">=17.0.0", + "@angular/common": ">=17.0.0", + "@angular/core": ">=17.0.0", + "@angular/platform-browser": ">=17.0.0", "chart.js": "^3.4.0 || ^4.0.0", "rxjs": "^6.5.3 || ^7.4.0" } diff --git a/package.json b/package.json index f853ee147..b4c4ff0d4 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "dayjs": "^1.11.7", "immer": "^10.0.1", "material-icons": "^1.13.3", - "ng2-charts": "^5.0.3", + "ng2-charts": "^6.0.0", "ngx-ui-tour-md-menu": "^12.0.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", 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], })