Skip to content

Commit 550b743

Browse files
chore(version): added angular20 support (#2022)
* Introduced DeepPartial type for use in Ng Charts Configuration * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * fix: prettier formatting for base-chart.directive.ts * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support * chore(version): added angular20 support --------- Co-authored-by: Gionata <legrottaglie.gionata@gmail.com>
1 parent 615baac commit 550b743

File tree

15 files changed

+22022
-13562
lines changed

15 files changed

+22022
-13562
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-node@v4
1919
with:
20-
cache: npm
21-
node-version: 18
20+
node-version: 20.19.0
2221
- run: npm ci
2322
- run: npx prettier --check .
2423
- run: npm run lint

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/setup-node@v4
2626
with:
2727
cache: npm
28-
node-version: 18
28+
node-version: 20.19
2929
- run: npm ci
3030
- run: npx prettier --check .
3131
- run: npm run lint
@@ -64,7 +64,7 @@ jobs:
6464
- uses: actions/setup-node@v4
6565
with:
6666
cache: npm
67-
node-version: 18
67+
node-version: 20.19
6868

6969
- uses: actions/download-artifact@v4
7070
with:
-984 Bytes
Loading

apps/ng2-charts-demo/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export function app(): express.Express {
4040
publicPath: browserDistFolder,
4141
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
4242
})
43-
.then((html: any) => res.send(html))
44-
.catch((err: any) => next(err));
43+
.then((html: string) => res.send(html))
44+
.catch((err: Error) => next(err));
4545
});
4646

4747
return server;

apps/ng2-charts-demo/src/app/app.component.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import {
22
AfterViewInit,
33
Component,
44
ElementRef,
5-
Inject,
65
QueryList,
76
Renderer2,
87
ViewChild,
98
ViewChildren,
9+
inject,
1010
} from '@angular/core';
1111
import { DOCUMENT } from '@angular/common';
1212
import { Router, RouterLink, RouterOutlet } from '@angular/router';
@@ -99,12 +99,10 @@ export class AppComponent implements AfterViewInit {
9999
| undefined;
100100
tabLabels: string[] = [];
101101

102-
constructor(
103-
@Inject(DOCUMENT) private document: Document,
104-
private renderer: Renderer2,
105-
private themeService: ThemeService,
106-
private router: Router,
107-
) {}
102+
private document = inject(DOCUMENT);
103+
private renderer = inject(Renderer2);
104+
private themeService = inject(ThemeService);
105+
private router = inject(Router);
108106

109107
ngAfterViewInit(): void {
110108
if (this.tabElements) {

apps/ng2-charts-demo/src/app/line-chart/line-chart.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<app-chart-host chartType="line">
1+
<app-chart-host chartType="line" ngSkipHydration>
22
<canvas
33
baseChart
44
[data]="lineChartData"
@@ -7,7 +7,7 @@
77
(chartHover)="chartHovered($event)"
88
(chartClick)="chartClicked($event)"
99
></canvas>
10-
<table>
10+
<table ngSkipHydration>
1111
<tr>
1212
@for (label of lineChartData.labels; track label) {
1313
<th>{{ label }}</th>

copy-sources.mjs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
import glob from 'glob';
2-
import fs from 'fs';
1+
import { glob } from 'glob';
2+
import fs from 'fs/promises';
33

4-
glob(
5-
`apps/ng2-charts-demo/src/**/*.component.ts`,
6-
{ ignore: 'man.css' },
7-
(err, files) => {
8-
if (err) {
9-
// Handle the error
10-
}
4+
async function copyComponentFiles() {
5+
try {
6+
const files = await glob('apps/ng2-charts-demo/src/**/*.component.ts');
117

128
// Iterate over the list of files
13-
files.forEach((srcPath) => {
9+
for (const srcPath of files) {
1410
// Construct the full path to the destination file
1511
const destPath = srcPath.replace('.ts', '.txt');
1612

17-
fs.copyFile(srcPath, destPath, (err) => {
18-
if (err) {
19-
// Handle the error
20-
}
21-
});
22-
});
23-
},
24-
);
13+
try {
14+
await fs.copyFile(srcPath, destPath);
15+
console.log(`Copied ${srcPath} to ${destPath}`);
16+
} catch (err) {
17+
console.error(`Error copying ${srcPath} to ${destPath}:`, err);
18+
}
19+
}
20+
} catch (err) {
21+
console.error('Error finding files:', err);
22+
}
23+
}
24+
25+
copyComponentFiles();

libs/ng2-charts-schematics/src/ng-add/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Schema } from './schema';
1313
import * as messages from './messages';
1414
import { addPackageToPackageJson } from '../utils/package-config';
1515

16-
const NG2_CHARTS_VERSION = '5.0.0';
16+
const NG2_CHARTS_VERSION = '9.0.0';
1717
const CHARTJS_VERSION = '4.3.0';
1818

1919
/**

libs/ng2-charts/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"version": "8.0.1",
2+
"version": "9.0.0",
33
"name": "ng2-charts",
44
"description": "Reactive, responsive, beautiful charts for Angular based on Chart.js",
55
"peerDependencies": {
6-
"@angular/platform-browser": ">=19.0.0",
7-
"@angular/common": ">=19.0.0",
8-
"@angular/core": ">=19.0.0",
9-
"@angular/cdk": ">=19.0.0",
6+
"@angular/platform-browser": ">=20.0.0",
7+
"@angular/common": ">=20.0.0",
8+
"@angular/core": ">=20.0.0",
9+
"@angular/cdk": ">=20.0.0",
1010
"chart.js": "^3.4.0 || ^4.0.0",
1111
"rxjs": "^6.5.3 || ^7.4.0"
1212
},

libs/ng2-charts/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
export * from './lib/ng-charts.provider';
66
export * from './lib/base-chart.directive';
77
export * from './lib/theme.service';
8+
export * from './lib/utils';

0 commit comments

Comments
 (0)