Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic local kmeans #44

Merged
merged 4 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@angular/platform-browser-dynamic": "^16.2.0",
"@angular/router": "^16.2.0",
"chart.js": "^4.4.0",
"ml-kmeans": "^6.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<app-chart [apiResponse]="apiResponse"></app-chart>
<app-chart [kmeansResult]="kmeansResult"></app-chart>
2 changes: 1 addition & 1 deletion src/app/home/chart-container/chart-container.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import { type ResponseInterface } from '../../interfaces/response-interface'
styleUrls: ['./chart-container.component.css']
})
export class ChartContainerComponent {
@Input() apiResponse: ResponseInterface | undefined
@Input() kmeansResult: ResponseInterface | undefined
}
8 changes: 4 additions & 4 deletions src/app/home/chart-container/chart/chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export class ChartComponent implements AfterViewInit, OnChanges {
public chart: any
chartData: ResponseInterface = MockDaten
datasets: ChartDatasetInterface[] = []
@Input() apiResponse: ResponseInterface | undefined
@Input() kmeansResult: ResponseInterface | undefined

ngAfterViewInit (): void {
this.renderChart()
}

ngOnChanges (changes: SimpleChanges): void {
if (changes['apiResponse'].currentValue !== undefined) {
if (this.apiResponse != null) {
if (changes['kmeansResult'].currentValue !== undefined) {
if (this.kmeansResult != null) {
this.datasets = []
this.chartData = this.apiResponse
this.chartData = this.kmeansResult
}
this.chart.destroy()
this.renderChart()
Expand Down
Loading
Loading