Skip to content

Commit

Permalink
removed dummy data
Browse files Browse the repository at this point in the history
  • Loading branch information
obstjn committed Dec 6, 2023
1 parent 3de3509 commit 5bfbfb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { Chart } from 'chart.js';
templateUrl: './histogram-plot.component.html',
styleUrls: ['./histogram-plot.component.scss']

Check failure on line 9 in src/app/components/qunicorn-app/histogram-plot/histogram-plot.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Insert `,`
})
export class HistogramPlotComponent implements OnInit {
export class HistogramPlotComponent implements OnChanges {

Check failure on line 12 in src/app/components/qunicorn-app/histogram-plot/histogram-plot.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Delete `⏎`
@ViewChild('plot', { static: true }) plotDiv;

@Input() counts: { [props: string]: number } | null = null;

constructor() { }

Check failure on line 17 in src/app/components/qunicorn-app/histogram-plot/histogram-plot.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Delete `·`

ngOnInit(): void {
ngOnChanges(): void {

Check failure on line 20 in src/app/components/qunicorn-app/histogram-plot/histogram-plot.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Delete `⏎`
const labels = Object.keys(this.counts);

Expand All @@ -41,16 +41,12 @@ export class HistogramPlotComponent implements OnInit {
data: data,
options: {
scales: {
x: {
grid: {
offset: true
yAxes: [{
ticks: {
beginAtZero: true,
min: 0,
}
},
y: {
beginAtZero: true,
min: 0,
max: 2010,
}
}]
}
},
}
Expand All @@ -60,8 +56,8 @@ export class HistogramPlotComponent implements OnInit {
const canvas = document.createElement("canvas");
canvas.setAttribute("height", "5px");
canvas.setAttribute("width", "50px");
canvas.width = 5;
canvas.height = 5;
canvas.width = 500;
canvas.height = 500;
const context = canvas.getContext('2d');
context.scale(0.5, 0.5);
//chartcontext.scale(50, 50);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h3>Probabilities:</h3>
</ul>

<h3>Histogram:</h3>
<app-histogram-plot [counts]="{'0': 2007, '11': 1993}"></app-histogram-plot>
<app-histogram-plot [counts]=counts></app-histogram-plot>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { Router } from '@angular/router';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { UtilService } from '../../../util/util.service';
import { HistogramPlotComponent } from '../histogram-plot/histogram-plot.component'
import { HistogramPlotComponent } from '../histogram-plot/histogram-plot.component';

@Component({
selector: 'qunicorn-app',
Expand Down

0 comments on commit 5bfbfb3

Please sign in to comment.