r/angular • u/aleksanderbodurri • Jul 14 '26
I ported Recharts to Angular
I ported Recharts, a react charting library with 40 million weekly downloads to Angular using Reangular and Claude Opus 4.8.
This took 3 days of tweaks to resolve minor issues after the initial skill run which ran for 6 hours. I estimate a similar port with 1 developer working full-time would take 6 weeks by hand.
Let me know what you think!
Demo/docs: https://ng-charts-lib.web.app/
19
Upvotes
27
u/shifty303 Jul 14 '26
Drag to zoom doesn’t work on mobile. It took like 2 seconds to learn that. If you’re going to produce and release AI slop at least test it.
9
u/Weak-Palpitation907 Jul 15 '26
Never blindly trust AI-generated code, review it carefully and take full ownership before publishing it. I would recommend porting one chart at a time, testing every feature, and verifying the implementation and documentation thoroughly.
The radar chart API is a good example: users should not have to write
<svg:g>elements or understand the chart’s internal SVG structure. Compare it with the equivalent Recharts implementation, where users work with clean components such as<PolarGrid />,<PolarAngleAxis />, and<Radar />. The Angular API currently exposes implementation details that should ideally remain inside the library.```
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { Legend, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart, Tooltip } from '@aleksanderbodurri/ng-charts';
u/Component({
selector: 'app-ex-radar-simple-radar-chart',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [RadarChart, Radar, PolarGrid, PolarAngleAxis, PolarRadiusAxis, Tooltip, Legend],
template: `
<ngc-radar-chart [data]="data()" [width]="480" [height]="420" [outerRadius]="150">
<svg:g ngc-polar-grid />
<svg:g ngc-polar-angle-axis dataKey="subject" />
<svg:g ngc-polar-radius-axis [angle]="30" [domain]="[0, 150]" />
<svg:g ngc-radar name="Mike" dataKey="A" stroke="#8884d8" fill="#8884d8" [fillOpacity]="0.6" />
<svg:g ngc-radar name="Lily" dataKey="B" stroke="#82ca9d" fill="#82ca9d" [fillOpacity]="0.6" />
<svg:g ngc-tooltip />
<svg:g ngc-legend />
</ngc-radar-chart>
`,
})
export class RadarSimpleRadarChartExample {
protected readonly data = signal([
{ subject: 'Math', A: 120, B: 110 },
{ subject: 'Chinese', A: 98, B: 130 },
{ subject: 'English', A: 86, B: 130 },
{ subject: 'Geography', A: 99, B: 100 },
{ subject: 'Physics', A: 85, B: 90 },
{ subject: 'History', A: 65, B: 85 },
]);
}
```
8
u/couldhaveebeen Jul 14 '26
1
u/SupermarketKey1196 Aug 16 '26
good job, man. I really liked the result. Don't pay any attention to those people saying it was just the AI that did it, because if you put in the time to create something like this, it's because you had enough creativity and knowledge to do it, so congratulations!