Skip to content

Commit

Permalink
chore: Remove obsolete ngx-charts module
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikriemer committed Feb 10, 2025
1 parent 0b99270 commit 186bb85
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 62 deletions.
1 change: 0 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@ngx-loading-bar/core": "6.0.2",
"@ngx-loading-bar/http-client": "6.0.2",
"@panzoom/panzoom": "^4.5.1",
"@swimlane/ngx-charts": "^20.5.0",
"angular-gridster2": "^18.0.1",
"codemirror": "^5.65.11",
"console-browserify": "^1.2.0",
Expand Down
2 changes: 0 additions & 2 deletions ui/src/app/core-ui/core-ui.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import { ColorPickerModule } from 'ngx-color-picker';
import { QuillModule } from 'ngx-quill';
import { CodemirrorModule } from '@ctrl/ngx-codemirror';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { ErrorHintComponent } from './error-hint/error-hint.component';
import { AddToCollectionComponent } from './static-properties/static-collection/add-to-collection/add-to-collection.component';
import { PipelineStartedStatusComponent } from './pipeline/pipeline-started-status/pipeline-started-status.component';
Expand Down Expand Up @@ -152,7 +151,6 @@ import { TopicsComponent } from './topics/topics.component';
MatProgressSpinnerModule,
MatDatepickerModule,
MatNativeDateModule,
NgxChartsModule,
MatSliderModule,
MatSlideToggleModule,
MatChipsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,29 @@
~
-->

<sp-basic-header-title-component
[title]="elementName + ' - Metrics'"
></sp-basic-header-title-component>
<div fxLayout="row" fxLayoutAlign="center center">
<div fxFlex="50">
<div fxLayout="column">
<sp-basic-header-title-component
[title]="elementName + ' - Metrics'"
></sp-basic-header-title-component>
<div
fxLayout="row"
fxLayoutAlign="center center"
fxLayoutGap="20px"
fxFlex="100"
>
<sp-status-widget
fxFlex="100"
fxFlex="50"
[label]="lastPublishedLabel"
[widgetHeight]="400"
[widgetWidth]="500"
widgetHeight="400px"
[statusValue]="
lastTimestamp === 0 ? 'n/a' : (lastTimestamp | date: 'medium')
"
>
</sp-status-widget>
</div>
<div fxFlex="50">
<sp-status-widget
fxFlex="100"
fxFlex="50"
[label]="statusValueLabel"
[widgetHeight]="400"
[widgetWidth]="500"
widgetHeight="400px"
[statusValue]="statusValue"
>
</sp-status-widget>
Expand Down
25 changes: 14 additions & 11 deletions ui/src/app/core-ui/status/status-widget.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
-->

<div fxFlex="100" fxLayoutAlign="center center" fxLayout="column">
<ngx-charts-number-card
[ngStyle]="{ width: widgetWidth + 'px' }"
[view]="[widgetWidth, widgetHeight]"
[results]="chartData"
[scheme]="'cool'"
[cardColor]="color"
[animations]="false"
[bandColor]="bandColor"
[textColor]="textColor"
>
</ngx-charts-number-card>
<div class="status-container p-10" [ngStyle]="{ height: widgetHeight }">
<div fxFlex fxLayout="column">
<div class="status-container-label" fxLayoutAlign="start start">
<span>{{ label }}</span>
</div>
<div
class="status-container-value"
fxLayoutAlign="center center"
fxFlex
>
<span>{{ statusValue }}</span>
</div>
</div>
</div>
</div>
20 changes: 20 additions & 0 deletions ui/src/app/core-ui/status/status-widget.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,23 @@
.fix-margin {
margin-top: -5px;
}

.status-container {
height: 150px;
width: 100%;
color: var(--color-accent);
border-radius: 5px;
margin-bottom: 20px;
border: 2px solid var(--color-bg-2);
background: var(--color-bg-2);
border-bottom: 5px solid var(--color-accent);
}

.status-container-value {
font-size: 36pt;
font-weight: bold;
}

.status-container-label {
font-size: 14pt;
}
33 changes: 4 additions & 29 deletions ui/src/app/core-ui/status/status-widget.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,13 @@ import { Component, Input } from '@angular/core';
styleUrls: ['./status-widget.component.scss'],
})
export class StatusWidgetComponent {
@Input() color = 'rgb(156, 156, 156)';
@Input() bandColor = 'rgb(27, 20, 100)';
@Input() textColor = 'rgb(96,96,96)';

@Input() widgetWidth = 400;
@Input() widgetHeight = 150;

_label: string;
_statusValue: string | number;

chartData: any;

constructor() {}
@Input() widgetHeight = '150px';

@Input()
set statusValue(statusValue: string | number) {
this._statusValue = statusValue;
this.updateChartData();
}
label: string;

@Input()
set label(label: string) {
this._label = label;
this.updateChartData();
}

updateChartData() {
this.chartData = [];
this.chartData = [{ name: this._label, value: this._statusValue }];
}
statusValue: string | number;

getBackground() {
return { background: this.color };
}
constructor() {}
}
2 changes: 0 additions & 2 deletions ui/src/app/dashboard/dashboard.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { FormsModule } from '@angular/forms';
import { ColorPickerModule } from 'ngx-color-picker';
import { MatGridListModule } from '@angular/material/grid-list';
import { DashboardOverviewComponent } from './components/overview/dashboard-overview.component';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { CdkTableModule } from '@angular/cdk/table';
import { LeafletModule } from '@bluehalo/ngx-leaflet';
import { CoreUiModule } from '../core-ui/core-ui.module';
Expand Down Expand Up @@ -107,7 +106,6 @@ import { DashboardOverviewTableComponent } from './components/overview/dashboard
MatFormFieldModule,
MatTableModule,
MatButtonModule,
NgxChartsModule,
CdkTableModule,
LeafletModule,
PlatformServicesModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import { FlexLayoutModule } from '@ngbracket/ngx-layout';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ColorPickerModule } from 'ngx-color-picker';
import { MatGridListModule } from '@angular/material/grid-list';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { CdkTableModule } from '@angular/cdk/table';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
Expand Down Expand Up @@ -130,7 +129,6 @@ import { SpDataZoomConfigComponent } from './components/chart-config/data-zoom-c
FormsModule,
ColorPickerModule,
MatGridListModule,
NgxChartsModule,
CdkTableModule,
MatSnackBarModule,
MatProgressSpinnerModule,
Expand Down
2 changes: 0 additions & 2 deletions ui/src/app/data-explorer/data-explorer.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatTabsModule } from '@angular/material/tabs';
import { LeafletModule } from '@bluehalo/ngx-leaflet';

import { NgxChartsModule } from '@swimlane/ngx-charts';
import { GridsterModule } from 'angular-gridster2';
import { ColorPickerModule } from 'ngx-color-picker';
import { PlatformServicesModule } from '@streampipes/platform-services';
Expand Down Expand Up @@ -116,7 +115,6 @@ import { AggregateConfigurationComponent } from './components/chart-view/designe
FormsModule,
ColorPickerModule,
MatGridListModule,
NgxChartsModule,
CdkTableModule,
MatSnackBarModule,
MatProgressSpinnerModule,
Expand Down

0 comments on commit 186bb85

Please sign in to comment.