Skip to content

Commit fb3c1a6

Browse files
Copilothotlong
andcommitted
Address code review feedback - improve type safety and readability
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 71572b3 commit fb3c1a6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/ui/src/components/Chart.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ const COLORS = [
3030
'#8B46FF',
3131
];
3232

33+
// Pie chart radius divisor for calculating outer radius
34+
const PIE_RADIUS_DIVISOR = 3;
35+
3336
export type ChartType = 'bar' | 'line' | 'pie' | 'area';
3437

3538
export interface ChartDataPoint {
36-
[key: string]: any;
39+
[key: string]: string | number | null | undefined;
3740
}
3841

3942
export interface ChartProps {
@@ -205,7 +208,7 @@ export function Chart({
205208
nameKey={xAxisKey}
206209
cx="50%"
207210
cy="50%"
208-
outerRadius={height / 3}
211+
outerRadius={height / PIE_RADIUS_DIVISOR}
209212
label
210213
>
211214
{data.map((entry, index) => (

0 commit comments

Comments
 (0)