diff --git a/Dockerfile b/Dockerfile index 78fa9090..b5ee8732 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app COPY . . -RUN npm ci && npm run build --prod +RUN npm install && npm run build --prod FROM nginx:alpine COPY --from=builder app/dist/* /usr/share/nginx/html diff --git a/package-lock.json b/package-lock.json index a3e353d8..35b47d36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/chart.js": "^2.9.40", "angular-bootstrap-md": "^9.3.1", "animate.css": "^4.1.0", - "chart.js": "^4.4.1", + "chart.js": "^2.9.3", "deep-equal": "^2.0.3", "font-awesome": "^4.7.0", "hammerjs": "^2.0.8", @@ -3033,11 +3033,6 @@ "node": ">=4.0.0" } }, - "node_modules/@kurkle/color": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz", - "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==" - }, "node_modules/@loopback/openapi-v3-types": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@loopback/openapi-v3-types/-/openapi-v3-types-1.2.1.tgz", @@ -5210,14 +5205,29 @@ "dev": true }, "node_modules/chart.js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz", - "integrity": "sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==", + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.9.4.tgz", + "integrity": "sha512-B07aAzxcrikjAPyV+01j7BmOpxtQETxTSlQ26BEYJ+3iUkbNKaOJ/nDbT6JjyqYxseM0ON12COHYdU2cTIjC7A==", "dependencies": { - "@kurkle/color": "^0.3.0" - }, - "engines": { - "pnpm": ">=7" + "chartjs-color": "^2.1.0", + "moment": "^2.10.2" + } + }, + "node_modules/chartjs-color": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.4.1.tgz", + "integrity": "sha512-haqOg1+Yebys/Ts/9bLo/BqUcONQOdr/hoEr2LLTRl6C5LXctUdHxsCYfvQVg5JIxITrfCNUDr4ntqmQk9+/0w==", + "dependencies": { + "chartjs-color-string": "^0.6.0", + "color-convert": "^1.9.3" + } + }, + "node_modules/chartjs-color-string": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/chartjs-color-string/-/chartjs-color-string-0.6.0.tgz", + "integrity": "sha512-TIB5OKn1hPJvO7JcteW4WY/63v6KwEdt6udfnDE9iCAZgy+V4SrbSxoIbTw/xkUIapjEI4ExGtD0+6D3KyFd7A==", + "dependencies": { + "color-name": "^1.0.0" } }, "node_modules/chokidar": { @@ -24252,11 +24262,6 @@ } } }, - "@kurkle/color": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz", - "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==" - }, "@loopback/openapi-v3-types": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@loopback/openapi-v3-types/-/openapi-v3-types-1.2.1.tgz", @@ -26098,11 +26103,29 @@ "dev": true }, "chart.js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz", - "integrity": "sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==", + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.9.4.tgz", + "integrity": "sha512-B07aAzxcrikjAPyV+01j7BmOpxtQETxTSlQ26BEYJ+3iUkbNKaOJ/nDbT6JjyqYxseM0ON12COHYdU2cTIjC7A==", + "requires": { + "chartjs-color": "^2.1.0", + "moment": "^2.10.2" + } + }, + "chartjs-color": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.4.1.tgz", + "integrity": "sha512-haqOg1+Yebys/Ts/9bLo/BqUcONQOdr/hoEr2LLTRl6C5LXctUdHxsCYfvQVg5JIxITrfCNUDr4ntqmQk9+/0w==", + "requires": { + "chartjs-color-string": "^0.6.0", + "color-convert": "^1.9.3" + } + }, + "chartjs-color-string": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/chartjs-color-string/-/chartjs-color-string-0.6.0.tgz", + "integrity": "sha512-TIB5OKn1hPJvO7JcteW4WY/63v6KwEdt6udfnDE9iCAZgy+V4SrbSxoIbTw/xkUIapjEI4ExGtD0+6D3KyFd7A==", "requires": { - "@kurkle/color": "^0.3.0" + "color-name": "^1.0.0" } }, "chokidar": { diff --git a/package.json b/package.json index 0d45cda8..1d37baee 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@types/chart.js": "^2.9.40", "angular-bootstrap-md": "^9.3.1", "animate.css": "^4.1.0", - "chart.js": "^4.4.1", + "chart.js": "^2.9.3", "deep-equal": "^2.0.3", "font-awesome": "^4.7.0", "hammerjs": "^2.0.8", diff --git a/src/app/components/qunicorn-app/histogram-plot/histogram-plot.component.ts b/src/app/components/qunicorn-app/histogram-plot/histogram-plot.component.ts index a44ba7a1..7a50256d 100644 --- a/src/app/components/qunicorn-app/histogram-plot/histogram-plot.component.ts +++ b/src/app/components/qunicorn-app/histogram-plot/histogram-plot.component.ts @@ -1,69 +1,66 @@ import { Component, OnChanges, OnInit, ViewChild, Input } from '@angular/core'; import { Chart } from 'chart.js'; - - @Component({ selector: 'app-histogram-plot', templateUrl: './histogram-plot.component.html', - styleUrls: ['./histogram-plot.component.scss'] + styleUrls: ['./histogram-plot.component.scss'], }) export class HistogramPlotComponent implements OnChanges { - @ViewChild('plot', { static: true }) plotDiv; @Input() counts: { [props: string]: number } | null = null; - constructor() { } + constructor() {} ngOnChanges(): void { - const labels = Object.keys(this.counts); const countsData = []; - labels.forEach(label => countsData.push(this.counts[label])); + labels.forEach((label) => countsData.push(this.counts[label])); console.log(labels, countsData); const data = { - labels: labels,//Object.keys(this.counts), + labels, // Object.keys(this.counts), datasets: [ { label: 'Counts', - data: countsData,// Object.values(this.counts), - backgroundColor: "#3f51b5" + data: countsData, // Object.values(this.counts), + backgroundColor: '#3f51b5', }, - ] + ], }; const config = { type: 'bar', - data: data, + data, options: { scales: { - yAxes: [{ + yAxes: [ + { ticks: { - beginAtZero: true, - min: 0, - } - }] - } + beginAtZero: true, + min: 0, + }, + }, + ], + }, }, - } + }; const div: HTMLDivElement = this.plotDiv.nativeElement; - div.innerHTML = ""; - const canvas = document.createElement("canvas"); - canvas.setAttribute("height", "50px"); - canvas.setAttribute("width", "50px"); + div.innerHTML = ''; + const canvas = document.createElement('canvas'); + canvas.setAttribute('height', '50px'); + canvas.setAttribute('width', '50px'); canvas.width = 500; canvas.height = 300; const context = canvas.getContext('2d'); context.scale(0.5, 0.5); - //chartcontext.scale(50, 50); + // chartcontext.scale(50, 50); div.appendChild(canvas); new Chart(context, config); } - } diff --git a/src/app/components/qunicorn-app/qunicorn-view/qunicorn-app.component.html b/src/app/components/qunicorn-app/qunicorn-view/qunicorn-app.component.html index 6ba4e495..55bbbc69 100644 --- a/src/app/components/qunicorn-app/qunicorn-view/qunicorn-app.component.html +++ b/src/app/components/qunicorn-app/qunicorn-view/qunicorn-app.component.html @@ -79,8 +79,7 @@
Input your Deployment ID from the response in Step 1:
-Choose the platform where the Job should be running {{selectedPlatform}} and - {{selectedDevice}}:
+Choose the platform where the Job should be running: