Change variable name
This commit is contained in:
parent
846f4549b0
commit
a5fa8bd52a
|
@ -7,7 +7,7 @@ import styles from "./PieChart.module.css";
|
||||||
interface PieChartProps {
|
interface PieChartProps {
|
||||||
data: PieChartData[];
|
data: PieChartData[];
|
||||||
width: number;
|
width: number;
|
||||||
textPadding: number;
|
labelWidth: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@ interface PieChartData {
|
||||||
value: number;
|
value: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PieChart({ width, textPadding, ...props }: PieChartProps) {
|
export function PieChart({ width, labelWidth, ...props }: PieChartProps) {
|
||||||
const pieWidth = width * 0.5 - textPadding;
|
const pieWidth = width * 0.5 - labelWidth;
|
||||||
return (
|
return (
|
||||||
<svg className={props.className} width={width} height={width}>
|
<svg className={props.className} width={width} height={width}>
|
||||||
<Group top={width * 0.5} left={width * 0.5}>
|
<Group top={width * 0.5} left={width * 0.5}>
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default function Home() {
|
||||||
<h1>Playground</h1>
|
<h1>Playground</h1>
|
||||||
<p>Show off your components here!</p>
|
<p>Show off your components here!</p>
|
||||||
<div style={{ padding: "30px" }}>
|
<div style={{ padding: "30px" }}>
|
||||||
<PieChart data={mockPieData} width={800} textPadding={200} />
|
<PieChart data={mockPieData} width={800} labelWidth={200} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue